diff options
author | Tor Egge <Tor.Egge@online.no> | 2024-06-18 12:09:18 +0200 |
---|---|---|
committer | Tor Egge <Tor.Egge@online.no> | 2024-06-18 12:09:18 +0200 |
commit | ac694d09deb7aaa004a1362e9e5e82165a5c34ae (patch) | |
tree | 4af993d04ee9c115654a3f7646a13aede0d31bd3 /streamingvisitors/src/tests/searchvisitor | |
parent | abd50498c67f1141c58e463101d4fdcaab0675f2 (diff) |
Read searchvisitor unit test config from source directory.
Diffstat (limited to 'streamingvisitors/src/tests/searchvisitor')
-rw-r--r-- | streamingvisitors/src/tests/searchvisitor/searchvisitor_test.cpp | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/streamingvisitors/src/tests/searchvisitor/searchvisitor_test.cpp b/streamingvisitors/src/tests/searchvisitor/searchvisitor_test.cpp index 7cf333a4bee..0c4fb4d1864 100644 --- a/streamingvisitors/src/tests/searchvisitor/searchvisitor_test.cpp +++ b/streamingvisitors/src/tests/searchvisitor/searchvisitor_test.cpp @@ -15,6 +15,7 @@ #include <vespa/storage/frameworkimpl/component/storagecomponentregisterimpl.h> #include <vespa/storageframework/defaultimplementation/clock/fakeclock.h> #include <vespa/vespalib/gtest/gtest.h> +#include <vespa/vespalib/testkit/test_path.h> #include <vespa/log/log.h> LOG_SETUP("searchvisitor_test"); @@ -30,6 +31,10 @@ vespalib::string get_doc_id(int id) { return "id:test:test::" + std::to_string(id); } +vespalib::string src_cfg(vespalib::stringref prefix, vespalib::stringref suffix) { + return prefix + TEST_PATH("cfg") + suffix; +} + /** * This class reflects the document type defined in cfg/test.sd. */ @@ -160,9 +165,9 @@ public: SearchVisitorTest::SearchVisitorTest() : _componentRegister(), - _env(::config::ConfigUri("dir:cfg"), nullptr, ""), - _factory(::config::ConfigUri("dir:cfg"), nullptr, ""), - _repo(std::make_shared<DocumentTypeRepo>(readDocumenttypesConfig("cfg/documenttypes.cfg"))), + _env(::config::ConfigUri(src_cfg("dir:", "")), nullptr, ""), + _factory(::config::ConfigUri(src_cfg("dir:", "")), nullptr, ""), + _repo(std::make_shared<DocumentTypeRepo>(readDocumenttypesConfig(src_cfg("", "/documenttypes.cfg")))), _doc_type(_repo->getDocumentType("test")) { assert(_doc_type != nullptr); |