Skip to content

Commit 7464904

Browse files
Merge pull request #123 from dreamer-coding/wilecard_script
Adding Wilecard script
2 parents a57668b + d19ef62 commit 7464904

File tree

2 files changed

+11
-8
lines changed

2 files changed

+11
-8
lines changed

code/tests/meson.build

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,10 @@
11
if get_option('with_test').enabled()
22
run_command(['python3', 'tools' / 'generate-runner.py'], check: true)
3+
cards = run_command(['python3', 'tools' / 'wildcard.py'], check: true)
34

4-
test_c = ['unit_runner.c']
5-
test_cases = ['sample', 'bdd', 'tdd', 'ddd', 'mark', 'mock', 'sanity']
5+
test_cases = ['unit_runner.c', cards.stdout().strip().split('\n')]
66

7-
foreach cases : test_cases
8-
test_c += ['cases' / 'test_' + cases + '.c']
9-
test_c += ['cases' / 'test_' + cases + '.cpp']
10-
endforeach
11-
12-
pizza_c = executable('pizza', test_c, include_directories: dir, dependencies: [fossil_test_dep])
7+
pizza_c = executable('pizza', test_cases, include_directories: dir, dependencies: [fossil_test_dep])
138

149
test('fossil testing C', pizza_c)
1510
endif

code/tests/tools/wildcard.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import glob
2+
3+
# Collect all .c and .cpp files directly in the cases directory (not subdirectories)
4+
source_files = glob.glob("cases/*.c") + glob.glob("cases/*.cpp")
5+
6+
# Print each file name with "cases/" prefix
7+
for file in source_files:
8+
print(file)

0 commit comments

Comments
 (0)