Commit 7e7944df authored by Marcin Siodelski's avatar Marcin Siodelski
Browse files

[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.
parent 8744ddae
...@@ -4,7 +4,6 @@ AM_CPPFLAGS = -I$(top_srcdir)/src/lib -I$(top_builddir)/src/lib ...@@ -4,7 +4,6 @@ AM_CPPFLAGS = -I$(top_srcdir)/src/lib -I$(top_builddir)/src/lib
AM_CPPFLAGS += $(BOOST_INCLUDES) AM_CPPFLAGS += $(BOOST_INCLUDES)
AM_CPPFLAGS += -I$(top_builddir)/src/lib/dns -I$(top_srcdir)/src/bin 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 += -I$(top_builddir)/src/lib/cc -I$(top_builddir)/src/lib/util
AM_CPPFLAGS += -DTEST_DATA_DIR=\"$(srcdir)/testdata\"
AM_CXXFLAGS = $(KEA_CXXFLAGS) AM_CXXFLAGS = $(KEA_CXXFLAGS)
...@@ -21,8 +20,6 @@ TESTS = ...@@ -21,8 +20,6 @@ TESTS =
if HAVE_GTEST if HAVE_GTEST
TESTS += run_unittests TESTS += run_unittests
run_unittests_SOURCES = run_unittests.cc 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_service_unittest.cc
run_unittests_SOURCES += dns_server_unittest.cc run_unittests_SOURCES += dns_server_unittest.cc
run_unittests_SOURCES += io_fetch_unittest.cc run_unittests_SOURCES += io_fetch_unittest.cc
......
// 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 // Permission to use, copy, modify, and/or distribute this software for any
// purpose with or without fee is hereby granted, provided that the above // purpose with or without fee is hereby granted, provided that the above
...@@ -16,14 +16,12 @@ ...@@ -16,14 +16,12 @@
#include <util/unittests/run_all.h> #include <util/unittests/run_all.h>
#include <log/logger_support.h> #include <log/logger_support.h>
#include <dns/tests/unittest_util.h>
int int
main(int argc, char* argv[]) main(int argc, char* argv[])
{ {
::testing::InitGoogleTest(&argc, argv); // Initialize Google test ::testing::InitGoogleTest(&argc, argv); // Initialize Google test
isc::log::initLogger(); // Initialize logging isc::log::initLogger(); // Initialize logging
isc::UnitTestUtil::addDataPath(TEST_DATA_DIR); // Add location of test data
return (isc::util::unittests::run_all()); return (isc::util::unittests::run_all());
} }
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment