]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Run test suite also for json files 10834/head
authorPeter Munch <peterrmuench@gmail.com>
Mon, 17 Aug 2020 19:22:08 +0000 (21:22 +0200)
committerPeter Munch <peterrmuench@gmail.com>
Tue, 1 Sep 2020 06:11:21 +0000 (08:11 +0200)
cmake/macros/macro_deal_ii_add_test.cmake
doc/news/changes/minor/20200817Munch [new file with mode: 0644]
doc/users/testsuite.html

index 42dea34149e66a5c49beaace23e15ecea5de7c69..92269949da40397c76f51fda3ae42faffaf4021c 100644 (file)
@@ -206,7 +206,25 @@ MACRO(DEAL_II_ADD_TEST _category _test_name _comparison_file)
           "$<TARGET_FILE:${_target}>"
           "${_prm_file}"
           )
+      ELSEIF( EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/${_test_name}.json")
+        # the same as above but for json files
+        SET(_json_file "${CMAKE_CURRENT_SOURCE_DIR}/${_test_name}.json")
 
+        IF(NOT "${TEST_TARGET_${_build}}" STREQUAL "")
+          SET(_target ${TEST_TARGET_${_build}})
+        ELSEIF(NOT "${TEST_TARGET}" STREQUAL "")
+          SET(_target ${TEST_TARGET})
+        ELSE()
+          MESSAGE(FATAL_ERROR
+            "\nFor ${_comparison_file}: \"${_test_name}.json\" provided, "
+            "but neither \"\${TEST_TARGET}\", nor \"\${TEST_TARGET_${_build}}"
+            "\" is defined.\n\n"
+            )
+        ENDIF()
+        SET(_run_args
+          "$<TARGET_FILE:${_target}>"
+          "${_json_file}"
+          )
       ELSE()
         MESSAGE(FATAL_ERROR
           "\nFor ${_comparison_file}: Neither \"${_test_name}.cc\", "
diff --git a/doc/news/changes/minor/20200817Munch b/doc/news/changes/minor/20200817Munch
new file mode 100644 (file)
index 0000000..b3daddb
--- /dev/null
@@ -0,0 +1,3 @@
+New: The test suite can now also be run with .json files.
+<br>
+(Peter Munch, 2020/08/17)
index e75b5ed25d460025aa6cb1baf7e1120b9feeb2e9..3d1303d85e5039b418572e92bc4d6b31d0692705 100644 (file)
@@ -65,6 +65,13 @@ my_test_2.output</pre>
       variable) is invoked with the path of <code>my_test_2.prm</code> as
       first argument. Again, its screen output is compared against
       <code>my_test_2.output</code>
+      <pre>
+my_test_3.json
+my_test_3.output</pre>
+      Just like in the last case, an already built executable (that is defined by a CMake
+      variable) is invoked with the path of <code>my_test_3.json</code> as
+      first argument. Again, its screen output is compared against
+      <code>my_test_3.output</code>
     </p>
 
     <a name="examples"></a>

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.