Skip to content

Commit

Permalink
test: prefix test command names with test_ (#49)
Browse files Browse the repository at this point in the history
  • Loading branch information
threeal authored Apr 30, 2024
1 parent 27f650f commit 1eeaa78
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions test/cmake/MkdirRecursiveTest.cmake
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
function(create_directory_recursively)
function(test_create_directory_recursively)
if(EXISTS parent)
message(STATUS "Removing test directory")
file(REMOVE_RECURSE parent)
Expand All @@ -18,14 +18,14 @@ function(create_directory_recursively)
endfunction()

# Add more test cases here.
function(test_name)
function(test_something)
# Do something.
endfunction()

if(NOT DEFINED TEST_COMMAND)
message(FATAL_ERROR "The 'TEST_COMMAND' variable should be defined")
elseif(NOT COMMAND ${TEST_COMMAND})
message(FATAL_ERROR "Unable to find a command named '${TEST_COMMAND}'")
elseif(NOT COMMAND test_${TEST_COMMAND})
message(FATAL_ERROR "Unable to find a command named 'test_${TEST_COMMAND}'")
endif()

cmake_language(CALL ${TEST_COMMAND})
cmake_language(CALL test_${TEST_COMMAND})

0 comments on commit 1eeaa78

Please sign in to comment.