From: Marcin Siodelski Date: Thu, 30 Oct 2014 19:22:07 +0000 (+0100) Subject: [3629] Removed reference to UnittestUtil::addDataPath from asiodns tests. X-Git-Tag: trac3631_base^2~1 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=7e7944df73d57b3ed89e8be99c0b3ab8ee5b5ee9;p=thirdparty%2Fkea.git [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. --- diff --git a/src/lib/asiodns/tests/Makefile.am b/src/lib/asiodns/tests/Makefile.am index 830b59de72..5adb6ff7df 100644 --- a/src/lib/asiodns/tests/Makefile.am +++ b/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 diff --git a/src/lib/asiodns/tests/run_unittests.cc b/src/lib/asiodns/tests/run_unittests.cc index 5cacdaf1c1..b6e36f42ae 100644 --- a/src/lib/asiodns/tests/run_unittests.cc +++ b/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 #include -#include 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()); }