Merge branch 'windows-fixes' of https://gitlab.com/Mergul/bubel-ecs.git into beta-release
This commit is contained in:
commit
21b657a84b
4 changed files with 51 additions and 13 deletions
|
|
@ -3,10 +3,12 @@ project('decs', 'd', version : '0.5.0')
|
||||||
# Options
|
# Options
|
||||||
betterC_opt = get_option('betterC')
|
betterC_opt = get_option('betterC')
|
||||||
BuildDemos_opt = get_option('BuildDemos')
|
BuildDemos_opt = get_option('BuildDemos')
|
||||||
|
BuildTests_opt = get_option('BuildTests')
|
||||||
LTO_otp = get_option('LTO')
|
LTO_otp = get_option('LTO')
|
||||||
|
|
||||||
summary('betterC enabled', betterC_opt)
|
summary('betterC enabled', betterC_opt)
|
||||||
summary('build demos', BuildDemos_opt)
|
summary('build demos', BuildDemos_opt)
|
||||||
|
summary('build tests', BuildTests_opt)
|
||||||
summary('LTO enabled', LTO_otp)
|
summary('LTO enabled', LTO_otp)
|
||||||
|
|
||||||
meson_minimum_version = '>=0.57.1'
|
meson_minimum_version = '>=0.57.1'
|
||||||
|
|
@ -65,7 +67,9 @@ decs_dep = declare_dependency(
|
||||||
)
|
)
|
||||||
|
|
||||||
# Tests
|
# Tests
|
||||||
|
if BuildTests_opt
|
||||||
subdir('tests')
|
subdir('tests')
|
||||||
|
endif
|
||||||
|
|
||||||
# Demos
|
# Demos
|
||||||
if BuildDemos_opt
|
if BuildDemos_opt
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,4 @@
|
||||||
option('betterC', type: 'boolean', value: false)
|
option('betterC', type: 'boolean', value: false)
|
||||||
option('BuildDemos', type: 'boolean', value: false)
|
option('BuildDemos', type: 'boolean', value: false)
|
||||||
|
option('BuildTests', type: 'boolean', value: false)
|
||||||
option('LTO', type: 'boolean', value: false)
|
option('LTO', type: 'boolean', value: false)
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,18 @@
|
||||||
tests_src = files(
|
tests_src = files(
|
||||||
'tests.d',
|
'access_perf.d',
|
||||||
|
'basic.d',
|
||||||
|
'bugs.d',
|
||||||
|
'id_manager.d',
|
||||||
|
'map.d',
|
||||||
|
'perf.d',
|
||||||
|
'runner.d',
|
||||||
|
'time.d',
|
||||||
|
'vector.d'
|
||||||
)
|
)
|
||||||
|
|
||||||
exe = executable('decs-tests',
|
exe = executable('decs-tests',
|
||||||
tests_src,
|
tests_src,
|
||||||
include_directories : [inc],
|
include_directories : [inc, include_directories('..')],
|
||||||
d_args : args,
|
d_args : args,
|
||||||
link_args : link_args,
|
link_args : link_args,
|
||||||
dependencies : decs_dep,
|
dependencies : decs_dep,
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,6 @@ module tests.runner;
|
||||||
|
|
||||||
import core.stdc.stdio;
|
import core.stdc.stdio;
|
||||||
import core.stdc.string;
|
import core.stdc.string;
|
||||||
import core.sys.posix.setjmp;
|
|
||||||
|
|
||||||
import bubel.ecs.vector;
|
import bubel.ecs.vector;
|
||||||
import bubel.ecs.simple_vector;
|
import bubel.ecs.simple_vector;
|
||||||
|
|
@ -25,11 +24,36 @@ else
|
||||||
enum int ASSERTED = 123;
|
enum int ASSERTED = 123;
|
||||||
enum string OUT_FILE = "test_report.xml";
|
enum string OUT_FILE = "test_report.xml";
|
||||||
|
|
||||||
|
version (D_BetterC)
|
||||||
|
{
|
||||||
|
version(Posix)
|
||||||
|
{
|
||||||
|
import core.sys.posix.setjmp;
|
||||||
|
}
|
||||||
|
else version(Windows)
|
||||||
|
{
|
||||||
|
version(X86)
|
||||||
|
alias jmp_buf = ubyte[64];
|
||||||
|
else version(X86_64)
|
||||||
|
alias jmp_buf = ubyte[256];
|
||||||
|
else version(IA64)
|
||||||
|
alias jmp_buf = ubyte[512];
|
||||||
|
|
||||||
|
extern (C) {
|
||||||
|
int _setjmp(ref jmp_buf);
|
||||||
|
void longjmp(ref jmp_buf, int);
|
||||||
|
}
|
||||||
|
alias setjmp = _setjmp;
|
||||||
|
}
|
||||||
|
|
||||||
static jmp_buf gEnvBuffer;
|
static jmp_buf gEnvBuffer;
|
||||||
static AssertInfo gAssertInfo;
|
static AssertInfo gAssertInfo;
|
||||||
|
|
||||||
version (D_BetterC)
|
extern (C) void __assert(const char* msg, const char* file, int line)
|
||||||
{
|
{
|
||||||
|
gAssertInfo = AssertInfo(msg, file, line);
|
||||||
|
longjmp(gEnvBuffer, ASSERTED);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else version = notBetterC;
|
else version = notBetterC;
|
||||||
|
|
||||||
|
|
@ -40,12 +64,6 @@ struct AssertInfo
|
||||||
int line;
|
int line;
|
||||||
}
|
}
|
||||||
|
|
||||||
extern (C) void __assert(const char* msg, const char* file, int line)
|
|
||||||
{
|
|
||||||
gAssertInfo = AssertInfo(msg, file, line);
|
|
||||||
longjmp(gEnvBuffer, ASSERTED);
|
|
||||||
}
|
|
||||||
|
|
||||||
struct Test
|
struct Test
|
||||||
{
|
{
|
||||||
string file;
|
string file;
|
||||||
|
|
@ -427,6 +445,13 @@ extern (C) int main(int argc, char** args)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static import tests.id_manager;
|
||||||
|
static import tests.vector;
|
||||||
|
static import tests.basic;
|
||||||
|
static import tests.perf;
|
||||||
|
static import tests.access_perf;
|
||||||
|
static import tests.bugs;
|
||||||
|
static import tests.map;
|
||||||
TestRunner!(tests.id_manager, tests.vector, tests.basic, tests.perf, tests.access_perf, tests.bugs, tests.map) runner;
|
TestRunner!(tests.id_manager, tests.vector, tests.basic, tests.perf, tests.access_perf, tests.bugs, tests.map) runner;
|
||||||
|
|
||||||
runner.runTests(include[], exclude[]);
|
runner.runTests(include[], exclude[]);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue