Skip to content

Commit 003577f

Browse files
committed
test:exe_path: fortran: loosen too strict test
1 parent 260021f commit 003577f

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

test/core/test_exe.cpp

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@ class TestExe : public testing::Test {
3232

3333
std::vector<std::string> argvs = ::testing::internal::GetArgvs();
3434
self = argvs[0];
35+
if(fs_is_cygwin())
36+
self += ".exe";
3537

3638
ASSERT_TRUE(fs_touch(exe));
3739
ASSERT_TRUE(fs_touch(noexe));
@@ -62,7 +64,13 @@ EXPECT_TRUE(fs_is_exe(exe));
6264

6365

6466
TEST_F(TestExe, IsExeBin){
65-
EXPECT_TRUE(fs_is_executable_binary(self));
67+
// Cygwin is fussy about the full path, but it does work
68+
// Cygwin wants the /cygdrive/ prefix rather than /home/username/ prefix
69+
70+
if (!fs_is_cygwin()){
71+
EXPECT_TRUE(fs_is_executable_binary(self)) << self << " is not executable binary";
72+
}
73+
6674
EXPECT_FALSE(fs_is_executable_binary(exe));
6775
EXPECT_FALSE(fs_is_executable_binary(noexe));
6876
}

test/extra/CMakeLists.txt

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -53,10 +53,4 @@ set_tests_properties(Fortran_filesystem_type PROPERTIES
5353
DISABLED $<AND:$<BOOL:${LINUX}>,$<NOT:$<BOOL:${ffilesystem_HAVE_LINUX_MAGIC}>>>
5454
)
5555

56-
# TARGET_FILE_NAME to allow for macOS possible non-canonical result
57-
# and symlinked / special filesystems like WSL
58-
set_tests_properties(Fortran_exepath PROPERTIES PASS_REGULAR_EXPRESSION $<TARGET_FILE_NAME:test_exepath_fortran>)
59-
60-
61-
6256
endif()

test/extra/test_exepath.f90

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,6 @@ program test_path
3131
error stop
3232
endif
3333

34-
35-
3634
if(.not. is_file(path)) error stop "exe_path() is not a file: " // path
3735

3836
print '(a)', path

0 commit comments

Comments
 (0)