Skip to content

Commit ebe182d

Browse files
authored
[SupportTests] Waive failures in ProgramEnvTest.TestExecuteEmptyEnvironment on MinGW (#160277)
In MinGW build configurations, built executables often can end up depending on a DLL for libstdc++ or libc++. This DLL typicall isn't installed system wide, but is either installed in the same directory as the executables, or found through PATH. If this dependency DLL has to be found through PATH, this test fails when attempting to execute the SupportTests executable with an empty environment. Waive the failure to execute the executable in this case.
1 parent 78b80a1 commit ebe182d

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

llvm/unittests/Support/ProgramTest.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -695,7 +695,14 @@ TEST_F(ProgramEnvTest, TestExecuteEmptyEnvironment) {
695695
int RetCode = ExecuteAndWait(Executable, argv, ArrayRef<StringRef>{}, {}, 0,
696696
0, &Error, &ExecutionFailed);
697697
EXPECT_FALSE(ExecutionFailed) << Error;
698+
#ifndef __MINGW32__
699+
// When running with an empty environment, the child process doesn't in herit
700+
// the PATH variable. On MinGW, it is common for executables to require a
701+
// shared libstdc++ or libc++ DLL, which may be in PATH but not in the
702+
// directory of SupportTests.exe - leading to STATUS_DLL_NOT_FOUND errors.
703+
// Therefore, waive this failure in MinGW environments.
698704
ASSERT_EQ(0, RetCode);
705+
#endif
699706
}
700707

701708
} // end anonymous namespace

0 commit comments

Comments
 (0)