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

Commit ea66989

Browse files
author
Jamie Snape
committed
Fix code coverage test option
1 parent 9516564 commit ea66989

File tree

2 files changed

+12
-3
lines changed

2 files changed

+12
-3
lines changed

phpunit.xml.dist

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,9 +62,9 @@
6262
</testsuites>
6363
<filter>
6464
<whitelist>
65-
<directory>core</directory>
66-
<directory>modules</directory>
67-
<directory>notification</directory>
65+
<directory suffix=".php">core</directory>
66+
<directory suffix=".php">modules</directory>
67+
<directory suffix=".php">notification</directory>
6868
</whitelist>
6969
</filter>
7070
<logging>

tests/CMakeLists.txt

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,9 @@ function(add_midas_mysql_test TestName TestFile)
4141
if(EXISTS ${CMAKE_SOURCE_DIR}/tests/configs/mysql.ini)
4242
set(Environment "midas_data_path=$ENV{midas_data_path};midas_local_configs_path=$ENV{midas_local_configs_path};midas_logs_path=$ENV{midas_logs_path};midas_temp_path=$ENV{midas_temp_path}")
4343
set(TestParams --debug --bootstrap ${CMAKE_SOURCE_DIR}/tests/TestsBootstrap.php)
44+
if(MIDAS_RUN_TESTS_WITH_COVERAGE)
45+
set(TestParams ${TestParams} --coverage-php ${CMAKE_BINARY_DIR}/cov/MySQL${TestName}.cov)
46+
endif()
4447
add_test(
4548
MySQL${TestName}
4649
${PHP} ${CMAKE_SOURCE_DIR}/tests/PHPUnitMySQL.php ${TestParams} ${CMAKE_CURRENT_SOURCE_DIR}/${TestFile}
@@ -58,6 +61,9 @@ function(add_midas_pgsql_test TestName TestFile)
5861
if(EXISTS ${CMAKE_SOURCE_DIR}/tests/configs/pgsql.ini)
5962
set(Environment "midas_data_path=$ENV{midas_data_path};midas_local_configs_path=$ENV{midas_local_configs_path};midas_logs_path=$ENV{midas_logs_path};midas_temp_path=$ENV{midas_temp_path}")
6063
set(TestParams --debug --bootstrap ${CMAKE_SOURCE_DIR}/tests/TestsBootstrap.php)
64+
if(MIDAS_RUN_TESTS_WITH_COVERAGE)
65+
set(TestParams ${TestParams} --coverage-php ${CMAKE_BINARY_DIR}/cov/PgSQL${TestName}.cov)
66+
endif()
6167
add_test(
6268
PgSQL${TestName}
6369
${PHP} ${CMAKE_SOURCE_DIR}/tests/PHPUnitPgSQL.php ${TestParams} ${CMAKE_CURRENT_SOURCE_DIR}/${TestFile}
@@ -75,6 +81,9 @@ function(add_midas_sqlite_test TestName TestFile)
7581
if(EXISTS ${CMAKE_SOURCE_DIR}/tests/configs/sqlite.ini)
7682
set(Environment "midas_data_path=$ENV{midas_data_path};midas_local_configs_path=$ENV{midas_local_configs_path};midas_logs_path=$ENV{midas_logs_path};midas_temp_path=$ENV{midas_temp_path}")
7783
set(TestParams --debug --bootstrap ${CMAKE_SOURCE_DIR}/tests/TestsBootstrap.php)
84+
if(MIDAS_RUN_TESTS_WITH_COVERAGE)
85+
set(TestParams ${TestParams} --coverage-php ${CMAKE_BINARY_DIR}/cov/SQLite${TestName}.cov)
86+
endif()
7887
add_test(
7988
SQLite${TestName}
8089
${PHP} ${CMAKE_SOURCE_DIR}/tests/PHPUnitSQLite.php ${TestParams} ${CMAKE_CURRENT_SOURCE_DIR}/${TestFile}

0 commit comments

Comments
 (0)