]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[2957] Fixed path to dhcp-ddns.spec for spec file unit test, so file
authorThomas Markwalder <tmark@debian-tkm-01.tmark>
Thu, 20 Jun 2013 13:39:50 +0000 (09:39 -0400)
committerThomas Markwalder <tmark@debian-tkm-01.tmark>
Thu, 20 Jun 2013 13:39:50 +0000 (09:39 -0400)
can be located properly. Unit test was failing during distcheck.

configure.ac
src/bin/d2/tests/d2_cfg_mgr_unittests.cc
src/bin/d2/tests/test_data_files_config.h.in [new file with mode: 0644]

index fc216c4bab981d068943604ecfbefbb99e6a5ddf..3b068c6401b6d21f4fe69136de07241598c59ac3 100644 (file)
@@ -1388,6 +1388,7 @@ AC_OUTPUT([doc/version.ent
            src/bin/dhcp4/spec_config.h.pre
            src/bin/dhcp6/spec_config.h.pre
            src/bin/d2/spec_config.h.pre
+           src/bin/d2/tests/test_data_files_config.h
            src/bin/tests/process_rename_test.py
            src/lib/config/tests/data_def_unittests_config.h
            src/lib/python/isc/config/tests/config_test
index 77c14bb3d7288bfec1c362b99bc50c44ce6077c7..6727c12fbe869dbd1a954b42fd1e0764ad3902e6 100644 (file)
@@ -16,6 +16,7 @@
 #include <d2/d2_config.h>
 #include <d2/d2_cfg_mgr.h>
 #include <d_test_stubs.h>
+#include <test_data_files_config.h>
 
 #include <boost/foreach.hpp>
 #include <gtest/gtest.h>
@@ -26,6 +27,10 @@ using namespace isc::d2;
 
 namespace {
 
+std::string specfile(const std::string& name) {
+    return (std::string(D2_SRC_DIR) + "/" + name);
+}
+
 /// @brief Test fixture class for testing D2CfgMgr class.
 /// It maintains an member instance of D2CfgMgr and provides methods for
 /// converting JSON strings to configuration element sets, checking parse
@@ -49,7 +54,8 @@ public:
 /// Verifies that the BIND10 DHCP-DDNS configuration specification file
 //  is valid.
 TEST(D2SpecTest, basicSpecTest) {
-    ASSERT_NO_THROW(isc::config::moduleSpecFromFile("../dhcp-ddns.spec"));
+    ASSERT_NO_THROW(isc::config::
+                    moduleSpecFromFile(specfile("dhcp-ddns.spec")));
 }
 
 /// @brief Convenience function which compares the contents of the given
diff --git a/src/bin/d2/tests/test_data_files_config.h.in b/src/bin/d2/tests/test_data_files_config.h.in
new file mode 100644 (file)
index 0000000..6064d3d
--- /dev/null
@@ -0,0 +1,17 @@
+// Copyright (C) 2009  Internet Systems Consortium, Inc. ("ISC")   
+//
+// Permission to use, copy, modify, and/or distribute this software for any
+// purpose with or without fee is hereby granted, provided that the above
+// copyright notice and this permission notice appear in all copies.
+//
+// THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+// REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+// AND FITNESS.  IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+// INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+// LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+// OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+// PERFORMANCE OF THIS SOFTWARE.
+
+/// @brief Path to D2 source dir so tests against the dhcp-ddns.spec file
+/// can find it reliably.
+#define D2_SRC_DIR "@abs_top_srcdir@/src/bin/d2"