Skip to content

Commit b6645ef

Browse files
committed
Review comments
1 parent 6474814 commit b6645ef

File tree

3 files changed

+14
-15
lines changed

3 files changed

+14
-15
lines changed

Fortran/gfortran/CMakeLists.txt

+4-4
Original file line numberDiff line numberDiff line change
@@ -716,18 +716,18 @@ function(gfortran_add_execute_test expect_error main others fflags ldflags)
716716
gfortran_make_working_dir("${target}" working_dir)
717717
get_filename_component(working_dir_name "${working_dir}" NAME)
718718

719-
# When running in a emulator, use the version of 'not' that will
719+
# When running in an emulator, use the version of 'not' that will
720720
# spawn the subprocess under that emulator as well.
721721
if(TEST_SUITE_USER_MODE_EMULATION AND TEST_SUITE_RUN_UNDER)
722-
set(NOT_HELPER "not-spawning-emulator")
722+
set(NOT_TOOL "not-spawning-emulator")
723723
else()
724-
set(NOT_HELPER "not")
724+
set(NOT_TOOL "not")
725725
endif()
726726

727727
llvm_test_executable_no_test(${target} ${main} ${others})
728728
if (expect_error)
729729
llvm_test_run(
730-
EXECUTABLE "%b/${NOT_HELPER} --crash %S/${target}"
730+
EXECUTABLE "%b/${NOT_TOOL} --crash %S/${target}"
731731
WORKDIR "%S/${working_dir_name}")
732732
else ()
733733
llvm_test_run(WORKDIR "%S/${working_dir_name}")

tools/not.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ int main(int argc, char* const* argv) {
6262
// In case of user-mode emulation, before spawning a new subprocess, the
6363
// emulator needs to be preprended to the argv vector for the child.
6464
// TEST_SUITE_RUN_UNDER will be defined to a comma-separated list of
65-
// string litterals.
65+
// string literals.
6666
std::vector<char *> argvbuf = {TEST_SUITE_RUN_UNDER};
6767
for (char *const *argp = argv; *argp != NULL; ++argp)
6868
argvbuf.push_back(*argp);

tools/test/CMakeLists.txt

+9-10
Original file line numberDiff line numberDiff line change
@@ -13,26 +13,25 @@ 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-
# 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()
2023
# Check that expected crashes are handled correctly.
2124
llvm_test_executable_no_test(abrt abort.c)
2225
add_dependencies(abrt not)
2326
llvm_test_run(EXECUTABLE "$<TARGET_FILE:not>" "--crash" "$<TARGET_FILE:abrt>")
2427
llvm_add_test_for_target(abrt)
2528

2629
# 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.
2732
find_package(Python COMPONENTS Interpreter)
2833
llvm_test_executable_no_test(check_env check_env.c)
2934
add_dependencies(check_env not)
3035
llvm_test_run(EXECUTABLE ${Python_EXECUTABLE} "%b/test/test_not.py" "$<TARGET_FILE:not>" "$<TARGET_FILE:check_env>")
3136
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)
3837
endif()

0 commit comments

Comments
 (0)