From 82c23eed5ee2d542cb595b4e12f6863fa484eed6 Mon Sep 17 00:00:00 2001 From: Abdelrahman Said Date: Mon, 24 Feb 2025 08:52:46 +0000 Subject: [PATCH] Use the wapp.h header in tests --- build.ps1 | 2 +- compile | 2 +- tests/allocator/test_allocator.c | 4 +--- tests/allocator/test_allocator.h | 2 +- tests/arena/test_arena.c | 5 +---- tests/arena/test_arena.h | 2 +- tests/cpath/test_cpath.c | 7 +------ tests/cpath/test_cpath.h | 2 +- tests/shell_commander/test_shell_commander.c | 4 +--- tests/shell_commander/test_shell_commander.h | 2 +- tests/str8/test_str8.c | 6 +----- tests/str8/test_str8.h | 2 +- tests/str8/test_str8_list.c | 3 +-- tests/str8/test_str8_list.h | 2 +- tests/wapptest.c | 2 +- 15 files changed, 15 insertions(+), 32 deletions(-) diff --git a/build.ps1 b/build.ps1 index e002060..25a8f5e 100644 --- a/build.ps1 +++ b/build.ps1 @@ -11,7 +11,7 @@ $Kernel = (Get-ChildItem Env:OS).Value $Machine = (Get-ChildItem Env:PROCESSOR_ARCHITECTURE).Value $Platform = "${Kernel}_${Machine}" -$IncludeDirs = Get-ChildItem -Path src -Recurse -Directory -ErrorAction SilentlyContinue -Force | %{$("/I " + '"' + $_.FullName + '"')} +$IncludeDirs = "/I src" $SrcFiles = "src/wapp.c" $TestIncludeDirs = Get-ChildItem -Path tests -Recurse -Directory -ErrorAction SilentlyContinue -Force | %{$("/I " + '"' + $_.FullName + '"')} diff --git a/compile b/compile index b371304..de3b931 100755 --- a/compile +++ b/compile @@ -61,7 +61,7 @@ case $COMPONENTS in ;; esac -TEST_INCLUDE="$(find src -type d | xargs -I{} echo -n "-I{} ") $(find tests -type d | xargs -I{} echo -n "-I{} ")" +TEST_INCLUDE="-Isrc $(find tests -type d | xargs -I{} echo -n "-I{} ")" TEST_SRC="$(find tests -type f -name "*.c" | xargs -I{} echo -n "{} ")" BUILD_DIR="libwapp-build/$PLATFORM-$BUILD_TYPE" diff --git a/tests/allocator/test_allocator.c b/tests/allocator/test_allocator.c index 5291d2a..9d02517 100644 --- a/tests/allocator/test_allocator.c +++ b/tests/allocator/test_allocator.c @@ -1,7 +1,5 @@ #include "test_allocator.h" -#include "mem_allocator.h" -#include "mem_arena_allocator.h" -#include "tester.h" +#include "wapp.h" #include #include diff --git a/tests/allocator/test_allocator.h b/tests/allocator/test_allocator.h index 4e74555..99f6e34 100644 --- a/tests/allocator/test_allocator.h +++ b/tests/allocator/test_allocator.h @@ -1,7 +1,7 @@ #ifndef TEST_ALLOCATOR_H #define TEST_ALLOCATOR_H -#include "tester.h" +#include "wapp.h" #ifdef __cplusplus BEGIN_C_LINKAGE diff --git a/tests/arena/test_arena.c b/tests/arena/test_arena.c index 5e12284..c13abff 100644 --- a/tests/arena/test_arena.c +++ b/tests/arena/test_arena.c @@ -1,8 +1,5 @@ #include "test_arena.h" -#include "aliases.h" -#include "mem_arena.h" -#include "misc_utils.h" -#include "tester.h" +#include "wapp.h" #include #include diff --git a/tests/arena/test_arena.h b/tests/arena/test_arena.h index 0ebad3e..81f0c88 100644 --- a/tests/arena/test_arena.h +++ b/tests/arena/test_arena.h @@ -1,7 +1,7 @@ #ifndef TEST_ARENA_H #define TEST_ARENA_H -#include "tester.h" +#include "wapp.h" #ifdef __cplusplus BEGIN_C_LINKAGE diff --git a/tests/cpath/test_cpath.c b/tests/cpath/test_cpath.c index 5f789f0..003d740 100644 --- a/tests/cpath/test_cpath.c +++ b/tests/cpath/test_cpath.c @@ -1,10 +1,5 @@ #include "test_cpath.h" -#include "cpath.h" -#include "mem_allocator.h" -#include "mem_arena_allocator.h" -#include "misc_utils.h" -#include "str8.h" -#include "tester.h" +#include "wapp.h" #include #include #include diff --git a/tests/cpath/test_cpath.h b/tests/cpath/test_cpath.h index 1584876..c644a6d 100644 --- a/tests/cpath/test_cpath.h +++ b/tests/cpath/test_cpath.h @@ -1,7 +1,7 @@ #ifndef TEST_CPATH_H #define TEST_CPATH_H -#include "tester.h" +#include "wapp.h" #ifdef __cplusplus BEGIN_C_LINKAGE diff --git a/tests/shell_commander/test_shell_commander.c b/tests/shell_commander/test_shell_commander.c index 70f1081..3682320 100644 --- a/tests/shell_commander/test_shell_commander.c +++ b/tests/shell_commander/test_shell_commander.c @@ -1,7 +1,5 @@ #include "test_shell_commander.h" -#include "commander.h" -#include "str8.h" -#include "tester.h" +#include "wapp.h" #include #include #include diff --git a/tests/shell_commander/test_shell_commander.h b/tests/shell_commander/test_shell_commander.h index 1854237..bd9fced 100644 --- a/tests/shell_commander/test_shell_commander.h +++ b/tests/shell_commander/test_shell_commander.h @@ -1,7 +1,7 @@ #ifndef TEST_SHELL_COMMANDER_H #define TEST_SHELL_COMMANDER_H -#include "tester.h" +#include "wapp.h" #ifdef __cplusplus BEGIN_C_LINKAGE diff --git a/tests/str8/test_str8.c b/tests/str8/test_str8.c index 427e763..adf41af 100644 --- a/tests/str8/test_str8.c +++ b/tests/str8/test_str8.c @@ -1,9 +1,5 @@ #include "test_str8.h" -#include "mem_allocator.h" -#include "mem_arena_allocator.h" -#include "misc_utils.h" -#include "str8.h" -#include "tester.h" +#include "wapp.h" #include #define ARRLEN(ARR) (sizeof(ARR) / sizeof(ARR[0])) diff --git a/tests/str8/test_str8.h b/tests/str8/test_str8.h index a4837df..d5e3712 100644 --- a/tests/str8/test_str8.h +++ b/tests/str8/test_str8.h @@ -1,7 +1,7 @@ #ifndef TEST_STR8_H #define TEST_STR8_H -#include "tester.h" +#include "wapp.h" #ifdef __cplusplus BEGIN_C_LINKAGE diff --git a/tests/str8/test_str8_list.c b/tests/str8/test_str8_list.c index ed6dfc5..b11ded9 100644 --- a/tests/str8/test_str8_list.c +++ b/tests/str8/test_str8_list.c @@ -1,6 +1,5 @@ #include "test_str8_list.h" -#include "str8.h" -#include "tester.h" +#include "wapp.h" TestFuncResult test_str8_list_get(void) { bool result; diff --git a/tests/str8/test_str8_list.h b/tests/str8/test_str8_list.h index 514e292..79930f9 100644 --- a/tests/str8/test_str8_list.h +++ b/tests/str8/test_str8_list.h @@ -1,7 +1,7 @@ #ifndef TEST_STR8_LIST_H #define TEST_STR8_LIST_H -#include "tester.h" +#include "wapp.h" #ifdef __cplusplus BEGIN_C_LINKAGE diff --git a/tests/wapptest.c b/tests/wapptest.c index 24471fc..cfd6a59 100644 --- a/tests/wapptest.c +++ b/tests/wapptest.c @@ -4,7 +4,7 @@ #include "test_arena.h" #include "test_cpath.h" #include "test_shell_commander.h" -#include "tester.h" +#include "wapp.h" #include int main(void) {