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

Commit

Permalink
ENH: refs #237. Add a CMake switch for style tests
Browse files Browse the repository at this point in the history
  • Loading branch information
zachmullen committed Aug 29, 2011
1 parent 30f30d6 commit 2edb825
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 8 deletions.
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ configure_file(${CMAKE_CURRENT_SOURCE_DIR}/library/CMake/CTestCustom.cmake.in
# Setup testing and required parameters for testing

include(CTest)
option( MIDAS_RUN_STYLE_TESTS "Should MIDAS run PHP style checking tests?" ON )
set( SERVER_BIN_DIR ${CMAKE_CURRENT_BINARY_DIR} )
add_subdirectory(tests)
add_subdirectory(core/tests)
Expand Down
18 changes: 10 additions & 8 deletions tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -51,14 +51,16 @@ function(add_midas_pgsql_test TestName TestFile)
endfunction(add_midas_pgsql_test)

function(add_midas_style_test TestName TestDir)
add_test(
${TestName}
${PHP} ${CMAKE_SOURCE_DIR}/tests/library/PhpCheckstyle/run.php --format console --src ${TestDir}
)
set_tests_properties(
${TestName} PROPERTIES
FAIL_REGULAR_EXPRESSION "ERROR;WARNING"
)
if(MIDAS_RUN_STYLE_TESTS)
add_test(
${TestName}
${PHP} ${CMAKE_SOURCE_DIR}/tests/library/PhpCheckstyle/run.php --format console --src ${TestDir}
)
set_tests_properties(
${TestName} PROPERTIES
FAIL_REGULAR_EXPRESSION "ERROR;WARNING"
)
endif()
endfunction(add_midas_style_test)

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

0 comments on commit 2edb825

Please sign in to comment.