From ae47d3e26ea4046d35d0d6a316d85051cb2aa494 Mon Sep 17 00:00:00 2001 From: Denis Davydov Date: Thu, 12 Oct 2017 14:58:15 +0200 Subject: [PATCH] doc: explain how to use SOURCE_DIR from user tests --- doc/users/testsuite.html | 10 ++++++++++ 1 file changed, 10 insertions(+) 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 + In some cases, additional input data has to be provided in users' tests. For + example, we may have an input file +
+tests/support/my_test_2.input
+ which shall be parsed within my_test_2.cc. To read this file, + one can use the SOURCE_DIR preprocessor variable which will be equal + to the parent folder of each .cc test. In other words, given the current + imaginary directory stucture, const std::string str = std::string(SOURCE_DIR) + "/my_test_2.input"; + used from my_test_2.cc will contain the path to the + auxiliary input file.

-- 2.39.5