Add single header and single source entries for all components as well as the full library (#2)

Reviewed-on: #2
Co-authored-by: Abdelrahman <said.abdelrahman89@gmail.com>
Co-committed-by: Abdelrahman <said.abdelrahman89@gmail.com>
This commit is contained in:
2025-02-23 15:19:14 +00:00
committed by Abdelrahman Said
parent 4f5dd3900f
commit 491c742189
14 changed files with 136 additions and 4 deletions

View File

@@ -0,0 +1,34 @@
#ifndef TESTER_H
#define TESTER_H
#include "misc_utils.h"
#include "platform.h"
#include "str8.h"
#include <stdbool.h>
#ifdef __cplusplus
BEGIN_C_LINKAGE
#endif // __cplusplus
#define wapp_tester_result(PASSED) ((TestFuncResult){.name = wapp_str8_lit_ro(__func__), .passed = PASSED})
#define wapp_tester_run_tests(...) run_tests(__VA_ARGS__, NULL)
typedef struct test_func_result TestFuncResult;
struct test_func_result {
Str8RO name;
bool passed;
#ifdef WAPP_PLATFORM_WINDOWS
wapp_misc_utils_padding_size(sizeof(Str8RO) + sizeof(bool));
#endif // WAPP_PLATFORM_WINDOWS
};
typedef TestFuncResult(TestFunc)(void);
void run_tests(TestFunc *func1, ...);
#ifdef __cplusplus
END_C_LINKAGE
#endif // __cplusplus
#endif // !TESTER_H