Changes for beta release #20

Merged
Mergul merged 4 commits from beta-release into master 2021-03-06 23:51:11 +01:00
4 changed files with 51 additions and 13 deletions
Showing only changes of commit 21b657a84b - Show all commits

View file

@ -3,10 +3,12 @@ project('decs', 'd', version : '0.5.0')
# Options
betterC_opt = get_option('betterC')
BuildDemos_opt = get_option('BuildDemos')
BuildTests_opt = get_option('BuildTests')
LTO_otp = get_option('LTO')
summary('betterC enabled', betterC_opt)
summary('build demos', BuildDemos_opt)
summary('build tests', BuildTests_opt)
summary('LTO enabled', LTO_otp)
meson_minimum_version = '>=0.57.1'
@ -65,7 +67,9 @@ decs_dep = declare_dependency(
)
# Tests
if BuildTests_opt
subdir('tests')
endif
# Demos
if BuildDemos_opt

View file

@ -1,3 +1,4 @@
option('betterC', type: 'boolean', value: false)
option('BuildDemos', type: 'boolean', value: false)
option('BuildTests', type: 'boolean', value: false)
option('LTO', type: 'boolean', value: false)

View file

@ -1,10 +1,18 @@
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',
tests_src,
include_directories : [inc],
include_directories : [inc, include_directories('..')],
d_args : args,
link_args : link_args,
dependencies : decs_dep,

View file

@ -3,7 +3,6 @@ module tests.runner;
import core.stdc.stdio;
import core.stdc.string;
import core.sys.posix.setjmp;
import bubel.ecs.vector;
import bubel.ecs.simple_vector;
@ -25,11 +24,36 @@ else
enum int ASSERTED = 123;
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 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;
@ -40,12 +64,6 @@ struct AssertInfo
int line;
}
extern (C) void __assert(const char* msg, const char* file, int line)
{
gAssertInfo = AssertInfo(msg, file, line);
longjmp(gEnvBuffer, ASSERTED);
}
struct Test
{
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;
runner.runTests(include[], exclude[]);