-fixed some meson issues on windows (becs and tests compilation works. Demos not yet)

-now tests compile proper files
-added setjmp bindings for Windows. It doesn't work on LDC build (singal API could works)
This commit is contained in:
Mergul 2021-03-06 22:00:08 +01:00
parent 180f2ed336
commit 37d15f97d6
4 changed files with 51 additions and 13 deletions

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";
static jmp_buf gEnvBuffer;
static AssertInfo gAssertInfo;
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;
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[]);