changeset 518:b557017ad3f0

Tests: unify test files for directory/file tests
author David Demelier <markand@malikania.fr>
date Fri, 27 Oct 2017 08:52:39 +0200
parents 7b1781724868
children 63faa8087c46
files tests/CMakeLists.txt tests/js-directory/main.cpp tests/util/main.cpp
diffstat 3 files changed, 7 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/tests/CMakeLists.txt	Tue Oct 24 16:27:51 2017 +0200
+++ b/tests/CMakeLists.txt	Fri Oct 27 08:52:39 2017 +0200
@@ -56,7 +56,7 @@
     add_subdirectory(cmd-server-part)
     add_subdirectory(cmd-server-reconnect)
     add_subdirectory(cmd-server-topic)
-    add_subdirectory(dynlib_plugin)
+#    add_subdirectory(dynlib_plugin)
 
     # Misc
     add_subdirectory(logger)
--- a/tests/js-directory/main.cpp	Tue Oct 24 16:27:51 2017 +0200
+++ b/tests/js-directory/main.cpp	Fri Oct 27 08:52:39 2017 +0200
@@ -34,9 +34,9 @@
 BOOST_AUTO_TEST_CASE(constructor)
 {
     const std::string script(
-        "d = new Irccd.Directory(TESTS_BINARY_DIR + \"/level-1\");"
+        "d = new Irccd.Directory(TESTS_BINARY_DIR + \"/root\");"
         "p = d.path;"
-        "e = d.entries;"
+        "l = d.entries.length;"
     );
 
     if (duk_peval_string(plugin_->context(), script.c_str()) != 0)
--- a/tests/util/main.cpp	Tue Oct 24 16:27:51 2017 +0200
+++ b/tests/util/main.cpp	Fri Oct 27 08:52:39 2017 +0200
@@ -469,8 +469,8 @@
 
 BOOST_AUTO_TEST_CASE(not_recursive)
 {
-    auto file1 = util::fs::find(CMAKE_CURRENT_BINARY_DIR "/root", "file-1.txt", false);
-    auto file2 = util::fs::find(CMAKE_CURRENT_BINARY_DIR "/root", "file-2.txt", false);
+    auto file1 = util::fs::find(TESTS_BINARY_DIR "/root", "file-1.txt", false);
+    auto file2 = util::fs::find(TESTS_BINARY_DIR "/root", "file-2.txt", false);
 
     BOOST_TEST(file1.find("file-1.txt") != std::string::npos);
     BOOST_TEST(file2.empty());
@@ -478,8 +478,8 @@
 
 BOOST_AUTO_TEST_CASE(recursive)
 {
-    auto file1 = util::fs::find(CMAKE_CURRENT_BINARY_DIR "/root", "file-1.txt", true);
-    auto file2 = util::fs::find(CMAKE_CURRENT_BINARY_DIR "/root", "file-2.txt", true);
+    auto file1 = util::fs::find(TESTS_BINARY_DIR "/root", "file-1.txt", true);
+    auto file2 = util::fs::find(TESTS_BINARY_DIR "/root", "file-2.txt", true);
 
     BOOST_TEST(file1.find("file-1.txt") != std::string::npos);
     BOOST_TEST(file2.find("file-2.txt") != std::string::npos);