summaryrefslogtreecommitdiffstats
path: root/test/CMakeLists.txt
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2014-02-14 19:23:19 (GMT)
committerBrad King <brad.king@kitware.com>2014-02-26 16:54:50 (GMT)
commit9ecf51353b56eadceff6d4d6ad22098dc24b3035 (patch)
treea6d48bb83277f70e2593c610b3f0538918751273 /test/CMakeLists.txt
parent775eb58020208e170e6ef9d1f43de0d5a0474a8d (diff)
downloadCastXML-9ecf51353b56eadceff6d4d6ad22098dc24b3035.zip
CastXML-9ecf51353b56eadceff6d4d6ad22098dc24b3035.tar.gz
CastXML-9ecf51353b56eadceff6d4d6ad22098dc24b3035.tar.bz2
Add test infrastructure to run castxml and validate results
Create a test/run.cmake test driver script that uses execute_process to run a castxml test command line and then compares the results to those we expect. Validate the process result (return code) and the content of stdout and stderr. In test/CMakeLists.txt create a castxml_test_cmd macro to add tests that use "run.cmake".
Diffstat (limited to 'test/CMakeLists.txt')
-rw-r--r--test/CMakeLists.txt26
1 files changed, 26 insertions, 0 deletions
diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt
new file mode 100644
index 0000000..3ff5d08
--- /dev/null
+++ b/test/CMakeLists.txt
@@ -0,0 +1,26 @@
+#=============================================================================
+# Copyright Kitware, Inc.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#=============================================================================
+
+macro(castxml_test_cmd test)
+ set(command $<TARGET_FILE:castxml> ${ARGN})
+ add_test(
+ NAME cmd.${test}
+ COMMAND ${CMAKE_COMMAND}
+ "-Dcommand:STRING=${command}"
+ "-Dtest=cmd.${test}"
+ -P ${CMAKE_CURRENT_SOURCE_DIR}/run.cmake
+ )
+endmacro()