Skip to content

Commit

Permalink
ci: make app test more robust
Browse files Browse the repository at this point in the history
  • Loading branch information
scivision committed Nov 28, 2024
1 parent 5dfe6eb commit 14dd92e
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 38 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci_windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ jobs:
- name: example test
run: ctest --test-dir example/build -C Release -V

windows-gcc:
msys2:
runs-on: windows-latest
timeout-minutes: 10

Expand Down
2 changes: 2 additions & 0 deletions app/fortran/main.f90
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ program repl

if(is_admin()) write(stderr, '(a)') "WARNING: running as admin / sudo"

print '(a)', "Backend: " // backend()

main : do
write(stdout, "(a)", advance="no") "Ffs> "

Expand Down
29 changes: 12 additions & 17 deletions test/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
include(CheckIncludeFile)

if(HAVE_CXX_FILESYSTEM)
set(_regex "Ffs> <filesystem>")
set(_regex "Backend: <filesystem>")
else()
set(_regex "Ffs> C")
set(_regex "Backend: C")
endif()


if(TARGET filesystem_cli)

add_test(NAME Fortran_CLI
COMMAND ${CMAKE_COMMAND} -Dexe=$<TARGET_FILE:filesystem_cli>
-P ${CMAKE_CURRENT_SOURCE_DIR}/stdin.cmake
COMMAND ${CMAKE_COMMAND} -Dexe=$<TARGET_FILE:filesystem_cli> -P ${CMAKE_CURRENT_SOURCE_DIR}/stdin_nul.cmake
)
set_tests_properties(Fortran_CLI PROPERTIES
LABELS "Fortran"
Expand All @@ -19,22 +19,17 @@ PASS_REGULAR_EXPRESSION ${_regex}

endif()

if(TARGET fs_cli)

if(HAVE_CXX_FILESYSTEM)
set(_regex "Backend: <filesystem>")
else()
set(_regex "Backend: C")
endif()
if(TARGET fs_cli)

add_test(NAME Cpp_CLI
COMMAND ${CMAKE_COMMAND} -Dexe=$<TARGET_FILE:fs_cli> -P ${CMAKE_CURRENT_SOURCE_DIR}/stdin_nul.cmake
)
add_test(NAME Cpp_CLI
COMMAND ${CMAKE_COMMAND} -Dexe=$<TARGET_FILE:fs_cli> -P ${CMAKE_CURRENT_SOURCE_DIR}/stdin_nul.cmake
)

set_tests_properties(Cpp_CLI PROPERTIES
LABELS "Cpp"
PASS_REGULAR_EXPRESSION ${_regex}
)
set_tests_properties(Cpp_CLI PROPERTIES
LABELS "Cpp"
PASS_REGULAR_EXPRESSION ${_regex}
)

endif()

Expand Down
2 changes: 1 addition & 1 deletion test/core/test_absolute.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ std::string in = "rel";
std::string base, ref, out;
const std::string cwd = fs_get_cwd();

const bool needs_normal = fs_is_windows() && fs_backend() == "<filesystem>" && fs_compiler().substr(0, 5) != "Clang";
const bool needs_normal = fs_is_windows() && fs_backend() == "<filesystem>";

int err = 0;

Expand Down
1 change: 0 additions & 1 deletion test/repl_cpp.txt

This file was deleted.

18 changes: 0 additions & 18 deletions test/stdin.cmake

This file was deleted.

0 comments on commit 14dd92e

Please sign in to comment.