From: Denis Davydov <davydden@gmail.com>
Date: Thu, 12 Oct 2017 12:58:15 +0000 (+0200)
Subject: doc: explain how to use SOURCE_DIR from user tests
X-Git-Tag: v9.0.0-rc1~959^2
X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ae47d3e26ea4046d35d0d6a316d85051cb2aa494;p=dealii.git

doc: explain how to use SOURCE_DIR from user tests
---

diff --git a/doc/users/testsuite.html b/doc/users/testsuite.html
index bf5af14057..667f3b4d3a 100644
--- a/doc/users/testsuite.html
+++ b/doc/users/testsuite.html
@@ -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>