From bd2fe50ec9f73e5b7dcb27338d981fc060f862ee Mon Sep 17 00:00:00 2001 From: Max Wash Date: Sat, 1 Nov 2025 10:12:18 +0000 Subject: [PATCH] test: move all module tests to the test/ directory --- CMakeLists.txt | 10 +++++----- {cmd-test => test/cmd}/example.c | 0 {compress-test => test/compress}/mix-compress.c | 0 {compress-test => test/compress}/mix-decompress.c | 0 {compress-test => test/compress}/simple1.c | 0 {compress-test => test/compress}/stream.c | 0 {core-test => test/core}/core-units.c | 0 {core-test => test/core}/errors.c | 0 {core-test => test/core}/hash.c | 0 {core-test => test/core}/randomise.c | 0 {core-test => test/core}/ringbuffers.c | 0 {core-test => test/core}/ropes.c | 0 {core-test => test/core}/streams.c | 0 {ds-test => test/ds}/arrays.c | 0 {ds-test => test/ds}/ds-units.c | 0 {ds-test => test/ds}/numbers.c | 0 {ds-test => test/ds}/simple.c | 0 {ds-test => test/ds}/streams.c | 0 {ds-test => test/ds}/strings.c | 0 {ds-test => test/ds}/trees.c | 0 {ds-test => test/ds}/unicode-strings.c | 0 {ds-test => test/ds}/uuids.c | 0 {io-test => test/io}/io-units.c | 0 {io-test => test/io}/mkdir.c | 0 {io-test => test/io}/rmdir.c | 0 {io-test => test/io}/streams.c | 0 {io-test => test/io}/tree.c | 0 {serial-test => test/serial}/streams.c | 0 {serial-test => test/serial}/toml-decode.c | 0 {serial-test => test/serial}/toml-encode.c | 0 {term-test => test/term}/errors.c | 0 {term-test => test/term}/printing.c | 0 32 files changed, 5 insertions(+), 5 deletions(-) rename {cmd-test => test/cmd}/example.c (100%) rename {compress-test => test/compress}/mix-compress.c (100%) rename {compress-test => test/compress}/mix-decompress.c (100%) rename {compress-test => test/compress}/simple1.c (100%) rename {compress-test => test/compress}/stream.c (100%) rename {core-test => test/core}/core-units.c (100%) rename {core-test => test/core}/errors.c (100%) rename {core-test => test/core}/hash.c (100%) rename {core-test => test/core}/randomise.c (100%) rename {core-test => test/core}/ringbuffers.c (100%) rename {core-test => test/core}/ropes.c (100%) rename {core-test => test/core}/streams.c (100%) rename {ds-test => test/ds}/arrays.c (100%) rename {ds-test => test/ds}/ds-units.c (100%) rename {ds-test => test/ds}/numbers.c (100%) rename {ds-test => test/ds}/simple.c (100%) rename {ds-test => test/ds}/streams.c (100%) rename {ds-test => test/ds}/strings.c (100%) rename {ds-test => test/ds}/trees.c (100%) rename {ds-test => test/ds}/unicode-strings.c (100%) rename {ds-test => test/ds}/uuids.c (100%) rename {io-test => test/io}/io-units.c (100%) rename {io-test => test/io}/mkdir.c (100%) rename {io-test => test/io}/rmdir.c (100%) rename {io-test => test/io}/streams.c (100%) rename {io-test => test/io}/tree.c (100%) rename {serial-test => test/serial}/streams.c (100%) rename {serial-test => test/serial}/toml-decode.c (100%) rename {serial-test => test/serial}/toml-encode.c (100%) rename {term-test => test/term}/errors.c (100%) rename {term-test => test/term}/printing.c (100%) diff --git a/CMakeLists.txt b/CMakeLists.txt index 3964bc3..943cf43 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -22,12 +22,12 @@ set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/bin) foreach (module ${b_modules}) add_subdirectory(${module}) - if (EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${module}-test) + if (EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/test/${module}) message(STATUS "Building unit tests for module ${module}") - if (EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${module}-test/${module}-units.c) + if (EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/test/${module}/${module}-units.c) add_executable(blue-${module}-units - ${module}-test/${module}-units.c + test/${module}/${module}-units.c misc/AllTests.c misc/CuTest.c misc/CuTest.h) @@ -37,8 +37,8 @@ foreach (module ${b_modules}) endif () - file(GLOB test_sources ${module}-test/*.c) - list(REMOVE_ITEM test_sources "${CMAKE_CURRENT_SOURCE_DIR}/${module}-test/${module}-units.c") + file(GLOB test_sources test/${module}/*.c) + list(REMOVE_ITEM test_sources "${CMAKE_CURRENT_SOURCE_DIR}/test/${module}/${module}-units.c") foreach (test_file ${test_sources}) get_filename_component(test_name ${test_file} NAME_WE) diff --git a/cmd-test/example.c b/test/cmd/example.c similarity index 100% rename from cmd-test/example.c rename to test/cmd/example.c diff --git a/compress-test/mix-compress.c b/test/compress/mix-compress.c similarity index 100% rename from compress-test/mix-compress.c rename to test/compress/mix-compress.c diff --git a/compress-test/mix-decompress.c b/test/compress/mix-decompress.c similarity index 100% rename from compress-test/mix-decompress.c rename to test/compress/mix-decompress.c diff --git a/compress-test/simple1.c b/test/compress/simple1.c similarity index 100% rename from compress-test/simple1.c rename to test/compress/simple1.c diff --git a/compress-test/stream.c b/test/compress/stream.c similarity index 100% rename from compress-test/stream.c rename to test/compress/stream.c diff --git a/core-test/core-units.c b/test/core/core-units.c similarity index 100% rename from core-test/core-units.c rename to test/core/core-units.c diff --git a/core-test/errors.c b/test/core/errors.c similarity index 100% rename from core-test/errors.c rename to test/core/errors.c diff --git a/core-test/hash.c b/test/core/hash.c similarity index 100% rename from core-test/hash.c rename to test/core/hash.c diff --git a/core-test/randomise.c b/test/core/randomise.c similarity index 100% rename from core-test/randomise.c rename to test/core/randomise.c diff --git a/core-test/ringbuffers.c b/test/core/ringbuffers.c similarity index 100% rename from core-test/ringbuffers.c rename to test/core/ringbuffers.c diff --git a/core-test/ropes.c b/test/core/ropes.c similarity index 100% rename from core-test/ropes.c rename to test/core/ropes.c diff --git a/core-test/streams.c b/test/core/streams.c similarity index 100% rename from core-test/streams.c rename to test/core/streams.c diff --git a/ds-test/arrays.c b/test/ds/arrays.c similarity index 100% rename from ds-test/arrays.c rename to test/ds/arrays.c diff --git a/ds-test/ds-units.c b/test/ds/ds-units.c similarity index 100% rename from ds-test/ds-units.c rename to test/ds/ds-units.c diff --git a/ds-test/numbers.c b/test/ds/numbers.c similarity index 100% rename from ds-test/numbers.c rename to test/ds/numbers.c diff --git a/ds-test/simple.c b/test/ds/simple.c similarity index 100% rename from ds-test/simple.c rename to test/ds/simple.c diff --git a/ds-test/streams.c b/test/ds/streams.c similarity index 100% rename from ds-test/streams.c rename to test/ds/streams.c diff --git a/ds-test/strings.c b/test/ds/strings.c similarity index 100% rename from ds-test/strings.c rename to test/ds/strings.c diff --git a/ds-test/trees.c b/test/ds/trees.c similarity index 100% rename from ds-test/trees.c rename to test/ds/trees.c diff --git a/ds-test/unicode-strings.c b/test/ds/unicode-strings.c similarity index 100% rename from ds-test/unicode-strings.c rename to test/ds/unicode-strings.c diff --git a/ds-test/uuids.c b/test/ds/uuids.c similarity index 100% rename from ds-test/uuids.c rename to test/ds/uuids.c diff --git a/io-test/io-units.c b/test/io/io-units.c similarity index 100% rename from io-test/io-units.c rename to test/io/io-units.c diff --git a/io-test/mkdir.c b/test/io/mkdir.c similarity index 100% rename from io-test/mkdir.c rename to test/io/mkdir.c diff --git a/io-test/rmdir.c b/test/io/rmdir.c similarity index 100% rename from io-test/rmdir.c rename to test/io/rmdir.c diff --git a/io-test/streams.c b/test/io/streams.c similarity index 100% rename from io-test/streams.c rename to test/io/streams.c diff --git a/io-test/tree.c b/test/io/tree.c similarity index 100% rename from io-test/tree.c rename to test/io/tree.c diff --git a/serial-test/streams.c b/test/serial/streams.c similarity index 100% rename from serial-test/streams.c rename to test/serial/streams.c diff --git a/serial-test/toml-decode.c b/test/serial/toml-decode.c similarity index 100% rename from serial-test/toml-decode.c rename to test/serial/toml-decode.c diff --git a/serial-test/toml-encode.c b/test/serial/toml-encode.c similarity index 100% rename from serial-test/toml-encode.c rename to test/serial/toml-encode.c diff --git a/term-test/errors.c b/test/term/errors.c similarity index 100% rename from term-test/errors.c rename to test/term/errors.c diff --git a/term-test/printing.c b/test/term/printing.c similarity index 100% rename from term-test/printing.c rename to test/term/printing.c