File tree Expand file tree Collapse file tree 3 files changed +15
-56
lines changed Expand file tree Collapse file tree 3 files changed +15
-56
lines changed Original file line number Diff line number Diff line change 1
1
if (LLVM_LIBC_FULL_BUILD )
2
-
3
2
enable_testing ()
4
3
5
4
set (NEWHDGEN_TESTS_DIR ${CMAKE_CURRENT_SOURCE_DIR} /tests )
5
+ set (TEST_OUTPUT_DIR ${CMAKE_BINARY_DIR} /newhdrgen/output )
6
6
7
7
add_test (
8
8
NAME newhdrgen_integration_test
9
- COMMAND ${CMAKE_COMMAND} -E env PYTHONPATH=${CMAKE_CURRENT_SOURCE_DIR} python3 ${NEWHDGEN_TESTS_DIR} /test_integration.py
9
+ COMMAND python3 ${NEWHDGEN_TESTS_DIR} /test_integration.py --output_dir ${TEST_OUTPUT_DIR}
10
10
)
11
11
12
12
add_custom_target (check-newhdrgen
13
- COMMAND ${CMAKE_CTEST_COMMAND} -R newhdrgen_integration_test
13
+ COMMAND ${CMAKE_CTEST_COMMAND} -R newhdrgen_integration_test --output-on-failure
14
14
)
15
15
16
16
message (STATUS "Integration test for newhdrgen added." )
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 3
3
from pathlib import Path
4
4
import os
5
5
import argparse
6
+ import sys
6
7
7
8
8
9
class TestHeaderGenIntegration (unittest .TestCase ):
9
10
def setUp (self ):
10
- parser = argparse .ArgumentParser (
11
- description = "TestHeaderGenIntegration arguments"
12
- )
13
- parser .add_argument (
14
- "--output_dir" , type = str , help = "Output directory for generated headers"
15
- )
16
- args , _ = parser .parse_known_args ()
17
- output_dir_env = os .getenv ("TEST_OUTPUT_DIR" )
18
11
19
12
self .output_dir = Path (
20
- args .output_dir
21
- if args .output_dir
22
- else output_dir_env if output_dir_env else "libc/newhdrgen/tests/output"
13
+ args .output_dir if args .output_dir else "libc/newhdrgen/tests/output"
23
14
)
24
15
25
16
self .maxDiff = None
@@ -71,4 +62,14 @@ def test_generate_header(self):
71
62
72
63
73
64
if __name__ == "__main__" :
65
+ parser = argparse .ArgumentParser (description = "TestHeaderGenIntegration arguments" )
66
+ parser .add_argument (
67
+ "--output_dir" , type = str , help = "Output directory for generated headers"
68
+ )
69
+ args , remaining_argv = parser .parse_known_args ()
70
+
71
+ TestHeaderGenIntegration .output_dir = args .output_dir
72
+
73
+ sys .argv [1 :] = remaining_argv
74
+
74
75
unittest .main ()
You can’t perform that action at this time.
0 commit comments