From bc866fdd9da1d096cc10a90214771f9d9415a90a Mon Sep 17 00:00:00 2001 From: "alexey.lysiuk" Date: Mon, 17 May 2021 10:28:02 +0300 Subject: [PATCH] aedi: add expect macro to improve test failure report this allows to make tests a bit more concise --- aedi/target/special.py | 1 + test/aedi.h | 3 +++ 2 files changed, 4 insertions(+) create mode 100644 test/aedi.h diff --git a/aedi/target/special.py b/aedi/target/special.py index cd3c4268..4f4c4311 100644 --- a/aedi/target/special.py +++ b/aedi/target/special.py @@ -75,6 +75,7 @@ class TestDepsTarget(BuildTarget): '-arch', 'x86_64', '-arch', 'arm64', '-std=c++17', + '-include', os.path.join(test_path, 'aedi.h'), '-o', exe_name, entry.path, ] diff --git a/test/aedi.h b/test/aedi.h new file mode 100644 index 00000000..25f0c4e4 --- /dev/null +++ b/test/aedi.h @@ -0,0 +1,3 @@ +#define AEDI_EXPECT(CODE) if (!(CODE)) { puts(#CODE); return 1; } + +extern "C" int puts(const char*);