summaryrefslogtreecommitdiffstats
path: root/documentapi/src
diff options
context:
space:
mode:
Diffstat (limited to 'documentapi/src')
-rw-r--r--documentapi/src/tests/messagebus/messagebus_test.cpp3
-rw-r--r--documentapi/src/tests/messages/error_codes_test.cpp10
-rw-r--r--documentapi/src/tests/messages/testbase.cpp5
-rw-r--r--documentapi/src/tests/policies/policies_test.cpp2
-rw-r--r--documentapi/src/tests/priority/priority.cpp2
5 files changed, 13 insertions, 9 deletions
diff --git a/documentapi/src/tests/messagebus/messagebus_test.cpp b/documentapi/src/tests/messagebus/messagebus_test.cpp
index b55d35825fe..924325d117a 100644
--- a/documentapi/src/tests/messagebus/messagebus_test.cpp
+++ b/documentapi/src/tests/messagebus/messagebus_test.cpp
@@ -36,7 +36,8 @@ int
Test::Main()
{
TEST_INIT(_argv[0]);
- _repo.reset(new DocumentTypeRepo(readDocumenttypesConfig("../../../test/cfg/testdoctypes.cfg")));
+ _repo.reset(new DocumentTypeRepo(readDocumenttypesConfig(
+ GetSourceDirectory() + "../../../test/cfg/testdoctypes.cfg")));
testMessage(); TEST_FLUSH();
testProtocol(); TEST_FLUSH();
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()
diff --git a/documentapi/src/tests/policies/policies_test.cpp b/documentapi/src/tests/policies/policies_test.cpp
index 1cab15a325f..6ee1625954d 100644
--- a/documentapi/src/tests/policies/policies_test.cpp
+++ b/documentapi/src/tests/policies/policies_test.cpp
@@ -97,7 +97,7 @@ Test::Main() {
TEST_INIT(_argv[0]);
_repo.reset(new DocumentTypeRepo(readDocumenttypesConfig(
- "../../../test/cfg/testdoctypes.cfg")));
+ GetSourceDirectory() + "../../../test/cfg/testdoctypes.cfg")));
_docType = _repo->getDocumentType("testdoc");
testProtocol(); TEST_FLUSH();
diff --git a/documentapi/src/tests/priority/priority.cpp b/documentapi/src/tests/priority/priority.cpp
index 3ad0e2041cf..a9fcd011a5e 100644
--- a/documentapi/src/tests/priority/priority.cpp
+++ b/documentapi/src/tests/priority/priority.cpp
@@ -35,7 +35,7 @@ Test::Main()
expected.push_back(Priority::PRI_LOWEST);
std::ifstream in;
- in.open("../../../test/crosslanguagefiles/5.1-Priority.txt");
+ in.open((GetSourceDirectory() + "../../../test/crosslanguagefiles/5.1-Priority.txt").c_str());
ASSERT_TRUE(in.good());
while (in) {
std::string str;