|
1 | 1 | # Copy these files to the build directory so that the tests can be run even
|
2 | 2 | # without the source directory.
|
3 |
| -configure_file(test_not.sh test_not.sh |
4 |
| - @ONLY) |
| 3 | +configure_file(test_not.py test_not.py |
| 4 | + COPYONLY) |
5 | 5 |
|
6 |
| -add_executable(ret1 ret1.c) |
7 |
| -llvm_test_run(EXECUTABLE "%b/not" "%b/test/ret1") |
| 6 | +llvm_test_executable_no_test(ret1 ret1.c) |
| 7 | +add_dependencies(ret1 not) |
| 8 | +llvm_test_run(EXECUTABLE "$<TARGET_FILE:not>" "$<TARGET_FILE:ret1>") |
8 | 9 | llvm_add_test_for_target(ret1)
|
9 | 10 |
|
10 |
| -add_executable(ret0 ret0.c) |
11 |
| -llvm_test_run(EXECUTABLE "%b/not" "%b/not" "%b/test/ret0") |
| 11 | +llvm_test_executable_no_test(ret0 ret0.c) |
| 12 | +add_dependencies(ret0 not) |
| 13 | +llvm_test_run(EXECUTABLE "$<TARGET_FILE:not>" "$<TARGET_FILE:not>" "$<TARGET_FILE:ret0>") |
12 | 14 | llvm_add_test_for_target(ret0)
|
13 | 15 |
|
14 | 16 | # Check that expected crashes are handled correctly.
|
15 |
| -add_executable(abrt abort.c) |
16 |
| -llvm_test_run(EXECUTABLE "%b/not" "--crash" "%b/test/abrt") |
| 17 | +llvm_test_executable_no_test(abrt abort.c) |
| 18 | +add_dependencies(abrt not) |
| 19 | +llvm_test_run(EXECUTABLE "$<TARGET_FILE:not>" "--crash" "$<TARGET_FILE:abrt>") |
17 | 20 | llvm_add_test_for_target(abrt)
|
18 | 21 |
|
19 | 22 | # Check that not passes environment variables to the called executable.
|
20 |
| -add_executable(check_env check_env.c) |
21 |
| -llvm_test_run(EXECUTABLE "/bin/bash" "%b/test/test_not.sh %b") |
22 |
| -llvm_add_test(test_not.test test_not.sh) |
| 23 | +find_package(Python COMPONENTS Interpreter) |
| 24 | +llvm_test_executable_no_test(check_env check_env.c) |
| 25 | +add_dependencies(check_env not) |
| 26 | +llvm_test_run(EXECUTABLE ${Python_EXECUTABLE} "%b/test/test_not.py" "$<TARGET_FILE:not>" "$<TARGET_FILE:check_env>") |
| 27 | +llvm_add_test_For_target(check_env) |
0 commit comments