]> begriffs open source - sa-parse/blob - tests/meson.build
Track error locations
[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     ['empty_fields', 'empty_fields.csv', 'Test with empty fields'],
12 ]
13
14 # Special test cases that should fail due to parser limitations
15 csv_failing_tests = [
16     # No currently failing tests
17 ]
18
19 # Get shell program once
20 sh = find_program('sh')
21
22 # Create tests for normal cases
23 foreach test_case : csv_test_cases
24     test_name = test_case[0]
25     test_file = test_case[1]
26     test_desc = test_case[2]
27     
28     test('csv_parser_' + test_name,
29         sh,
30         args: ['-c', csv_parser.full_path() + ' < ' + meson.current_source_dir() / test_file],
31         workdir: meson.current_source_dir(),
32         timeout: 5)
33 endforeach
34
35 # Create tests for expected failures
36 foreach test_case : csv_failing_tests
37     test_name = test_case[0]
38     test_file = test_case[1]
39     test_desc = test_case[2]
40     
41     test('csv_parser_' + test_name,
42         sh,
43         args: ['-c', csv_parser.full_path() + ' < ' + meson.current_source_dir() / test_file],
44         workdir: meson.current_source_dir(),
45         timeout: 30,
46         should_fail: true)
47 endforeach