[geos-commits] [SCM] GEOS branch master updated. 9e79f3db1f677feb0309ddae8f900cf0c38f971e
git at osgeo.org
git at osgeo.org
Mon Sep 16 13:15:32 PDT 2019
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GEOS".
The branch, master has been updated
via 9e79f3db1f677feb0309ddae8f900cf0c38f971e (commit)
from 326b89e67bc082a0708ced2f10ea646ff93bee2d (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 9e79f3db1f677feb0309ddae8f900cf0c38f971e
Author: Daniel Baston <dbaston at gmail.com>
Date: Fri Sep 13 19:52:44 2019 -0400
Register individual tests with ctest
Allows running of a single XML file or TUT test group.
Fixes #930
diff --git a/README.md b/README.md
index 63124fe..b37f684 100644
--- a/README.md
+++ b/README.md
@@ -57,8 +57,13 @@ Setting `CMAKE_BUILD_TYPE` to `Release` is necessary to enable compiler
optimizations.
Once the `cmake` tool has run, GEOS can be built by running `make` and
-installed by running `make install`. The test suite can be run using `make
-check`.
+installed by running `make install`.
+
+The entire test suite can be run using `make check`.
+Alternatively, the `ctest` command can be used, which provides more control over test execution.
+For example, `ctest -R unit-capi -j2` uses a regular expression to run all tests
+associated with the C API, using two processes in parallel.
+A list of available tests can be obtained using `ctest -N`.
### Microsoft Windows
diff --git a/tests/unit/CMakeLists.txt b/tests/unit/CMakeLists.txt
index a36e227..a72fd10 100644
--- a/tests/unit/CMakeLists.txt
+++ b/tests/unit/CMakeLists.txt
@@ -2,6 +2,7 @@
# Part of CMake configuration for GEOS
#
# Copyright (C) 2018 Mateusz Loskot <mateusz at loskot.net>
+# Copyright (C) 2019 Daniel Baston <dbaston at gmail.com>
#
# This is free software; you can redistribute and/or modify it under
# the terms of the GNU Lesser General Public Licence as published
@@ -17,4 +18,16 @@ target_include_directories(test_geos_unit
PRIVATE
$<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}>)
-add_test(NAME test_unit COMMAND test_geos_unit)
+file(GLOB_RECURSE _testfiles ${CMAKE_CURRENT_LIST_DIR}/**/*.cpp CONFIGURE_DEPEND)
+foreach(_testfile ${_testfiles})
+ string(REPLACE ${CMAKE_CURRENT_LIST_DIR}/ "" _testname ${_testfile})
+ string(REPLACE "Test.cpp" "" _testname ${_testname})
+ string(REPLACE "/" "-" _cmake_testname ${_testname})
+ string(REPLACE "/" "::" _testname ${_testname})
+ add_test(NAME unit-${_cmake_testname} COMMAND test_geos_unit ${_testname})
+endforeach()
+unset(_cmake_testname)
+unset(_testfile)
+unset(_testfiles)
+unset(_testname)
+
diff --git a/tests/xmltester/CMakeLists.txt b/tests/xmltester/CMakeLists.txt
index f334d0d..97a3d7f 100644
--- a/tests/xmltester/CMakeLists.txt
+++ b/tests/xmltester/CMakeLists.txt
@@ -2,6 +2,7 @@
# Part of CMake configuration for GEOS
#
# Copyright (C) 2018 Mateusz Loskot <mateusz at loskot.net>
+# Copyright (C) 2019 Daniel Baston <dbaston at gmail.com>
#
# This is free software; you can redistribute and/or modify it under
# the terms of the GNU Lesser General Public Licence as published
@@ -23,7 +24,14 @@ target_include_directories(test_xmltester
PRIVATE
$<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}>/tinyxml)
-file(GLOB_RECURSE _tests ${CMAKE_CURRENT_LIST_DIR}/tests/*.xml CONFIGURE_DEPEND)
-list(FILTER _tests EXCLUDE REGEX failure)
-add_test(NAME test_xml COMMAND test_xmltester --test-valid-output ${_tests})
-unset(_tests)
+foreach(_testdir general issue misc robust validate)
+ file(GLOB_RECURSE _testfiles ${CMAKE_CURRENT_LIST_DIR}/tests/${_testdir}/*.xml CONFIGURE_DEPEND)
+ foreach(_testfile ${_testfiles})
+ get_filename_component(_testname ${_testfile} NAME_WE)
+ add_test(NAME ${_testdir}-${_testname} COMMAND test_xmltester --test-valid-output ${_testfile})
+ endforeach()
+endforeach()
+unset(_testdir)
+unset(_testname)
+unset(_testfile)
+unset(_testfiles)
-----------------------------------------------------------------------
Summary of changes:
README.md | 9 +++++++--
tests/unit/CMakeLists.txt | 15 ++++++++++++++-
tests/xmltester/CMakeLists.txt | 16 ++++++++++++----
3 files changed, 33 insertions(+), 7 deletions(-)
hooks/post-receive
--
GEOS
More information about the geos-commits
mailing list