@@ -13,26 +13,25 @@ add_dependencies(ret0 not)
13
13
llvm_test_run(EXECUTABLE "$<TARGET_FILE:not>" "$<TARGET_FILE:not>" "$<TARGET_FILE:ret0>" )
14
14
llvm_add_test_for_target(ret0)
15
15
16
- # These test will always fail under user-mode emulation because 'not'
17
- # spawns a subprocess outside the emulator and the check_env test
18
- # runs the host python interpreter under the emulator for the target.
19
- if (NOT (TEST_SUITE_USER_MODE_EMULATION AND TEST_SUITE_RUN_UNDER))
16
+ if (TEST_SUITE_USER_MODE_EMULATION AND TEST_SUITE_RUN_UNDER)
17
+ # Check that expected crashes are handled correctly under user-mode emulation.
18
+ llvm_test_executable_no_test(abrt abort.c)
19
+ add_dependencies (abrt not -spawning-emulator)
20
+ llvm_test_run(EXECUTABLE "$<TARGET_FILE:not-spawning-emulator>" "--crash" "$<TARGET_FILE:abrt>" )
21
+ llvm_add_test_for_target(abrt)
22
+ else ()
20
23
# Check that expected crashes are handled correctly.
21
24
llvm_test_executable_no_test(abrt abort.c)
22
25
add_dependencies (abrt not )
23
26
llvm_test_run(EXECUTABLE "$<TARGET_FILE:not>" "--crash" "$<TARGET_FILE:abrt>" )
24
27
llvm_add_test_for_target(abrt)
25
28
26
29
# Check that not passes environment variables to the called executable.
30
+ # This test is disabled in case of user-mode emulation because it would otherwise run the
31
+ # host python interpreter under the target emulator.
27
32
find_package (Python COMPONENTS Interpreter)
28
33
llvm_test_executable_no_test(check_env check_env.c)
29
34
add_dependencies (check_env not )
30
35
llvm_test_run(EXECUTABLE ${Python_EXECUTABLE} "%b/test/test_not.py" "$<TARGET_FILE:not>" "$<TARGET_FILE:check_env>" )
31
36
llvm_add_test_For_target(check_env)
32
- else ()
33
- # Check that expected crashes are handled correctly under user-mode emulation.
34
- llvm_test_executable_no_test(abrt abort.c)
35
- add_dependencies (abrt not -spawning-emulator)
36
- llvm_test_run(EXECUTABLE "$<TARGET_FILE:not-spawning-emulator>" "--crash" "$<TARGET_FILE:abrt>" )
37
- llvm_add_test_for_target(abrt)
38
37
endif ()
0 commit comments