aboutsummaryrefslogtreecommitdiffstats
path: root/memfilepersistence
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 /memfilepersistence
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 'memfilepersistence')
-rw-r--r--memfilepersistence/src/tests/device/partitionmonitortest.cpp25
-rw-r--r--memfilepersistence/src/tests/testhelper.cpp5
2 files changed, 17 insertions, 13 deletions
diff --git a/memfilepersistence/src/tests/device/partitionmonitortest.cpp b/memfilepersistence/src/tests/device/partitionmonitortest.cpp
index 1a016edcc83..45eed305507 100644
--- a/memfilepersistence/src/tests/device/partitionmonitortest.cpp
+++ b/memfilepersistence/src/tests/device/partitionmonitortest.cpp
@@ -2,6 +2,7 @@
#include <vespa/fastos/fastos.h>
#include <vespa/memfilepersistence/device/partitionmonitor.h>
+#include <vespa/vespalib/testkit/testapp.h>
#include <vespa/vdstestlib/cppunit/macros.h>
namespace storage {
@@ -62,15 +63,16 @@ struct FakeStatter : public PartitionMonitor::Statter {
void PartitionMonitorTest::testNormalUsage()
{
- PartitionMonitor monitor("testrunner.cpp");
+ const std::string file_name = vespalib::TestApp::GetSourceDirectory() + "testrunner.cpp";
+ PartitionMonitor monitor(file_name);
FakeStatter* statter = new FakeStatter();
monitor.setStatter(std::unique_ptr<PartitionMonitor::Statter>(statter));
std::string expected(
- "PartitionMonitor(testrunner.cpp, STAT_PERIOD(100), "
+ "PartitionMonitor(" + file_name + ", STAT_PERIOD(100), "
"2048000/3686400 used - 55.5556 % full)");
CPPUNIT_ASSERT_EQUAL(expected, monitor.toString(false));
expected =
- "PartitionMonitor(testrunner.cpp) {\n"
+ "PartitionMonitor(" + file_name + ") {\n"
" Fill rate: 55.5556 %\n"
" Inode fill rate: 51.6129 %\n"
" Detected block size: 4096\n"
@@ -88,16 +90,17 @@ void PartitionMonitorTest::testNormalUsage()
void PartitionMonitorTest::testHighInodeFillrate()
{
- PartitionMonitor monitor("testrunner.cpp");
+ const std::string file_name = vespalib::TestApp::GetSourceDirectory() + "testrunner.cpp";
+ PartitionMonitor monitor(file_name);
FakeStatter* statter = new FakeStatter();
statter->_info.f_favail = 2;
monitor.setStatter(std::unique_ptr<PartitionMonitor::Statter>(statter));
std::string expected(
- "PartitionMonitor(testrunner.cpp, STAT_PERIOD(100), "
+ "PartitionMonitor(" + file_name + ", STAT_PERIOD(100), "
"2048000/3686400 used - 94.1176 % full (inodes))");
CPPUNIT_ASSERT_EQUAL(expected, monitor.toString(false));
expected =
- "PartitionMonitor(testrunner.cpp) {\n"
+ "PartitionMonitor(" + file_name + ") {\n"
" Fill rate: 55.5556 %\n"
" Inode fill rate: 94.1176 %\n"
" Detected block size: 4096\n"
@@ -115,7 +118,7 @@ void PartitionMonitorTest::testHighInodeFillrate()
void PartitionMonitorTest::testAlwaysStatPolicy()
{
- PartitionMonitor monitor("testrunner.cpp");
+ PartitionMonitor monitor(vespalib::TestApp::GetSourceDirectory() + "testrunner.cpp");
FakeStatter* statter = new FakeStatter();
monitor.setStatter(std::unique_ptr<PartitionMonitor::Statter>(statter));
monitor.setAlwaysStatPolicy();
@@ -127,7 +130,7 @@ void PartitionMonitorTest::testAlwaysStatPolicy()
void PartitionMonitorTest::testPeriodPolicy()
{
- PartitionMonitor monitor("testrunner.cpp");
+ PartitionMonitor monitor(vespalib::TestApp::GetSourceDirectory() + "testrunner.cpp");
FakeStatter* statter = new FakeStatter();
monitor.setStatter(std::unique_ptr<PartitionMonitor::Statter>(statter));
monitor.setStatPeriodPolicy(4);
@@ -139,7 +142,7 @@ void PartitionMonitorTest::testPeriodPolicy()
void PartitionMonitorTest::testStatOncePolicy()
{
- PartitionMonitor monitor("testrunner.cpp");
+ PartitionMonitor monitor(vespalib::TestApp::GetSourceDirectory() + "testrunner.cpp");
FakeStatter* statter = new FakeStatter();
monitor.setStatter(std::unique_ptr<PartitionMonitor::Statter>(statter));
monitor.setStatOncePolicy();
@@ -151,7 +154,7 @@ void PartitionMonitorTest::testStatOncePolicy()
void PartitionMonitorTest::testDynamicPolicy()
{
- PartitionMonitor monitor("testrunner.cpp");
+ PartitionMonitor monitor(vespalib::TestApp::GetSourceDirectory() + "testrunner.cpp");
FakeStatter* statter = new FakeStatter();
monitor.setStatter(std::unique_ptr<PartitionMonitor::Statter>(statter));
monitor.setStatDynamicPolicy(2);
@@ -177,7 +180,7 @@ void PartitionMonitorTest::testDynamicPolicy()
void PartitionMonitorTest::testIsFull()
{
- PartitionMonitor monitor("testrunner.cpp");
+ PartitionMonitor monitor(vespalib::TestApp::GetSourceDirectory() + "testrunner.cpp");
monitor.setMaxFillness(0.85);
FakeStatter* statter = new FakeStatter();
monitor.setStatOncePolicy();
diff --git a/memfilepersistence/src/tests/testhelper.cpp b/memfilepersistence/src/tests/testhelper.cpp
index 40a3512e400..39bd1d0968b 100644
--- a/memfilepersistence/src/tests/testhelper.cpp
+++ b/memfilepersistence/src/tests/testhelper.cpp
@@ -4,7 +4,7 @@
#include <vespa/log/log.h>
#include <vespa/vespalib/io/fileutil.h>
-
+#include <vespa/vespalib/testkit/testapp.h>
LOG_SETUP(".testhelper");
namespace storage {
@@ -86,7 +86,8 @@ vdstestlib::DirConfig getStandardConfig(bool storagenode) {
config->set("maxconcurrentvisitors_fixed", "4");
config->set("maxconcurrentvisitors_variable", "0");
config = &dc.addConfig("stor-visitordispatcher");
- addFileConfig(dc, "documenttypes", "config-doctypes.cfg");
+ addFileConfig(dc, "documenttypes",
+ vespalib::TestApp::GetSourceDirectory() + "config-doctypes.cfg");
addStorageDistributionConfig(dc);
return dc;
}