1 # Use Meson's filesystem module for portable file operations
4 # Define test categories with their properties
11 'path': 'csv/invalid',
20 # Auto-discover CSV files and create tests for each category
21 foreach category, props : test_categories
22 # Find CSV files for this category
23 files_result = run_command('find', props['path'], '-name', '*.csv', '-type', 'f', check: true)
24 file_list = files_result.stdout().strip().split('\n')
25 csv_files = files(file_list)
27 # Create tests for each file in this category
28 foreach test_file : csv_files
29 # Extract filename without extension
30 test_name = fs.stem(test_file)
32 # Create the test with conditional should_fail
33 if props['should_fail']
34 test('csv_parser_' + category + '_' + test_name,
37 workdir: meson.current_source_dir(),
40 env: {'CSV_TEST_MODE': category})
42 test('csv_parser_' + category + '_' + test_name,
45 workdir: meson.current_source_dir(),
47 env: {'CSV_TEST_MODE': category})