aboutsummaryrefslogtreecommitdiffstats
path: root/documentapi/src/tests/messages
diff options
context:
space:
mode:
authorArnstein Ressem <aressem@gmail.com>2016-08-23 15:10:36 +0200
committerVegard Sjonfjell <vegardsjo@gmail.com>2016-08-23 15:10:36 +0200
commit55e5a91901109161186e05d3a6e959e06958bbba (patch)
treef312bab2c60207ee305dbcfa047fcc4fa8fd2dc1 /documentapi/src/tests/messages
parentd337a29392fb752dc725e4aea5efa0cc0df5f17a (diff)
Aressem/cmake more out of source tests (#441)
* vespalib tests run out of source. * staging_vespalib run tests out of source. * fastos tests run out of source. * Fixed storage tests out of source. * Fixed some of the config tests. * config* tests run out of source. * document_* tests run out of source. * documentapi_ tests run out of source. * Fixed fsa out of source tests. * Fix jrt_test out of source. * More tests run out of source. * Fix some slobrok and messagebus tests. * More fixes for out of source tests. * Done with first pass of regular tests out of source. * Only use SOURCE_DIRECTORY in a limited set of places. * Fix some remaining tests. * Some cleanups. * No need for extra slash.
Diffstat (limited to 'documentapi/src/tests/messages')
-rw-r--r--documentapi/src/tests/messages/error_codes_test.cpp10
-rw-r--r--documentapi/src/tests/messages/testbase.cpp5
2 files changed, 9 insertions, 6 deletions
diff --git a/documentapi/src/tests/messages/error_codes_test.cpp b/documentapi/src/tests/messages/error_codes_test.cpp
index 1714fb70a04..e9ad68f441e 100644
--- a/documentapi/src/tests/messages/error_codes_test.cpp
+++ b/documentapi/src/tests/messages/error_codes_test.cpp
@@ -16,6 +16,7 @@ class ErrorCodesTest : public vespalib::TestApp {
int Main() override;
void error_codes_match_java_definitions();
NamedErrorCodes all_document_protocol_error_codes();
+ std::string path_prefixed(const std::string& file_name) const;
};
TEST_APPHOOK(ErrorCodesTest);
@@ -94,12 +95,13 @@ std::string to_sorted_key_value_string(const NamedErrorCodes& codes) {
return os.str();
}
-std::string path_prefixed(const std::string& file_name) {
- return "../../../test/crosslanguagefiles/" + file_name;
-}
-
} // anon ns
+std::string
+ErrorCodesTest::path_prefixed(const std::string& file_name) const {
+ return GetSourceDirectory() + "../../../test/crosslanguagefiles/" + file_name;
+}
+
void
ErrorCodesTest::error_codes_match_java_definitions()
{
diff --git a/documentapi/src/tests/messages/testbase.cpp b/documentapi/src/tests/messages/testbase.cpp
index 2edbd2d0b9c..7ccf681c825 100644
--- a/documentapi/src/tests/messages/testbase.cpp
+++ b/documentapi/src/tests/messages/testbase.cpp
@@ -11,8 +11,9 @@ using document::DocumentTypeRepo;
using document::readDocumenttypesConfig;
TestBase::TestBase() :
- _repo(new DocumentTypeRepo(readDocumenttypesConfig("../../../test/cfg/testdoctypes.cfg"))),
- _dataPath("../../../test/crosslanguagefiles"),
+ _repo(new DocumentTypeRepo(readDocumenttypesConfig(
+ GetSourceDirectory() + "../../../test/cfg/testdoctypes.cfg"))),
+ _dataPath(GetSourceDirectory() + "../../../test/crosslanguagefiles"),
_loadTypes(),
_protocol(_loadTypes, _repo),
_tests()