summaryrefslogtreecommitdiffstats
path: root/juniper
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 /juniper
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 'juniper')
-rw-r--r--juniper/src/test/CMakeLists.txt7
-rw-r--r--juniper/src/test/SrcTestSuite.cpp5
-rw-r--r--juniper/src/test/auxTest.cpp4
-rw-r--r--juniper/src/test/auxTestApp.cpp5
-rw-r--r--juniper/src/test/matchobjectTestApp.cpp5
-rw-r--r--juniper/src/test/mcandTestApp.cpp5
-rw-r--r--juniper/src/test/queryparserTestApp.cpp5
7 files changed, 24 insertions, 12 deletions
diff --git a/juniper/src/test/CMakeLists.txt b/juniper/src/test/CMakeLists.txt
index d574c068c38..2edabb70c2b 100644
--- a/juniper/src/test/CMakeLists.txt
+++ b/juniper/src/test/CMakeLists.txt
@@ -6,6 +6,7 @@ vespa_add_executable(juniper_mcandTest_app TEST
testenv.cpp
DEPENDS
juniper
+ vespalib
)
vespa_add_test(NAME juniper_mcandTest_app COMMAND juniper_mcandTest_app)
vespa_add_executable(juniper_queryparserTest_app TEST
@@ -16,6 +17,7 @@ vespa_add_executable(juniper_queryparserTest_app TEST
testenv.cpp
DEPENDS
juniper
+ vespalib
)
vespa_add_test(NAME juniper_queryparserTest_app COMMAND juniper_queryparserTest_app)
vespa_add_executable(juniper_matchobjectTest_app TEST
@@ -26,6 +28,7 @@ vespa_add_executable(juniper_matchobjectTest_app TEST
fakerewriter.cpp
DEPENDS
juniper
+ vespalib
)
vespa_add_test(NAME juniper_matchobjectTest_app COMMAND juniper_matchobjectTest_app)
vespa_add_executable(juniper_appender_test_app TEST
@@ -33,6 +36,7 @@ vespa_add_executable(juniper_appender_test_app TEST
appender_test.cpp
DEPENDS
juniper
+ vespalib
)
vespa_add_test(NAME juniper_appender_test_app COMMAND juniper_appender_test_app)
vespa_add_executable(juniper_queryvisitor_test_app TEST
@@ -40,6 +44,7 @@ vespa_add_executable(juniper_queryvisitor_test_app TEST
queryvisitor_test.cpp
DEPENDS
juniper
+ vespalib
)
vespa_add_test(NAME juniper_queryvisitor_test_app COMMAND juniper_queryvisitor_test_app)
vespa_add_executable(juniper_auxTest_app TEST
@@ -49,6 +54,7 @@ vespa_add_executable(juniper_auxTest_app TEST
testenv.cpp
DEPENDS
juniper
+ vespalib
)
vespa_add_test(NAME juniper_auxTest_app COMMAND juniper_auxTest_app)
vespa_add_executable(juniper_SrcTestSuite_app TEST
@@ -62,5 +68,6 @@ vespa_add_executable(juniper_SrcTestSuite_app TEST
testenv.cpp
DEPENDS
juniper
+ vespalib
)
vespa_add_test(NAME juniper_SrcTestSuite_app COMMAND juniper_SrcTestSuite_app)
diff --git a/juniper/src/test/SrcTestSuite.cpp b/juniper/src/test/SrcTestSuite.cpp
index d725278a009..42dbe6e4a5e 100644
--- a/juniper/src/test/SrcTestSuite.cpp
+++ b/juniper/src/test/SrcTestSuite.cpp
@@ -17,6 +17,7 @@
****************************************************************************/
#include <vespa/fastos/fastos.h>
#include <vespa/log/log.h>
+#include <vespa/vespalib/testkit/testapp.h>
LOG_SETUP("SrcTestSuite");
#include <vespa/fastlib/testsuite/suite.h>
#include "testenv.h"
@@ -52,13 +53,13 @@ SrcTestSuite::SrcTestSuite() :
*
* @author Knut Omang
*/
-class SrcTestSuiteApp : public FastOS_Application {
+class SrcTestSuiteApp : public vespalib::TestApp {
public:
virtual int Main();
};
int SrcTestSuiteApp::Main() {
- juniper::TestEnv te(this, "../rpclient/testclient.rc");
+ juniper::TestEnv te(this, (GetSourceDirectory() + "../rpclient/testclient.rc").c_str());
SrcTestSuite suite;
suite.Run();
long failures = suite.Report();
diff --git a/juniper/src/test/auxTest.cpp b/juniper/src/test/auxTest.cpp
index 7c53b2a7999..99ccd24af35 100644
--- a/juniper/src/test/auxTest.cpp
+++ b/juniper/src/test/auxTest.cpp
@@ -154,7 +154,7 @@ AuxTest::TestPartialUTF8()
{
const int inputSize = 5769; // NB: update this if input is changed
char input[inputSize];
- FastOS_File file("partialutf8.input.utf8");
+ FastOS_File file((GetSourceDirectory() + "partialutf8.input.utf8").c_str());
_test(file.OpenReadOnly());
_test(file.GetSize() == inputSize);
_test(file.Read(input, inputSize));
@@ -191,7 +191,7 @@ void AuxTest::TestLargeBlockChinese()
{
const int inputSize = 10410; // NB: update this if input is changed
char input[inputSize];
- FastOS_File file("largeblockchinese.input.utf8");
+ FastOS_File file((GetSourceDirectory() + "largeblockchinese.input.utf8").c_str());
_test(file.OpenReadOnly());
_test(file.GetSize() == inputSize);
_test(file.Read(input, inputSize));
diff --git a/juniper/src/test/auxTestApp.cpp b/juniper/src/test/auxTestApp.cpp
index 7b37cc909bb..50b367f99ec 100644
--- a/juniper/src/test/auxTestApp.cpp
+++ b/juniper/src/test/auxTestApp.cpp
@@ -1,10 +1,11 @@
// Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
#include <vespa/fastos/fastos.h>
#include <vespa/log/log.h>
+#include <vespa/vespalib/testkit/testapp.h>
LOG_SETUP("auxTest");
#include "auxTest.h"
-class AuxTestApp : public FastOS_Application
+class AuxTestApp : public vespalib::TestApp
{
public:
virtual int Main();
@@ -20,7 +21,7 @@ void Usage(char* s)
int AuxTestApp::Main()
{
- juniper::TestEnv te(this, "../rpclient/testclient.rc");
+ juniper::TestEnv te(this, (GetSourceDirectory() + "../rpclient/testclient.rc").c_str());
AuxTest pta;
pta.SetStream(&std::cout);
pta.Run(_argc, _argv);
diff --git a/juniper/src/test/matchobjectTestApp.cpp b/juniper/src/test/matchobjectTestApp.cpp
index ada38fa1747..9c9786969be 100644
--- a/juniper/src/test/matchobjectTestApp.cpp
+++ b/juniper/src/test/matchobjectTestApp.cpp
@@ -18,6 +18,7 @@
****************************************************************************/
#include <vespa/fastos/fastos.h>
#include <vespa/log/log.h>
+#include <vespa/vespalib/testkit/testapp.h>
LOG_SETUP("matchobjectTest");
#include "matchobjectTest.h"
#include "testenv.h"
@@ -28,10 +29,10 @@ LOG_SETUP("matchobjectTest");
*
* @sa MatchObject @author Knut Omang
*/
-class MatchObjectTestApp : public FastOS_Application {
+class MatchObjectTestApp : public vespalib::TestApp {
public:
virtual int Main() {
- juniper::TestEnv te(this, "../rpclient/testclient.rc");
+ juniper::TestEnv te(this, (GetSourceDirectory() + "../rpclient/testclient.rc").c_str());
MatchObjectTest test;
test.SetStream(&std::cout);
test.Run(_argc, _argv);
diff --git a/juniper/src/test/mcandTestApp.cpp b/juniper/src/test/mcandTestApp.cpp
index 7bbc9681d21..fb331ac2b2a 100644
--- a/juniper/src/test/mcandTestApp.cpp
+++ b/juniper/src/test/mcandTestApp.cpp
@@ -18,6 +18,7 @@
****************************************************************************/
#include <vespa/fastos/fastos.h>
#include <vespa/log/log.h>
+#include <vespa/vespalib/testkit/testapp.h>
LOG_SETUP("mcandTest");
#include "mcandTest.h"
#include "testenv.h"
@@ -28,10 +29,10 @@ LOG_SETUP("mcandTest");
*
* @sa MatchCandidate @author Knut Omang
*/
-class MatchCandidateTestApp : public FastOS_Application {
+class MatchCandidateTestApp : public vespalib::TestApp {
public:
virtual int Main() {
- juniper::TestEnv te(this, "../rpclient/testclient.rc");
+ juniper::TestEnv te(this, (GetSourceDirectory() + "../rpclient/testclient.rc").c_str());
MatchCandidateTest test;
test.SetStream(&std::cout);
test.Run(_argc, _argv);
diff --git a/juniper/src/test/queryparserTestApp.cpp b/juniper/src/test/queryparserTestApp.cpp
index f7c8bce4afa..6391885599a 100644
--- a/juniper/src/test/queryparserTestApp.cpp
+++ b/juniper/src/test/queryparserTestApp.cpp
@@ -18,6 +18,7 @@
****************************************************************************/
#include <vespa/fastos/fastos.h>
#include <vespa/log/log.h>
+#include <vespa/vespalib/testkit/testapp.h>
LOG_SETUP("queryparserTest");
#include "queryparserTest.h"
#include "testenv.h"
@@ -28,10 +29,10 @@ LOG_SETUP("queryparserTest");
*
* @sa QueryParser @author Knut Omang
*/
-class QueryParserTestApp : public FastOS_Application {
+class QueryParserTestApp : public vespalib::TestApp {
public:
virtual int Main() {
- juniper::TestEnv te(this, "../rpclient/testclient.rc");
+ juniper::TestEnv te(this, (GetSourceDirectory() + "../rpclient/testclient.rc").c_str());
QueryParserTest test;
test.SetStream(&std::cout);
test.Run(_argc, _argv);