diff options
author | Arnstein Ressem <aressem@gmail.com> | 2016-08-15 15:38:23 +0200 |
---|---|---|
committer | Vegard Sjonfjell <vegardsjo@gmail.com> | 2016-08-15 15:38:23 +0200 |
commit | d15dc62521c5cf26455216fa5eb3c3fe0b5c8ada (patch) | |
tree | 195f7d2b2392d07ec6e1c2b9dc14a7a965ecc65c /searchlib/src/tests/indexmetainfo | |
parent | e534ad2c12af07da88b8264c2be189f5f686e927 (diff) |
Aressem/cmake out of source test for script (#409)
* First script runs out of source.
* Call scripts from source directory.
* One more test passing.
* Searchcore tests pass out of source.
* Searchlib tests run out of source:
Diffstat (limited to 'searchlib/src/tests/indexmetainfo')
-rw-r--r-- | searchlib/src/tests/indexmetainfo/indexmetainfo_test.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/searchlib/src/tests/indexmetainfo/indexmetainfo_test.cpp b/searchlib/src/tests/indexmetainfo/indexmetainfo_test.cpp index e7dc828c9e5..4bd40863fc2 100644 --- a/searchlib/src/tests/indexmetainfo/indexmetainfo_test.cpp +++ b/searchlib/src/tests/indexmetainfo/indexmetainfo_test.cpp @@ -14,9 +14,11 @@ TEST_SETUP(Test) int Test::Main() { + const std::string srcDir = getenv("SOURCE_DIRECTORY") ? getenv("SOURCE_DIRECTORY") : "."; + TEST_INIT("indexmetainfo_test"); { // load pregenerated file - IndexMetaInfo info(""); + IndexMetaInfo info(srcDir); EXPECT_TRUE(info.load()); ASSERT_TRUE(info.snapshots().size() == 4); EXPECT_TRUE(info.snapshots()[0].valid); @@ -88,7 +90,7 @@ Test::Main() EXPECT_TRUE(!info.load("file-not-present.txt")); } { // load files with errors should fail - IndexMetaInfo info("."); + IndexMetaInfo info(srcDir); EXPECT_TRUE(!info.load("bogus1.txt")); EXPECT_TRUE(!info.load("bogus2.txt")); EXPECT_TRUE(!info.load("bogus3.txt")); |