Commit e3ab3986 authored by Stephen Morris's avatar Stephen Morris
Browse files

[trac542] Convert RUN_ALL_TESTS() to call to isc::util::unittest::run_all()

Also update the test Makefile.am files to include the appropriate libraries.
parent cba6db1c
...@@ -52,6 +52,9 @@ run_unittests_LDADD += $(top_builddir)/src/lib/xfr/libxfr.la ...@@ -52,6 +52,9 @@ run_unittests_LDADD += $(top_builddir)/src/lib/xfr/libxfr.la
run_unittests_LDADD += $(top_builddir)/src/lib/log/liblog.la run_unittests_LDADD += $(top_builddir)/src/lib/log/liblog.la
run_unittests_LDADD += $(top_builddir)/src/lib/server_common/libserver_common.la run_unittests_LDADD += $(top_builddir)/src/lib/server_common/libserver_common.la
run_unittests_LDADD += $(top_builddir)/src/lib/nsas/libnsas.la run_unittests_LDADD += $(top_builddir)/src/lib/nsas/libnsas.la
run_unittests_LDADD += $(top_builddir)/src/lib/util/unittests/libutil_unittests.la
run_unittests_LDADD += $(top_builddir)/src/lib/util/io/libutil_io.la
run_unittests_LDADD += $(top_builddir)/src/lib/util/libutil.la
endif endif
noinst_PROGRAMS = $(TESTS) noinst_PROGRAMS = $(TESTS)
...@@ -13,6 +13,7 @@ ...@@ -13,6 +13,7 @@
// PERFORMANCE OF THIS SOFTWARE. // PERFORMANCE OF THIS SOFTWARE.
#include <gtest/gtest.h> #include <gtest/gtest.h>
#include <util/unittests/run_all.h>
#include <dns/tests/unittest_util.h> #include <dns/tests/unittest_util.h>
...@@ -22,5 +23,5 @@ main(int argc, char* argv[]) { ...@@ -22,5 +23,5 @@ main(int argc, char* argv[]) {
isc::UnitTestUtil::addDataPath(TEST_DATA_DIR); isc::UnitTestUtil::addDataPath(TEST_DATA_DIR);
isc::UnitTestUtil::addDataPath(TEST_DATA_BUILDDIR); isc::UnitTestUtil::addDataPath(TEST_DATA_BUILDDIR);
return (RUN_ALL_TESTS()); return (isc::util::unittests::run_all());
} }
...@@ -42,6 +42,9 @@ run_unittests_LDADD += $(top_builddir)/src/lib/server_common/libserver_common.la ...@@ -42,6 +42,9 @@ run_unittests_LDADD += $(top_builddir)/src/lib/server_common/libserver_common.la
run_unittests_LDADD += $(top_builddir)/src/lib/cache/libcache.la run_unittests_LDADD += $(top_builddir)/src/lib/cache/libcache.la
run_unittests_LDADD += $(top_builddir)/src/lib/nsas/libnsas.la run_unittests_LDADD += $(top_builddir)/src/lib/nsas/libnsas.la
run_unittests_LDADD += $(top_builddir)/src/lib/resolve/libresolve.la run_unittests_LDADD += $(top_builddir)/src/lib/resolve/libresolve.la
run_unittests_LDADD += $(top_builddir)/src/lib/util/unittests/libutil_unittests.la
run_unittests_LDADD += $(top_builddir)/src/lib/util/io/libutil_io.la
run_unittests_LDADD += $(top_builddir)/src/lib/util/libutil.la
# Note the ordering matters: -Wno-... must follow -Wextra (defined in # Note the ordering matters: -Wno-... must follow -Wextra (defined in
# B10_CXXFLAGS # B10_CXXFLAGS
......
...@@ -13,6 +13,7 @@ ...@@ -13,6 +13,7 @@
// PERFORMANCE OF THIS SOFTWARE. // PERFORMANCE OF THIS SOFTWARE.
#include <gtest/gtest.h> #include <gtest/gtest.h>
#include <util/unittests/run_all.h>
#include <dns/tests/unittest_util.h> #include <dns/tests/unittest_util.h>
...@@ -22,5 +23,5 @@ main(int argc, char* argv[]) { ...@@ -22,5 +23,5 @@ main(int argc, char* argv[]) {
isc::UnitTestUtil::addDataPath(TEST_DATA_DIR); isc::UnitTestUtil::addDataPath(TEST_DATA_DIR);
isc::UnitTestUtil::addDataPath(TEST_DATA_BUILDDIR); isc::UnitTestUtil::addDataPath(TEST_DATA_BUILDDIR);
return (RUN_ALL_TESTS()); return (isc::util::unittests::run_all());
} }
...@@ -13,10 +13,11 @@ ...@@ -13,10 +13,11 @@
// PERFORMANCE OF THIS SOFTWARE. // PERFORMANCE OF THIS SOFTWARE.
#include <gtest/gtest.h> #include <gtest/gtest.h>
#include <util/unittests/run_all.h>
int int
main(int argc, char *argv[]) { main(int argc, char *argv[]) {
::testing::InitGoogleTest(&argc, argv); ::testing::InitGoogleTest(&argc, argv);
return RUN_ALL_TESTS(); return isc::util::unittests::run_all();
} }
SUBDIRS = exceptions util cryptolink dns cc config python xfr bench \ SUBDIRS = exceptions util log cryptolink dns cc config python xfr bench \
log asiolink asiodns nsas cache resolve testutils datasrc \ asiolink asiodns nsas cache resolve testutils datasrc \
server_common server_common
...@@ -27,6 +27,8 @@ run_unittests_CPPFLAGS = $(AM_CPPFLAGS) $(GTEST_INCLUDES) ...@@ -27,6 +27,8 @@ run_unittests_CPPFLAGS = $(AM_CPPFLAGS) $(GTEST_INCLUDES)
run_unittests_LDADD = $(GTEST_LDADD) run_unittests_LDADD = $(GTEST_LDADD)
run_unittests_LDADD += $(SQLITE_LIBS) run_unittests_LDADD += $(SQLITE_LIBS)
run_unittests_LDADD += $(top_builddir)/src/lib/dns/libdns++.la run_unittests_LDADD += $(top_builddir)/src/lib/dns/libdns++.la
run_unittests_LDADD += $(top_builddir)/src/lib/util/unittests/libutil_unittests.la
run_unittests_LDADD += $(top_builddir)/src/lib/util/io/libutil_io.la
run_unittests_LDADD += $(top_builddir)/src/lib/util/libutil.la run_unittests_LDADD += $(top_builddir)/src/lib/util/libutil.la
run_unittests_LDADD += $(top_builddir)/src/lib/asiolink/libasiolink.la run_unittests_LDADD += $(top_builddir)/src/lib/asiolink/libasiolink.la
run_unittests_LDADD += $(top_builddir)/src/lib/log/liblog.la run_unittests_LDADD += $(top_builddir)/src/lib/log/liblog.la
......
...@@ -13,6 +13,7 @@ ...@@ -13,6 +13,7 @@
// PERFORMANCE OF THIS SOFTWARE. // PERFORMANCE OF THIS SOFTWARE.
#include <gtest/gtest.h> #include <gtest/gtest.h>
#include <util/unittests/run_all.h>
#include <log/root_logger_name.h> #include <log/root_logger_name.h>
#include <dns/tests/unittest_util.h> #include <dns/tests/unittest_util.h>
...@@ -24,5 +25,5 @@ main(int argc, char* argv[]) ...@@ -24,5 +25,5 @@ main(int argc, char* argv[])
isc::log::setRootLoggerName("unittest"); // Set a root logger name isc::log::setRootLoggerName("unittest"); // Set a root logger name
isc::UnitTestUtil::addDataPath(TEST_DATA_DIR); // Add location of test data isc::UnitTestUtil::addDataPath(TEST_DATA_DIR); // Add location of test data
return (RUN_ALL_TESTS()); return (isc::util::unittests::run_all());
} }
...@@ -30,8 +30,10 @@ run_unittests_CPPFLAGS = $(AM_CPPFLAGS) $(GTEST_INCLUDES) ...@@ -30,8 +30,10 @@ run_unittests_CPPFLAGS = $(AM_CPPFLAGS) $(GTEST_INCLUDES)
run_unittests_LDADD = $(GTEST_LDADD) run_unittests_LDADD = $(GTEST_LDADD)
run_unittests_LDADD += $(SQLITE_LIBS) run_unittests_LDADD += $(SQLITE_LIBS)
run_unittests_LDADD += $(top_builddir)/src/lib/asiolink/libasiolink.la run_unittests_LDADD += $(top_builddir)/src/lib/asiolink/libasiolink.la
run_unittests_LDADD += $(top_builddir)/src/lib/util/libutil.la
run_unittests_LDADD += $(top_builddir)/src/lib/log/liblog.la run_unittests_LDADD += $(top_builddir)/src/lib/log/liblog.la
run_unittests_LDADD += $(top_builddir)/src/lib/util/unittests/libutil_unittests.la
run_unittests_LDADD += $(top_builddir)/src/lib/util/io/libutil_io.la
run_unittests_LDADD += $(top_builddir)/src/lib/util/libutil.la
run_unittests_LDADD += $(top_builddir)/src/lib/exceptions/libexceptions.la run_unittests_LDADD += $(top_builddir)/src/lib/exceptions/libexceptions.la
run_unittests_LDFLAGS = $(AM_LDFLAGS) $(GTEST_LDFLAGS) run_unittests_LDFLAGS = $(AM_LDFLAGS) $(GTEST_LDFLAGS)
......
...@@ -13,6 +13,7 @@ ...@@ -13,6 +13,7 @@
// PERFORMANCE OF THIS SOFTWARE. // PERFORMANCE OF THIS SOFTWARE.
#include <gtest/gtest.h> #include <gtest/gtest.h>
#include <util/unittests/run_all.h>
#include <log/root_logger_name.h> #include <log/root_logger_name.h>
#include <dns/tests/unittest_util.h> #include <dns/tests/unittest_util.h>
...@@ -23,5 +24,5 @@ main(int argc, char* argv[]) ...@@ -23,5 +24,5 @@ main(int argc, char* argv[])
::testing::InitGoogleTest(&argc, argv); // Initialize Google test ::testing::InitGoogleTest(&argc, argv); // Initialize Google test
isc::log::setRootLoggerName("unittest"); // Set a root logger name isc::log::setRootLoggerName("unittest"); // Set a root logger name
return (RUN_ALL_TESTS()); return (isc::util::unittests::run_all());
} }
...@@ -14,10 +14,12 @@ run_unittests_SOURCES += loadquery_unittest.cc ...@@ -14,10 +14,12 @@ run_unittests_SOURCES += loadquery_unittest.cc
run_unittests_CPPFLAGS = $(AM_CPPFLAGS) $(GTEST_INCLUDES) run_unittests_CPPFLAGS = $(AM_CPPFLAGS) $(GTEST_INCLUDES)
run_unittests_LDFLAGS = $(AM_LDFLAGS) $(GTEST_LDFLAGS) run_unittests_LDFLAGS = $(AM_LDFLAGS) $(GTEST_LDFLAGS)
run_unittests_LDADD = $(top_builddir)/src/lib/exceptions/libexceptions.la run_unittests_LDADD = $(top_builddir)/src/lib/bench/libbench.la
run_unittests_LDADD += $(top_builddir)/src/lib/dns/libdns++.la run_unittests_LDADD += $(top_builddir)/src/lib/dns/libdns++.la
run_unittests_LDADD += $(top_builddir)/src/lib/util/unittests/libutil_unittests.la
run_unittests_LDADD += $(top_builddir)/src/lib/util/io/libutil_io.la
run_unittests_LDADD += $(top_builddir)/src/lib/util/libutil.la run_unittests_LDADD += $(top_builddir)/src/lib/util/libutil.la
run_unittests_LDADD += $(top_builddir)/src/lib/bench/libbench.la run_unittests_LDADD += $(top_builddir)/src/lib/exceptions/libexceptions.la
run_unittests_LDADD += $(GTEST_LDADD) run_unittests_LDADD += $(GTEST_LDADD)
endif endif
......
...@@ -13,10 +13,11 @@ ...@@ -13,10 +13,11 @@
// PERFORMANCE OF THIS SOFTWARE. // PERFORMANCE OF THIS SOFTWARE.
#include <gtest/gtest.h> #include <gtest/gtest.h>
#include <util/unittests/run_all.h>
int int
main(int argc, char* argv[]) { main(int argc, char* argv[]) {
::testing::InitGoogleTest(&argc, argv); ::testing::InitGoogleTest(&argc, argv);
return (RUN_ALL_TESTS()); return (isc::util::unittests::run_all());
} }
...@@ -55,6 +55,8 @@ endif ...@@ -55,6 +55,8 @@ endif
run_unittests_LDADD += $(top_builddir)/src/lib/cache/libcache.la run_unittests_LDADD += $(top_builddir)/src/lib/cache/libcache.la
run_unittests_LDADD += $(top_builddir)/src/lib/nsas/libnsas.la run_unittests_LDADD += $(top_builddir)/src/lib/nsas/libnsas.la
run_unittests_LDADD += $(top_builddir)/src/lib/dns/libdns++.la run_unittests_LDADD += $(top_builddir)/src/lib/dns/libdns++.la
run_unittests_LDADD += $(top_builddir)/src/lib/util/unittests/libutil_unittests.la
run_unittests_LDADD += $(top_builddir)/src/lib/util/io/libutil_io.la
run_unittests_LDADD += $(top_builddir)/src/lib/util/libutil.la run_unittests_LDADD += $(top_builddir)/src/lib/util/libutil.la
run_unittests_LDADD += $(top_builddir)/src/lib/asiolink/libasiolink.la run_unittests_LDADD += $(top_builddir)/src/lib/asiolink/libasiolink.la
run_unittests_LDADD += $(top_builddir)/src/lib/exceptions/libexceptions.la run_unittests_LDADD += $(top_builddir)/src/lib/exceptions/libexceptions.la
......
...@@ -15,6 +15,7 @@ ...@@ -15,6 +15,7 @@
#include <config.h> #include <config.h>
#include <gtest/gtest.h> #include <gtest/gtest.h>
#include <util/unittests/run_all.h>
#include <dns/tests/unittest_util.h> #include <dns/tests/unittest_util.h>
...@@ -24,5 +25,5 @@ main(int argc, char* argv[]) { ...@@ -24,5 +25,5 @@ main(int argc, char* argv[]) {
isc::UnitTestUtil::addDataPath(TEST_DATA_SRCDIR); isc::UnitTestUtil::addDataPath(TEST_DATA_SRCDIR);
isc::UnitTestUtil::addDataPath(TEST_DATA_BUILDDIR); isc::UnitTestUtil::addDataPath(TEST_DATA_BUILDDIR);
return (RUN_ALL_TESTS()); return (isc::util::unittests::run_all());
} }
...@@ -26,6 +26,9 @@ run_unittests_LDFLAGS = $(AM_LDFLAGS) $(GTEST_LDFLAGS) ...@@ -26,6 +26,9 @@ run_unittests_LDFLAGS = $(AM_LDFLAGS) $(GTEST_LDFLAGS)
run_unittests_LDADD = $(GTEST_LDADD) run_unittests_LDADD = $(GTEST_LDADD)
run_unittests_LDADD += $(top_builddir)/src/lib/cc/libcc.la run_unittests_LDADD += $(top_builddir)/src/lib/cc/libcc.la
run_unittests_LDADD += $(top_builddir)/src/lib/util/unittests/libutil_unittests.la
run_unittests_LDADD += $(top_builddir)/src/lib/util/io/libutil_io.la
run_unittests_LDADD += $(top_builddir)/src/lib/util/libutil.la
run_unittests_LDADD += $(top_builddir)/src/lib/exceptions/libexceptions.la run_unittests_LDADD += $(top_builddir)/src/lib/exceptions/libexceptions.la
endif endif
......
...@@ -13,9 +13,10 @@ ...@@ -13,9 +13,10 @@
// PERFORMANCE OF THIS SOFTWARE. // PERFORMANCE OF THIS SOFTWARE.
#include <gtest/gtest.h> #include <gtest/gtest.h>
#include <util/unittests/run_all.h>
int int
main(int argc, char* argv[]) { main(int argc, char* argv[]) {
::testing::InitGoogleTest(&argc, argv); ::testing::InitGoogleTest(&argc, argv);
return (RUN_ALL_TESTS()); return (isc::util::unittests::run_all());
} }
...@@ -23,6 +23,9 @@ run_unittests_CPPFLAGS = $(AM_CPPFLAGS) $(GTEST_INCLUDES) ...@@ -23,6 +23,9 @@ run_unittests_CPPFLAGS = $(AM_CPPFLAGS) $(GTEST_INCLUDES)
run_unittests_LDFLAGS = $(AM_LDFLAGS) $(GTEST_LDFLAGS) run_unittests_LDFLAGS = $(AM_LDFLAGS) $(GTEST_LDFLAGS)
run_unittests_LDADD = $(GTEST_LDADD) run_unittests_LDADD = $(GTEST_LDADD)
run_unittests_LDADD += $(top_builddir)/src/lib/cc/libcc.la run_unittests_LDADD += $(top_builddir)/src/lib/cc/libcc.la
run_unittests_LDADD += $(top_builddir)/src/lib/util/unittests/libutil_unittests.la
run_unittests_LDADD += $(top_builddir)/src/lib/util/io/libutil_io.la
run_unittests_LDADD += $(top_builddir)/src/lib/util/libutil.la
run_unittests_LDADD += $(top_builddir)/src/lib/exceptions/libexceptions.la run_unittests_LDADD += $(top_builddir)/src/lib/exceptions/libexceptions.la
run_unittests_LDADD += libfake_session.la run_unittests_LDADD += libfake_session.la
run_unittests_LDADD += $(top_builddir)/src/lib/config/libcfgclient.la run_unittests_LDADD += $(top_builddir)/src/lib/config/libcfgclient.la
......
...@@ -13,9 +13,10 @@ ...@@ -13,9 +13,10 @@
// PERFORMANCE OF THIS SOFTWARE. // PERFORMANCE OF THIS SOFTWARE.
#include <gtest/gtest.h> #include <gtest/gtest.h>
#include <util/unittests/run_all.h>
int int
main(int argc, char* argv[]) { main(int argc, char* argv[]) {
::testing::InitGoogleTest(&argc, argv); ::testing::InitGoogleTest(&argc, argv);
return (RUN_ALL_TESTS()); return (isc::util::unittests::run_all());
} }
...@@ -19,6 +19,8 @@ run_unittests_CPPFLAGS = $(AM_CPPFLAGS) $(GTEST_INCLUDES) ...@@ -19,6 +19,8 @@ run_unittests_CPPFLAGS = $(AM_CPPFLAGS) $(GTEST_INCLUDES)
run_unittests_LDFLAGS = $(AM_LDFLAGS) $(GTEST_LDFLAGS) run_unittests_LDFLAGS = $(AM_LDFLAGS) $(GTEST_LDFLAGS)
run_unittests_LDADD = $(GTEST_LDADD) run_unittests_LDADD = $(GTEST_LDADD)
run_unittests_LDADD += $(top_builddir)/src/lib/cryptolink/libcryptolink.la run_unittests_LDADD += $(top_builddir)/src/lib/cryptolink/libcryptolink.la
run_unittests_LDADD += $(top_builddir)/src/lib/util/unittests/libutil_unittests.la
run_unittests_LDADD += $(top_builddir)/src/lib/util/io/libutil_io.la
run_unittests_LDADD += $(top_builddir)/src/lib/util/libutil.la run_unittests_LDADD += $(top_builddir)/src/lib/util/libutil.la
run_unittests_LDADD += $(top_builddir)/src/lib/exceptions/libexceptions.la run_unittests_LDADD += $(top_builddir)/src/lib/exceptions/libexceptions.la
endif endif
......
...@@ -13,10 +13,11 @@ ...@@ -13,10 +13,11 @@
// PERFORMANCE OF THIS SOFTWARE. // PERFORMANCE OF THIS SOFTWARE.
#include <gtest/gtest.h> #include <gtest/gtest.h>
#include <util/unittests/run_all.h>
int int
main(int argc, char* argv[]) { main(int argc, char* argv[]) {
::testing::InitGoogleTest(&argc, argv); ::testing::InitGoogleTest(&argc, argv);
return (RUN_ALL_TESTS()); return (isc::util::unittests::run_all());
} }
Markdown is supported
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