summaryrefslogtreecommitdiffstats
path: root/vespalib
diff options
context:
space:
mode:
authorHenning Baldersheim <balder@oath.com>2018-09-26 08:44:03 +0200
committerHenning Baldersheim <balder@oath.com>2018-09-26 08:44:03 +0200
commit00d75be4343bbdd95175ab12aaa388944e10ba55 (patch)
tree8e4cf6936479e2407229aced16ee3169062efca8 /vespalib
parent00ec7d6b50cada563c42fbc4b7d94435ee8bf118 (diff)
Add simple usage test for vespa-drop-file-from-cache
Diffstat (limited to 'vespalib')
-rw-r--r--vespalib/src/tests/drop-file-from-cache/CMakeLists.txt8
-rw-r--r--vespalib/src/tests/drop-file-from-cache/drop_file_from_cache_test.cpp13
2 files changed, 21 insertions, 0 deletions
diff --git a/vespalib/src/tests/drop-file-from-cache/CMakeLists.txt b/vespalib/src/tests/drop-file-from-cache/CMakeLists.txt
new file mode 100644
index 00000000000..d6f4a51a4c5
--- /dev/null
+++ b/vespalib/src/tests/drop-file-from-cache/CMakeLists.txt
@@ -0,0 +1,8 @@
+# Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
+vespa_add_executable(vespalib_drop_file_from_cache_test_app TEST
+ SOURCES
+ drop_file_from_cache_test.cpp
+ DEPENDS
+ vespalib
+)
+vespa_add_test(NAME vespalib_drop_file_from_cache_test_app COMMAND vespalib_drop_file_from_cache_test_app)
diff --git a/vespalib/src/tests/drop-file-from-cache/drop_file_from_cache_test.cpp b/vespalib/src/tests/drop-file-from-cache/drop_file_from_cache_test.cpp
new file mode 100644
index 00000000000..efdc81ab6d0
--- /dev/null
+++ b/vespalib/src/tests/drop-file-from-cache/drop_file_from_cache_test.cpp
@@ -0,0 +1,13 @@
+// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
+#include <vespa/vespalib/testkit/test_kit.h>
+#include <vespa/vespalib/util/slaveproc.h>
+
+using vespalib::SlaveProc;
+
+TEST("simple run") {
+ std::string out;
+ EXPECT_TRUE(SlaveProc::run("../../apps/vespa-drop-file-from-cache/vespa-drop-file-from-cache", out));
+ EXPECT_EQUAL(out, "foo");
+}
+
+TEST_MAIN_WITH_PROCESS_PROXY() { TEST_RUN_ALL(); }