]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[3629] Removed reference to UnittestUtil::addDataPath from asiodns tests.
authorMarcin Siodelski <marcin@isc.org>
Thu, 30 Oct 2014 19:22:07 +0000 (20:22 +0100)
committerMarcin Siodelski <marcin@isc.org>
Thu, 30 Oct 2014 19:22:07 +0000 (20:22 +0100)
The reference could be removed because the TEST_DATA_DIR was unused in the
asiodns unit tests. In fact the folder it pointed to did not exist. Removal
of the call to addDataPath allowed for not including and compiling the
dns/tests/unittest_util.h and dns/tests/unittest_util.cc.

The major reason for this change was to remove the dependency on the files
located in the dns/tests because due to the bug in automake they could not
be included in build using an absolute path specified with $(top_srcdir).

Note that when the AUTOMAKE_OPTIONS = subdir-objects is specified, the
object files are created in the subdirectories. When the location of the
source file is specified using a variable like $(top_srcdir) the name of
the variable is treated as a name of the subdirectory, not a path to the
file located out of the tree. Hence, we may need to avoid including files
like this when subdir-objects is in force.

src/lib/asiodns/tests/Makefile.am
src/lib/asiodns/tests/run_unittests.cc

index 830b59de720da648a29db7b71f199a0822ff3488..5adb6ff7dfcd71f29d247a1a77cc86d60cdfc16c 100644 (file)
@@ -4,7 +4,6 @@ AM_CPPFLAGS = -I$(top_srcdir)/src/lib -I$(top_builddir)/src/lib
 AM_CPPFLAGS += $(BOOST_INCLUDES)
 AM_CPPFLAGS += -I$(top_builddir)/src/lib/dns -I$(top_srcdir)/src/bin
 AM_CPPFLAGS += -I$(top_builddir)/src/lib/cc  -I$(top_builddir)/src/lib/util
-AM_CPPFLAGS += -DTEST_DATA_DIR=\"$(srcdir)/testdata\"
 
 AM_CXXFLAGS = $(KEA_CXXFLAGS)
 
@@ -21,8 +20,6 @@ TESTS =
 if HAVE_GTEST
 TESTS += run_unittests
 run_unittests_SOURCES  = run_unittests.cc
-run_unittests_SOURCES += $(top_srcdir)/src/lib/dns/tests/unittest_util.h
-run_unittests_SOURCES += $(top_srcdir)/src/lib/dns/tests/unittest_util.cc
 run_unittests_SOURCES += dns_service_unittest.cc
 run_unittests_SOURCES += dns_server_unittest.cc
 run_unittests_SOURCES += io_fetch_unittest.cc
index 5cacdaf1c1e556b5b73e48ee951080f43ad269fd..b6e36f42ae72fb30d3d598b59a2ba751f6bc3d8c 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2009  Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2009, 2014  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
 #include <util/unittests/run_all.h>
 
 #include <log/logger_support.h>
-#include <dns/tests/unittest_util.h>
 
 int
 main(int argc, char* argv[])
 {
     ::testing::InitGoogleTest(&argc, argv);         // Initialize Google test
     isc::log::initLogger();                         // Initialize logging
-    isc::UnitTestUtil::addDataPath(TEST_DATA_DIR);  // Add location of test data
 
     return (isc::util::unittests::run_all());
 }