Skip to content

Tests command_line_filtering and shuffle_integration fail on Windows (BAD_COMMAND) #568

Description

@mathomp4

Summary

When running ctest on Windows (both MinGW gfortran and Intel ifx), two tests fail with BAD_COMMAND:

  • command_line_filtering
  • shuffle_integration

Root Cause

In tests/funit-core/CMakeLists.txt:141-160:

add_test(NAME command_line_filtering
  COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/test_command_line_filtering.sh 
          ${CMAKE_CURRENT_BINARY_DIR}/filter_cmdline_tests.x
  WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
)
...
add_test(NAME shuffle_integration
  COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/test_shuffle.sh
          ${CMAKE_CURRENT_BINARY_DIR}/shuffle_int_tests.x
  WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
)

On Windows, CTest uses CreateProcess(), which cannot invoke .sh shell scripts directly as executables, resulting in:

[inappropriate file type or format]
***Not Run (BAD_COMMAND)

Furthermore, test_command_line_filtering.sh tests regex filtering (-f/-e), which is disabled on Windows (#ifndef _WIN32).

Suggested Fix

Guard these tests with if (NOT WIN32) in tests/funit-core/CMakeLists.txt (similar to how Test_RegexFilter.pf is guarded).

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions