]> begriffs open source - sa-parse/blob - tests/meson.build
Switch to Meson build system
[sa-parse] / tests / meson.build
1 # Basic test configuration for CSV parser
2
3 # Define test cases with their properties
4 # Format: [test_name, test_file, test_description]
5 csv_test_cases = [
6     ['basic', 'test.csv', 'Simple test to verify the parser can be executed'],
7     ['empty', 'empty.csv', 'Test with empty CSV'],
8     ['quotes', 'quotes.csv', 'Test with quotes'],
9     ['complex', 'complex.csv', 'Test with complex CSV structures'],
10     ['header_only', 'header_only.csv', 'Test with header only CSV'],
11 ]
12
13 # Special test case that should fail due to parser limitation
14 csv_failing_tests = [
15     ['empty_fields', 'empty_fields.csv', 'Test with empty fields (currently expected to fail due to parser limitation)'],
16 ]
17
18 # Get shell program once
19 sh = find_program('sh')
20
21 # Create tests for normal cases
22 foreach test_case : csv_test_cases
23     test_name = test_case[0]
24     test_file = test_case[1]
25     test_desc = test_case[2]
26     
27     test('csv_parser_' + test_name,
28         sh,
29         args: ['-c', csv_parser.full_path() + ' < ' + meson.current_source_dir() / test_file],
30         workdir: meson.current_source_dir(),
31         timeout: 30)
32 endforeach
33
34 # Create tests for expected failures
35 foreach test_case : csv_failing_tests
36     test_name = test_case[0]
37     test_file = test_case[1]
38     test_desc = test_case[2]
39     
40     test('csv_parser_' + test_name,
41         sh,
42         args: ['-c', csv_parser.full_path() + ' < ' + meson.current_source_dir() / test_file],
43         workdir: meson.current_source_dir(),
44         timeout: 30,
45         should_fail: true)
46 endforeach