diff --git a/code/tests/meson.build b/code/tests/meson.build index b17aabf6..2aac0350 100644 --- a/code/tests/meson.build +++ b/code/tests/meson.build @@ -1,15 +1,10 @@ if get_option('with_test').enabled() run_command(['python3', 'tools' / 'generate-runner.py'], check: true) + cards = run_command(['python3', 'tools' / 'wildcard.py'], check: true) - test_c = ['unit_runner.c'] - test_cases = ['sample', 'bdd', 'tdd', 'ddd', 'mark', 'mock', 'sanity'] + test_cases = ['unit_runner.c', cards.stdout().strip().split('\n')] - foreach cases : test_cases - test_c += ['cases' / 'test_' + cases + '.c'] - test_c += ['cases' / 'test_' + cases + '.cpp'] - endforeach - - pizza_c = executable('pizza', test_c, include_directories: dir, dependencies: [fossil_test_dep]) + pizza_c = executable('pizza', test_cases, include_directories: dir, dependencies: [fossil_test_dep]) test('fossil testing C', pizza_c) endif \ No newline at end of file diff --git a/code/tests/tools/wildcard.py b/code/tests/tools/wildcard.py new file mode 100644 index 00000000..fbc51a6d --- /dev/null +++ b/code/tests/tools/wildcard.py @@ -0,0 +1,8 @@ +import glob + +# Collect all .c and .cpp files directly in the cases directory (not subdirectories) +source_files = glob.glob("cases/*.c") + glob.glob("cases/*.cpp") + +# Print each file name with "cases/" prefix +for file in source_files: + print(file)