Browse Source

[3629] Removed reference to UnittestUtil::addDataPath from asiodns tests.

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.
Marcin Siodelski 10 years ago
parent
commit
7e7944df73
2 changed files with 1 additions and 6 deletions
  1. 0 3
      src/lib/asiodns/tests/Makefile.am
  2. 1 3
      src/lib/asiodns/tests/run_unittests.cc

+ 0 - 3
src/lib/asiodns/tests/Makefile.am

@@ -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

+ 1 - 3
src/lib/asiodns/tests/run_unittests.cc

@@ -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
@@ -16,14 +16,12 @@
 #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());
 }