Skip to content

Commit b74e2f1

Browse files
committed
[tools] Disable tools/test under user-mode emulation
1 parent 650fee2 commit b74e2f1

File tree

1 file changed

+16
-11
lines changed

1 file changed

+16
-11
lines changed

tools/test/CMakeLists.txt

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,20 @@ add_dependencies(ret0 not)
1313
llvm_test_run(EXECUTABLE "$<TARGET_FILE:not>" "$<TARGET_FILE:not>" "$<TARGET_FILE:ret0>")
1414
llvm_add_test_for_target(ret0)
1515

16-
# Check that expected crashes are handled correctly.
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>")
20-
llvm_add_test_for_target(abrt)
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))
20+
# Check that expected crashes are handled correctly.
21+
llvm_test_executable_no_test(abrt abort.c)
22+
add_dependencies(abrt not)
23+
llvm_test_run(EXECUTABLE "$<TARGET_FILE:not>" "--crash" "$<TARGET_FILE:abrt>")
24+
llvm_add_test_for_target(abrt)
2125

22-
# Check that not passes environment variables to the called executable.
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)
26+
# Check that not passes environment variables to the called executable.
27+
find_package(Python COMPONENTS Interpreter)
28+
llvm_test_executable_no_test(check_env check_env.c)
29+
add_dependencies(check_env not)
30+
llvm_test_run(EXECUTABLE ${Python_EXECUTABLE} "%b/test/test_not.py" "$<TARGET_FILE:not>" "$<TARGET_FILE:check_env>")
31+
llvm_add_test_For_target(check_env)
32+
endif()

0 commit comments

Comments
 (0)