]> https://gitweb.dealii.org/ - dealii.git/commitdiff
doc: explain how to use SOURCE_DIR from user tests 5232/head
authorDenis Davydov <davydden@gmail.com>
Thu, 12 Oct 2017 12:58:15 +0000 (14:58 +0200)
committerDenis Davydov <davydden@gmail.com>
Thu, 12 Oct 2017 14:53:25 +0000 (16:53 +0200)
doc/users/testsuite.html

index bf5af140573bfadd4331dd71286c2085e654a1cc..667f3b4d3ae582de83829c2bda5e7d1b5b5e527d 100644 (file)
@@ -247,6 +247,16 @@ Test project .../examples/step
 100% tests passed, 0 tests failed out of 2
 
 Total Test time (real) =   0.43 sec</pre>
+    In some cases, additional input data has to be provided in users' tests. For
+    example, we may have an input file
+      <pre>
+tests/support/my_test_2.input</pre>
+    which shall be parsed within <code>my_test_2.cc</code>. To read this file,
+    one can use the <code>SOURCE_DIR</code> preprocessor variable which will be equal
+    to the parent folder of each <code>.cc</code> test. In other words, given the current
+    imaginary directory stucture, <code>const std::string str = std::string(SOURCE_DIR) + "/my_test_2.input";</code>
+    used from <code>my_test_2.cc</code> will contain the path to the
+    auxiliary input file.
     </p>
 
     <p>

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.