diff --git a/flang/unittests/Runtime/CMakeLists.txt b/flang/unittests/Runtime/CMakeLists.txt index 2c3f8c1a9e9ac..179e439917ff2 100644 --- a/flang/unittests/Runtime/CMakeLists.txt +++ b/flang/unittests/Runtime/CMakeLists.txt @@ -36,4 +36,6 @@ target_link_libraries(FlangRuntimeTests FortranRuntime ) +target_compile_definitions(FlangRuntimeTests PRIVATE NOT_EXE="$") + add_subdirectory(CUDA) diff --git a/flang/unittests/Runtime/CommandTest.cpp b/flang/unittests/Runtime/CommandTest.cpp index b0c43ba01d8f3..05287d80e14f5 100644 --- a/flang/unittests/Runtime/CommandTest.cpp +++ b/flang/unittests/Runtime/CommandTest.cpp @@ -340,7 +340,7 @@ TEST_F(ZeroArguments, ECLValidCommandStatusSetSync) { } TEST_F(ZeroArguments, ECLGeneralErrorCommandErrorSync) { - OwningPtr command{CharDescriptor("cat GeneralErrorCommand")}; + OwningPtr command{CharDescriptor(NOT_EXE)}; bool wait{true}; OwningPtr exitStat{IntDescriptor(404)}; OwningPtr cmdStat{IntDescriptor(202)}; @@ -348,16 +348,14 @@ TEST_F(ZeroArguments, ECLGeneralErrorCommandErrorSync) { RTNAME(ExecuteCommandLine) (*command.get(), wait, exitStat.get(), cmdStat.get(), cmdMsg.get()); -#if defined(_WIN32) CheckDescriptorEqInt(exitStat.get(), 1); +#if defined(_WIN32) CheckDescriptorEqInt(cmdStat.get(), 6); CheckDescriptorEqStr(cmdMsg.get(), "Invalid command lineXXXXXXXXX"); #elif defined(_AIX) - CheckDescriptorEqInt(exitStat.get(), 2); CheckDescriptorEqInt(cmdStat.get(), 6); CheckDescriptorEqStr(cmdMsg.get(), "Invalid command lineXXXXXXXXX"); #else - CheckDescriptorEqInt(exitStat.get(), 1); CheckDescriptorEqInt(cmdStat.get(), 3); CheckDescriptorEqStr(cmdMsg.get(), "Command line execution failed"); #endif