summaryrefslogtreecommitdiffstats
path: root/searchcore/src
diff options
context:
space:
mode:
Diffstat (limited to 'searchcore/src')
-rw-r--r--searchcore/src/tests/applyattrupdates/applyattrupdates.cpp4
-rw-r--r--searchcore/src/tests/proton/docsummary/docsummary.cpp10
-rw-r--r--searchcore/src/tests/proton/documentdb/document_subdbs/document_subdbs_test.cpp9
-rw-r--r--searchcore/src/tests/proton/documentdb/documentdb_test.cpp3
-rw-r--r--searchcore/src/tests/proton/documentdb/fileconfigmanager/fileconfigmanager_test.cpp3
5 files changed, 12 insertions, 17 deletions
diff --git a/searchcore/src/tests/applyattrupdates/applyattrupdates.cpp b/searchcore/src/tests/applyattrupdates/applyattrupdates.cpp
index 9454b51b6ac..8cb671f585e 100644
--- a/searchcore/src/tests/applyattrupdates/applyattrupdates.cpp
+++ b/searchcore/src/tests/applyattrupdates/applyattrupdates.cpp
@@ -134,7 +134,6 @@ private:
void requireThatArrayAttributesAreUpdated();
void requireThatWeightedSetAttributesAreUpdated();
- std::string _srcdir;
DocumentTypeRepo _repo;
const DocumentType* _docType;
@@ -318,8 +317,7 @@ Test::requireThatWeightedSetAttributesAreUpdated()
}
Test::Test()
- : _srcdir(getenv("SOURCE_DIRECTORY") ? getenv("SOURCE_DIRECTORY") : "."),
- _repo(readDocumenttypesConfig((_srcdir + "/doctypes.cfg").c_str())),
+ : _repo(readDocumenttypesConfig(vespalib::TestApp::GetSourceDirectory() + "doctypes.cfg")),
_docType(_repo.getDocumentType("testdoc"))
{
}
diff --git a/searchcore/src/tests/proton/docsummary/docsummary.cpp b/searchcore/src/tests/proton/docsummary/docsummary.cpp
index 5aaded3c848..b472c612281 100644
--- a/searchcore/src/tests/proton/docsummary/docsummary.cpp
+++ b/searchcore/src/tests/proton/docsummary/docsummary.cpp
@@ -155,7 +155,7 @@ public:
_queryLimiter(),
_clock(),
_dummy(),
- _spec(getenv("SOURCE_DIRECTORY") ? getenv("SOURCE_DIRECTORY") : "."),
+ _spec(vespalib::TestApp::GetSourceDirectory()),
_configMgr(_spec, getDocTypeName()),
_documenttypesConfig(new DocumenttypesConfig()),
_repo(repo),
@@ -1246,13 +1246,13 @@ Test::Test()
_resultCfg(),
_markupFields()
{
- auto envSrcDir = getenv("SOURCE_DIRECTORY");
- std::string srcDir = envSrcDir ? envSrcDir : ".";
std::string cfgId("summary");
- _summaryCfg = config::ConfigGetter<vespa::config::search::SummaryConfig>::getConfig(cfgId, config::FileSpec(srcDir + "/summary.cfg"));
+ _summaryCfg = config::ConfigGetter<vespa::config::search::SummaryConfig>::getConfig(
+ cfgId, config::FileSpec(vespalib::TestApp::GetSourceDirectory() + "summary.cfg"));
_resultCfg.ReadConfig(*_summaryCfg, cfgId.c_str());
std::string mapCfgId("summarymap");
- std::unique_ptr<vespa::config::search::SummarymapConfig> mapCfg = config::ConfigGetter<vespa::config::search::SummarymapConfig>::getConfig(mapCfgId, config::FileSpec(srcDir + "/summarymap.cfg"));
+ std::unique_ptr<vespa::config::search::SummarymapConfig> mapCfg = config::ConfigGetter<vespa::config::search::SummarymapConfig>::getConfig(
+ mapCfgId, config::FileSpec(vespalib::TestApp::GetSourceDirectory() + "summarymap.cfg"));
for (size_t i = 0; i < mapCfg->override.size(); ++i) {
const vespa::config::search::SummarymapConfig::Override & o = mapCfg->override[i];
if (o.command == "dynamicteaser") {
diff --git a/searchcore/src/tests/proton/documentdb/document_subdbs/document_subdbs_test.cpp b/searchcore/src/tests/proton/documentdb/document_subdbs/document_subdbs_test.cpp
index b2150db91dc..5c6a7db1876 100644
--- a/searchcore/src/tests/proton/documentdb/document_subdbs/document_subdbs_test.cpp
+++ b/searchcore/src/tests/proton/documentdb/document_subdbs/document_subdbs_test.cpp
@@ -54,13 +54,12 @@ typedef std::vector<AttributeGuard> AttributeGuardList;
const std::string DOCTYPE_NAME = "searchdocument";
const std::string SUB_NAME = "subdb";
const std::string BASE_DIR = "basedir";
-const std::string SOURCE_DIR = getenv("SOURCE_DIRECTORY") ? getenv("SOURCE_DIRECTORY") : ".";
const SerialNum CFG_SERIAL = 5;
-struct ConfigDir1 { static vespalib::string dir() { return SOURCE_DIR + "/cfg1"; } };
-struct ConfigDir2 { static vespalib::string dir() { return SOURCE_DIR + "/cfg2"; } };
-struct ConfigDir3 { static vespalib::string dir() { return SOURCE_DIR + "/cfg3"; } };
-struct ConfigDir4 { static vespalib::string dir() { return SOURCE_DIR + "/cfg4"; } };
+struct ConfigDir1 { static vespalib::string dir() { return vespalib::TestApp::GetSourceDirectory() + "cfg1"; } };
+struct ConfigDir2 { static vespalib::string dir() { return vespalib::TestApp::GetSourceDirectory() + "cfg2"; } };
+struct ConfigDir3 { static vespalib::string dir() { return vespalib::TestApp::GetSourceDirectory() + "cfg3"; } };
+struct ConfigDir4 { static vespalib::string dir() { return vespalib::TestApp::GetSourceDirectory() + "cfg4"; } };
struct MySubDBOwner : public IDocumentSubDB::IOwner
{
diff --git a/searchcore/src/tests/proton/documentdb/documentdb_test.cpp b/searchcore/src/tests/proton/documentdb/documentdb_test.cpp
index dec1dc08471..605a8fc5530 100644
--- a/searchcore/src/tests/proton/documentdb/documentdb_test.cpp
+++ b/searchcore/src/tests/proton/documentdb/documentdb_test.cpp
@@ -72,8 +72,7 @@ Fixture::Fixture()
DocumentType docType("typea", 0);
DocumentTypeRepo::SP repo(new DocumentTypeRepo(docType));
TuneFileDocumentDB::SP tuneFileDocumentDB(new TuneFileDocumentDB);
- std::string srcDir = getenv("SOURCE_DIRECTORY") ? getenv("SOURCE_DIRECTORY") : ".";
- config::DirSpec spec(srcDir + "/cfg");
+ config::DirSpec spec(vespalib::TestApp::GetSourceDirectory() + "cfg");
DocumentDBConfigHelper mgr(spec, "typea");
BootstrapConfig::SP
b(new BootstrapConfig(1,
diff --git a/searchcore/src/tests/proton/documentdb/fileconfigmanager/fileconfigmanager_test.cpp b/searchcore/src/tests/proton/documentdb/fileconfigmanager/fileconfigmanager_test.cpp
index 75cf6601f5a..499f8a11aaf 100644
--- a/searchcore/src/tests/proton/documentdb/fileconfigmanager/fileconfigmanager_test.cpp
+++ b/searchcore/src/tests/proton/documentdb/fileconfigmanager/fileconfigmanager_test.cpp
@@ -86,8 +86,7 @@ getSchema(int step)
DocumentDBConfig::SP
makeBaseConfigSnapshot()
{
- std::string srcDir = getenv("SOURCE_DIRECTORY") ? getenv("SOURCE_DIRECTORY") : ".";
- config::DirSpec spec(srcDir + "/cfg");
+ config::DirSpec spec(vespalib::TestApp::GetSourceDirectory() + "cfg");
ConfigKeySet extraKeySet;
extraKeySet.add<MycfgConfig>("");
DBCM dbcm(spec, "test", extraKeySet);