Skip to content
This repository was archived by the owner on Sep 10, 2021. It is now read-only.

Commit 2edb825

Browse files
committed
ENH: refs #237. Add a CMake switch for style tests
1 parent 30f30d6 commit 2edb825

File tree

2 files changed

+11
-8
lines changed

2 files changed

+11
-8
lines changed

CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ configure_file(${CMAKE_CURRENT_SOURCE_DIR}/library/CMake/CTestCustom.cmake.in
3333
# Setup testing and required parameters for testing
3434

3535
include(CTest)
36+
option( MIDAS_RUN_STYLE_TESTS "Should MIDAS run PHP style checking tests?" ON )
3637
set( SERVER_BIN_DIR ${CMAKE_CURRENT_BINARY_DIR} )
3738
add_subdirectory(tests)
3839
add_subdirectory(core/tests)

tests/CMakeLists.txt

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -51,14 +51,16 @@ function(add_midas_pgsql_test TestName TestFile)
5151
endfunction(add_midas_pgsql_test)
5252

5353
function(add_midas_style_test TestName TestDir)
54-
add_test(
55-
${TestName}
56-
${PHP} ${CMAKE_SOURCE_DIR}/tests/library/PhpCheckstyle/run.php --format console --src ${TestDir}
57-
)
58-
set_tests_properties(
59-
${TestName} PROPERTIES
60-
FAIL_REGULAR_EXPRESSION "ERROR;WARNING"
61-
)
54+
if(MIDAS_RUN_STYLE_TESTS)
55+
add_test(
56+
${TestName}
57+
${PHP} ${CMAKE_SOURCE_DIR}/tests/library/PhpCheckstyle/run.php --format console --src ${TestDir}
58+
)
59+
set_tests_properties(
60+
${TestName} PROPERTIES
61+
FAIL_REGULAR_EXPRESSION "ERROR;WARNING"
62+
)
63+
endif()
6264
endfunction(add_midas_style_test)
6365

6466
add_midas_style_test( StyleTestsControllerTestCase ${CMAKE_SOURCE_DIR}/tests/ControllerTestCase.php )

0 commit comments

Comments
 (0)