From b1e857cf1471d1871a9396696b22fa531da98249 Mon Sep 17 00:00:00 2001 From: Aldrik Ramaekers Date: Sat, 23 Nov 2024 22:33:43 +0100 Subject: add projbase to repo --- project-base/src/addons/test_helper.h | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 project-base/src/addons/test_helper.h (limited to 'project-base/src/addons/test_helper.h') diff --git a/project-base/src/addons/test_helper.h b/project-base/src/addons/test_helper.h new file mode 100644 index 0000000..c2a5096 --- /dev/null +++ b/project-base/src/addons/test_helper.h @@ -0,0 +1,30 @@ +/* +* BSD 2-Clause “Simplified” License +* Copyright (c) 2019, Aldrik Ramaekers, aldrik.ramaekers@protonmail.com +* All rights reserved. +*/ + +#ifndef INCLUDE_ADDON_TEST_HELPER +#define INCLUDE_ADDON_TEST_HELPER + +#define error_if(e) if (e) { printf(" --! ERROR AT: %s\n", #e); return 1; }; +#define success return 0; + +#define CONFIG_DIRECTORY "test_program_config" + +bool failure = false; +void print_h1(char *str) { + printf("# %s\n", str); +} + +void print_result(char *str, s32 result) { + if (!result) { + printf(" %s\n", str); + } + else { + printf(" %s - FAILURE\n", str); + failure = true; + } +} + +#endif \ No newline at end of file -- cgit v1.2.3-70-g09d2