aedi: add expect macro to improve test failure report

this allows to make tests a bit more concise
This commit is contained in:
alexey.lysiuk 2021-05-17 10:28:02 +03:00
parent 20b29b40dc
commit bc866fdd9d
2 changed files with 4 additions and 0 deletions

View file

@ -75,6 +75,7 @@ class TestDepsTarget(BuildTarget):
'-arch', 'x86_64', '-arch', 'x86_64',
'-arch', 'arm64', '-arch', 'arm64',
'-std=c++17', '-std=c++17',
'-include', os.path.join(test_path, 'aedi.h'),
'-o', exe_name, '-o', exe_name,
entry.path, entry.path,
] ]

3
test/aedi.h Normal file
View file

@ -0,0 +1,3 @@
#define AEDI_EXPECT(CODE) if (!(CODE)) { puts(#CODE); return 1; }
extern "C" int puts(const char*);