Skip to content

Commit 1eea4e1

Browse files
committed
test fixes
1 parent c6d4ac0 commit 1eea4e1

File tree

2 files changed

+2
-9
lines changed

2 files changed

+2
-9
lines changed

flang/runtime/execute.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ std::int64_t TerminationCheck(std::int64_t status, const Descriptor *cmdstat,
124124
// On Windows, ENOENT means the command interpreter can't be found.
125125
// On Linux, system calls execl with filepath "/bin/sh", ENOENT means the
126126
// file pathname does not exist.
127-
if (errno = ENOENT) {
127+
if (errno == ENOENT) {
128128
if (!cmdstat) {
129129
terminator.Crash("Command line execution is not supported, system "
130130
"returns -1 with errno ENOENT.");

flang/unittests/Runtime/CommandTest.cpp

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -378,19 +378,12 @@ TEST_F(ZeroArguments, ECLNotExecutedCommandErrorSync) {
378378
CheckDescriptorEqInt<std::int64_t>(exitStat.get(), 126);
379379
CheckDescriptorEqInt<std::int64_t>(cmdStat.get(), 4);
380380
CheckDescriptorEqStr(cmdMsg.get(), "Command cannot be execu");
381-
#endif
382-
383-
// removing the file should have no error on Linux, have error on Windows
381+
// removing the file only on Linux (file is not created on Win)
384382
OwningPtr<Descriptor> commandClean{
385383
CharDescriptor("rm -f NotExecutedCommandFile")};
386384
OwningPtr<Descriptor> cmdMsgNoErr{CharDescriptor("No Error")};
387385
RTNAME(ExecuteCommandLine)
388386
(*commandClean.get(), wait, exitStat.get(), cmdStat.get(), cmdMsgNoErr.get());
389-
#ifdef _WIN32
390-
CheckDescriptorEqInt<std::int64_t>(exitStat.get(), 1);
391-
CheckDescriptorEqStr(cmdMsgNoErr.get(), "Invalid ");
392-
CheckDescriptorEqInt<std::int64_t>(cmdStat.get(), 6);
393-
#else
394387
CheckDescriptorEqInt<std::int64_t>(exitStat.get(), 0);
395388
CheckDescriptorEqStr(cmdMsgNoErr.get(), "No Error");
396389
CheckDescriptorEqInt<std::int64_t>(cmdStat.get(), 0);

0 commit comments

Comments
 (0)