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

Commit 705973f

Browse files
committed
ENH: refs #237. Make tests parallel safe
1 parent 2edb825 commit 705973f

File tree

1 file changed

+4
-21
lines changed

1 file changed

+4
-21
lines changed

tests/CMakeLists.txt

Lines changed: 4 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,8 @@
11
# function to add a new PHP based coverage test to CDash
22
#
33
function(add_midas_test TestName TestFile)
4-
IF(EXISTS ${CMAKE_SOURCE_DIR}/tests/configs/mysql.ini)
5-
add_test(
6-
Mysql${TestName}
7-
${PHP} ${CMAKE_SOURCE_DIR}/tests/library/PHPUnit/mysqlPhpunit.php --bootstrap ${CMAKE_SOURCE_DIR}/tests/bootstrap.php ${CMAKE_CURRENT_SOURCE_DIR}/${TestFile}
8-
)
9-
set_tests_properties(
10-
Mysql${TestName} PROPERTIES
11-
FAIL_REGULAR_EXPRESSION ".*Failures: [1-9]+.*;.*Exceptions: [1-9]+.*"
12-
)
13-
ENDIF(EXISTS ${CMAKE_SOURCE_DIR}/tests/configs/mysql.ini)
14-
15-
IF(EXISTS ${CMAKE_SOURCE_DIR}/tests/configs/pgsql.ini)
16-
add_test(
17-
Pgsql${TestName}
18-
${PHP} ${CMAKE_SOURCE_DIR}/tests/library/PHPUnit/pgsqlPhpunit.php --bootstrap ${CMAKE_SOURCE_DIR}/tests/bootstrap.php ${CMAKE_CURRENT_SOURCE_DIR}/${TestFile}
19-
)
20-
set_tests_properties(
21-
Pgsql${TestName} PROPERTIES
22-
FAIL_REGULAR_EXPRESSION ".*Failures: [1-9]+.*;.*Exceptions: [1-9]+.*"
23-
)
24-
ENDIF(EXISTS ${CMAKE_SOURCE_DIR}/tests/configs/pgsql.ini)
4+
add_midas_mysql_test(${TestName} ${TestFile})
5+
add_midas_pgsql_test(${TestName} ${TestFile})
256
endfunction(add_midas_test)
267

278
function(add_midas_mysql_test TestName TestFile)
@@ -33,6 +14,7 @@ function(add_midas_mysql_test TestName TestFile)
3314
set_tests_properties(
3415
Mysql${TestName} PROPERTIES
3516
FAIL_REGULAR_EXPRESSION ".*Failures: [1-9]+.*;.*Exceptions: [1-9]+.*"
17+
RESOURCE_LOCK MIDASDatabase
3618
)
3719
ENDIF(EXISTS ${CMAKE_SOURCE_DIR}/tests/configs/mysql.ini)
3820
endfunction(add_midas_mysql_test)
@@ -46,6 +28,7 @@ function(add_midas_pgsql_test TestName TestFile)
4628
set_tests_properties(
4729
Pgsql${TestName} PROPERTIES
4830
FAIL_REGULAR_EXPRESSION ".*Failures: [1-9]+.*;.*Exceptions: [1-9]+.*"
31+
RESOURCE_LOCK MIDASDatabase
4932
)
5033
ENDIF(EXISTS ${CMAKE_SOURCE_DIR}/tests/configs/pgsql.ini)
5134
endfunction(add_midas_pgsql_test)

0 commit comments

Comments
 (0)