update header files in tests

Change-Id: Ibfffb9367349f58eeb193350bad34fdfccd8c553
diff --git a/tests/boost-multi-log-formatter.hpp b/tests/boost-multi-log-formatter.hpp
deleted file mode 100644
index ae37416..0000000
--- a/tests/boost-multi-log-formatter.hpp
+++ /dev/null
@@ -1,214 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2015 Regents of the University of California.
- *
- * Based on work by Martin Ba (http://stackoverflow.com/a/26718189)
- *
- * This file is distributed under the Boost Software License, Version 1.0.
- * (See http://www.boost.org/LICENSE_1_0.txt)
- */
-
-#ifndef NDN_TESTS_BOOST_MULTI_LOG_FORMATTER_HPP
-#define NDN_TESTS_BOOST_MULTI_LOG_FORMATTER_HPP
-
-#include <boost/version.hpp>
-
-#if BOOST_VERSION >= 105900
-#include <boost/test/unit_test_parameters.hpp>
-#else
-#include <boost/test/detail/unit_test_parameters.hpp>
-#endif // BOOST_VERSION >= 105900
-
-#include <boost/test/unit_test_log_formatter.hpp>
-#include <boost/test/output/compiler_log_formatter.hpp>
-#include <boost/test/output/xml_log_formatter.hpp>
-
-namespace boost {
-namespace unit_test {
-namespace output {
-
-/**
- * @brief Log formatter for Boost.Test that outputs the logging to multiple formatters
- *
- * The log formatter is designed to output to one or multiple formatters at the same time.  For
- * example, one HRF formatter can output to the standard output, while XML formatter output to
- * the file.
- *
- * Usage:
- *
- *     // Call in init_unit_test_suite: (this will override the --log_format parameter)
- *     auto formatter = new boost::unit_test::output::multi_log_formatter; // same as already configured logger
- *
- *     // Prepare and add additional logger(s)
- *     formatter.add(std::make_shared<boost::unit_test::output::xml_log_formatter>(),
- *                   std::make_shared<std::ofstream>("out.xml"));
- *
- *      boost::unit_test::unit_test_log.set_formatter(formatter);
- *
- * @note Calling `boost::unit_test::unit_test_log.set_stream(...)` will change the stream for
- *       the original logger.
- */
-class multi_log_formatter : public unit_test_log_formatter
-{
-public:
-  /**
-   * @brief Create instance of the logger, based on the configured logger instance
-   */
-  multi_log_formatter()
-  {
-    auto format =
-#if BOOST_VERSION > 105900
-      runtime_config::get<output_format>(runtime_config::LOG_FORMAT);
-#else
-      runtime_config::log_format();
-#endif // BOOST_VERSION > 105900
-
-    switch (format) {
-      default:
-#if BOOST_VERSION >= 105900
-      case OF_CLF:
-#else
-      case CLF:
-#endif // BOOST_VERSION >= 105900
-        m_loggers.push_back({std::make_shared<compiler_log_formatter>(), nullptr});
-        break;
-#if BOOST_VERSION >= 105900
-      case OF_XML:
-#else
-      case XML:
-#endif // BOOST_VERSION >= 105900
-        m_loggers.push_back({std::make_shared<xml_log_formatter>(), nullptr});
-        break;
-    }
-  }
-
-  void
-  add(std::shared_ptr<unit_test_log_formatter> formatter, std::shared_ptr<std::ostream> os)
-  {
-    m_loggers.push_back({formatter, os});
-  }
-
-  // Formatter interface
-  void
-  log_start(std::ostream& os, counter_t test_cases_amount)
-  {
-    for (auto& l : m_loggers)
-      l.logger->log_start(l.os == nullptr ? os : *l.os, test_cases_amount);
-  }
-
-  void
-  log_finish(std::ostream& os)
-  {
-    for (auto& l : m_loggers)
-      l.logger->log_finish(l.os == nullptr ? os : *l.os);
-  }
-
-  void
-  log_build_info(std::ostream& os)
-  {
-    for (auto& l : m_loggers)
-      l.logger->log_build_info(l.os == nullptr ? os : *l.os);
-  }
-
-  void
-  test_unit_start(std::ostream& os, const test_unit& tu)
-  {
-    for (auto& l : m_loggers)
-      l.logger->test_unit_start(l.os == nullptr ? os : *l.os, tu);
-  }
-
-  void
-  test_unit_finish(std::ostream& os, const test_unit& tu, unsigned long elapsed)
-  {
-    for (auto& l : m_loggers)
-      l.logger->test_unit_finish(l.os == nullptr ? os : *l.os, tu, elapsed);
-  }
-
-  void
-  test_unit_skipped(std::ostream& os, const test_unit& tu)
-  {
-    for (auto& l : m_loggers)
-      l.logger->test_unit_skipped(l.os == nullptr ? os : *l.os, tu);
-  }
-
-#if BOOST_VERSION >= 105900
-  void
-  log_exception_start(std::ostream& os, const log_checkpoint_data& lcd, const execution_exception& ex)
-  {
-    for (auto& l : m_loggers)
-      l.logger->log_exception_start(l.os == nullptr ? os : *l.os, lcd, ex);
-  }
-
-  void
-  log_exception_finish(std::ostream& os)
-  {
-    for (auto& l : m_loggers)
-      l.logger->log_exception_finish(l.os == nullptr ? os : *l.os);
-  }
-#else
-  void
-  log_exception(std::ostream& os, const log_checkpoint_data& lcd, const execution_exception& ex)
-  {
-    for (auto& l : m_loggers)
-      l.logger->log_exception(l.os == nullptr ? os : *l.os, lcd, ex);
-  }
-#endif // BOOST_VERSION >= 105900
-
-  void
-  log_entry_start(std::ostream& os, const log_entry_data& entry_data, log_entry_types let)
-  {
-    for (auto& l : m_loggers)
-      l.logger->log_entry_start(l.os == nullptr ? os : *l.os, entry_data, let);
-  }
-
-  void
-  log_entry_value(std::ostream& os, const_string value)
-  {
-    for (auto& l : m_loggers)
-      l.logger->log_entry_value(l.os == nullptr ? os : *l.os, value);
-  }
-
-  void
-  log_entry_finish(std::ostream& os)
-  {
-    for (auto& l : m_loggers)
-      l.logger->log_entry_finish(l.os == nullptr ? os : *l.os);
-  }
-
-#if BOOST_VERSION >= 105900
-  void
-  entry_context_start(std::ostream& os, log_level level)
-  {
-    for (auto& l : m_loggers)
-      l.logger->entry_context_start(l.os == nullptr ? os : *l.os, level);
-  }
-
-  void
-  log_entry_context(std::ostream& os, const_string value)
-  {
-    for (auto& l : m_loggers)
-      l.logger->log_entry_context(l.os == nullptr ? os : *l.os, value);
-  }
-
-  void
-  entry_context_finish(std::ostream& os)
-  {
-    for (auto& l : m_loggers)
-      l.logger->entry_context_finish(l.os == nullptr ? os : *l.os);
-  }
-#endif // BOOST_VERSION >= 105900
-
-private:
-  struct LoggerInfo
-  {
-    std::shared_ptr<unit_test_log_formatter> logger;
-    std::shared_ptr<std::ostream> os;
-  };
-  std::vector<LoggerInfo> m_loggers;
-};
-
-} // namespace output
-} // namespace unit_test
-} // namespace boost
-
-#endif // NDN_TESTS_BOOST_MULTI_LOG_FORMATTER_HPP
diff --git a/tests/database-fixture.hpp b/tests/database-fixture.hpp
index c7e04bb..4223c98 100644
--- a/tests/database-fixture.hpp
+++ b/tests/database-fixture.hpp
@@ -23,12 +23,18 @@
 #define NDNCERT_TESTS_DATABASE_FIXTURE_HPP
 
 #include "identity-management-fixture.hpp"
+#include "unit-test-time-fixture.hpp"
 #include <boost/filesystem.hpp>
 
 namespace ndn {
 namespace ndncert {
 namespace tests {
 
+class IdentityManagementTimeFixture : public UnitTestTimeFixture
+                                    , public IdentityManagementFixture
+{
+};
+
 class DatabaseFixture : public IdentityManagementTimeFixture
 {
 public:
diff --git a/tests/global-configuration.cpp b/tests/global-configuration.cpp
new file mode 100644
index 0000000..0a76e0f
--- /dev/null
+++ b/tests/global-configuration.cpp
@@ -0,0 +1,70 @@
+/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
+/**
+ * Copyright (c) 2017-2020, Regents of the University of California.
+ *
+ * This file is part of ndncert, a certificate management system based on NDN.
+ *
+ * ndncert is free software: you can redistribute it and/or modify it under the terms
+ * of the GNU General Public License as published by the Free Software Foundation, either
+ * version 3 of the License, or (at your option) any later version.
+ *
+ * ndncert is distributed in the hope that it will be useful, but WITHOUT ANY
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+ * PARTICULAR PURPOSE.  See the GNU General Public License for more details.
+ *
+ * You should have received copies of the GNU General Public License along with
+ * ndncert, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ * See AUTHORS.md for complete list of ndncert authors and contributors.
+ */
+
+#include "boost-test.hpp"
+
+#include <boost/filesystem.hpp>
+#include <fstream>
+#include <stdlib.h>
+
+namespace ndn {
+namespace ndncert {
+namespace tests {
+
+class GlobalConfiguration
+{
+public:
+  GlobalConfiguration()
+  {
+    const char* envHome = ::getenv("HOME");
+    if (envHome)
+      m_home = envHome;
+
+    boost::filesystem::path dir{TMP_TESTS_PATH};
+    dir /= "test-home";
+    ::setenv("HOME", dir.c_str(), 1);
+
+    boost::filesystem::create_directories(dir);
+    std::ofstream clientConf((dir / ".ndn" / "client.conf").c_str());
+    clientConf << "pib=pib-sqlite3" << std::endl
+               << "tpm=tpm-file" << std::endl;
+  }
+
+  ~GlobalConfiguration()
+  {
+    if (!m_home.empty())
+      ::setenv("HOME", m_home.data(), 1);
+  }
+
+private:
+  std::string m_home;
+};
+
+#if BOOST_VERSION >= 106500
+BOOST_TEST_GLOBAL_CONFIGURATION(GlobalConfiguration);
+#elif BOOST_VERSION >= 105900
+BOOST_GLOBAL_FIXTURE(GlobalConfiguration);
+#else
+BOOST_GLOBAL_FIXTURE(GlobalConfiguration)
+#endif
+
+} // namespace tests
+} // namespace ndncert
+} // namespace ndn
\ No newline at end of file
diff --git a/tests/identity-management-fixture.cpp b/tests/identity-management-fixture.cpp
index 1694dfa..56f445e 100644
--- a/tests/identity-management-fixture.cpp
+++ b/tests/identity-management-fixture.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2013-2020 Regents of the University of California.
+ * Copyright (c) 2013-2018 Regents of the University of California.
  *
  * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
  *
@@ -20,6 +20,7 @@
  */
 
 #include "identity-management-fixture.hpp"
+
 #include <ndn-cxx/security/v2/additional-description.hpp>
 #include <ndn-cxx/util/io.hpp>
 #include <boost/filesystem.hpp>
diff --git a/tests/identity-management-fixture.hpp b/tests/identity-management-fixture.hpp
index 2f25cbe..0400553 100644
--- a/tests/identity-management-fixture.hpp
+++ b/tests/identity-management-fixture.hpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2013-2020 Regents of the University of California.
+ * Copyright (c) 2013-2018 Regents of the University of California.
  *
  * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
  *
@@ -22,10 +22,7 @@
 #ifndef NDN_TESTS_IDENTITY_MANAGEMENT_FIXTURE_HPP
 #define NDN_TESTS_IDENTITY_MANAGEMENT_FIXTURE_HPP
 
-#include "test-home-fixture.hpp"
-#include "unit-test-time-fixture.hpp"
-#include "boost-test.hpp"
-#include <ndn-cxx/security/key-chain.hpp>
+#include <ndn-cxx/security/v2/key-chain.hpp>
 #include <ndn-cxx/security/signing-helpers.hpp>
 #include <vector>
 
@@ -33,7 +30,7 @@
 namespace ndncert {
 namespace tests {
 
-class IdentityManagementBaseFixture : public TestHomeFixture<DefaultPibDir>
+class IdentityManagementBaseFixture
 {
 public:
   ~IdentityManagementBaseFixture();
@@ -97,11 +94,6 @@
   KeyChain m_keyChain;
 };
 
-class IdentityManagementTimeFixture : public UnitTestTimeFixture
-                                    , public IdentityManagementFixture
-{
-};
-
 } // namespace tests
 } // namespace ndncert
 } // namespace ndn
diff --git a/tests/main.cpp b/tests/main.cpp
index 72ad856..7e723b8 100644
--- a/tests/main.cpp
+++ b/tests/main.cpp
@@ -25,92 +25,5 @@
  * See AUTHORS.md for complete list of ndncert authors and contributors.
  */
 
-#define BOOST_TEST_MODULE NDNCERT Unit Tests
-
-#include <boost/version.hpp>
-
-#if BOOST_VERSION >= 106200
-// Boost.Test v3.3 (Boost 1.62) natively supports multi-logger output
-#include "boost-test.hpp"
-#else
-#define BOOST_TEST_ALTERNATIVE_INIT_API
-#define BOOST_TEST_NO_MAIN
-#include "boost-test.hpp"
-#include "boost-multi-log-formatter.hpp"
-
-#include <boost/program_options/options_description.hpp>
-#include <boost/program_options/variables_map.hpp>
-#include <boost/program_options/parsers.hpp>
-
-#include <fstream>
-#include <iostream>
-
-static bool
-init_tests()
-{
-  init_unit_test();
-
-  namespace po = boost::program_options;
-  namespace ut = boost::unit_test;
-
-  po::options_description extraOptions;
-  std::string logger;
-  std::string outputFile = "-";
-  extraOptions.add_options()
-    ("log_format2", po::value<std::string>(&logger), "Type of second log formatter: HRF or XML")
-    ("log_sink2", po::value<std::string>(&outputFile)->default_value(outputFile), "Second log sink, - for stdout")
-    ;
-  po::variables_map vm;
-  try {
-    po::store(po::command_line_parser(ut::framework::master_test_suite().argc,
-                                      ut::framework::master_test_suite().argv)
-                .options(extraOptions)
-                .run(),
-              vm);
-    po::notify(vm);
-  }
-  catch (const std::exception& e) {
-    std::cerr << "ERROR: " << e.what() << "\n"
-              << extraOptions << std::endl;
-    return false;
-  }
-
-  if (vm.count("log_format2") == 0) {
-    // second logger is not configured
-    return true;
-  }
-
-  std::shared_ptr<ut::unit_test_log_formatter> formatter;
-  if (logger == "XML") {
-    formatter = std::make_shared<ut::output::xml_log_formatter>();
-  }
-  else if (logger == "HRF") {
-    formatter = std::make_shared<ut::output::compiler_log_formatter>();
-  }
-  else {
-    std::cerr << "ERROR: only HRF or XML log formatter can be specified" << std::endl;
-    return false;
-  }
-
-  std::shared_ptr<std::ostream> output;
-  if (outputFile == "-") {
-    output = std::shared_ptr<std::ostream>(&std::cout, std::bind([]{}));
-  }
-  else {
-    output = std::make_shared<std::ofstream>(outputFile.c_str());
-  }
-
-  auto multiFormatter = new ut::output::multi_log_formatter;
-  multiFormatter->add(formatter, output);
-  ut::unit_test_log.set_formatter(multiFormatter);
-
-  return true;
-}
-
-int
-main(int argc, char* argv[])
-{
-  return ::boost::unit_test::unit_test_main(&init_tests, argc, argv);
-}
-
-#endif // BOOST_VERSION >= 106200
+#define BOOST_TEST_MODULE ndncert
+#include "boost-test.hpp"
\ No newline at end of file
diff --git a/tests/test-common.hpp b/tests/test-common.hpp
new file mode 100644
index 0000000..7039e83
--- /dev/null
+++ b/tests/test-common.hpp
@@ -0,0 +1,40 @@
+/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
+/*
+ * Copyright (c) 2013-2019 Regents of the University of California.
+ *
+ * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
+ *
+ * ndn-cxx library is free software: you can redistribute it and/or modify it under the
+ * terms of the GNU Lesser General Public License as published by the Free Software
+ * Foundation, either version 3 of the License, or (at your option) any later version.
+ *
+ * ndn-cxx library is distributed in the hope that it will be useful, but WITHOUT ANY
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+ * PARTICULAR PURPOSE.  See the GNU Lesser General Public License for more details.
+ *
+ * You should have received copies of the GNU General Public License and GNU Lesser
+ * General Public License along with ndn-cxx, e.g., in COPYING.md file.  If not, see
+ * <http://www.gnu.org/licenses/>.
+ *
+ * See AUTHORS.md for complete list of ndn-cxx authors and contributors.
+ */
+
+#ifndef NDNCERT_TESTS_COMMON_HPP
+#define NDNCERT_TESTS_COMMON_HPP
+
+#include <iostream>
+#include <ndn-cxx/metadata-object.hpp>
+#include <ndn-cxx/security/signing-helpers.hpp>
+#include <ndn-cxx/security/transform/base64-encode.hpp>
+#include <ndn-cxx/security/transform/buffer-source.hpp>
+#include <ndn-cxx/security/transform/public-key.hpp>
+#include <ndn-cxx/security/transform/stream-sink.hpp>
+#include <ndn-cxx/security/verification-helpers.hpp>
+#include <ndn-cxx/util/dummy-client-face.hpp>
+
+#include "boost-test.hpp"
+#include "database-fixture.hpp"
+#include "identity-management-fixture.hpp"
+#include "unit-test-time-fixture.hpp"
+
+#endif  // NDNCERT_TESTS_COMMON_HPP
diff --git a/tests/test-home-fixture.hpp b/tests/test-home-fixture.hpp
deleted file mode 100644
index 229f642..0000000
--- a/tests/test-home-fixture.hpp
+++ /dev/null
@@ -1,78 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/*
- * Copyright (c) 2013-2020 Regents of the University of California.
- *
- * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
- *
- * ndn-cxx library is free software: you can redistribute it and/or modify it under the
- * terms of the GNU Lesser General Public License as published by the Free Software
- * Foundation, either version 3 of the License, or (at your option) any later version.
- *
- * ndn-cxx library is distributed in the hope that it will be useful, but WITHOUT ANY
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
- * PARTICULAR PURPOSE.  See the GNU Lesser General Public License for more details.
- *
- * You should have received copies of the GNU General Public License and GNU Lesser
- * General Public License along with ndn-cxx, e.g., in COPYING.md file.  If not, see
- * <http://www.gnu.org/licenses/>.
- *
- * See AUTHORS.md for complete list of ndn-cxx authors and contributors.
- */
-
-#ifndef NDN_TESTS_TEST_HOME_FIXTURE_HPP
-#define NDN_TESTS_TEST_HOME_FIXTURE_HPP
-
-#include <ndn-cxx/security/key-chain.hpp>
-#include <cstdlib>
-#include <fstream>
-#include <initializer_list>
-#include <boost/algorithm/string.hpp>
-#include <boost/filesystem.hpp>
-
-namespace ndn {
-namespace ndncert {
-namespace tests {
-
-/**
- * @brief TestHomeFixture to set TEST_HOME variable and allow config file creation
- */
-template<class Path>
-class TestHomeFixture
-{
-public:
-  TestHomeFixture()
-    : m_testHomeDir(Path().PATH)
-  {
-    setenv("TEST_HOME", m_testHomeDir.c_str(), true);
-  }
-
-  ~TestHomeFixture()
-  {
-    unsetenv("TEST_HOME");
-  }
-
-  void
-  createClientConf(std::initializer_list<std::string> lines) const
-  {
-    boost::filesystem::create_directories(boost::filesystem::path(m_testHomeDir) / ".ndn");
-    std::ofstream of((boost::filesystem::path(m_testHomeDir) / ".ndn" / "client.conf").c_str());
-    for (auto line : lines) {
-      boost::replace_all(line, "%PATH%", m_testHomeDir);
-      of << line << std::endl;
-    }
-  }
-
-protected:
-  std::string m_testHomeDir;
-};
-
-struct DefaultPibDir
-{
-  const std::string PATH = "build/keys";
-};
-
-} // namespace tests
-} // namespace ndncert
-} // namespace ndn
-
-#endif // NDN_TESTS_TEST_HOME_FIXTURE_HPP
diff --git a/tests/unit-tests/bench.t.cpp b/tests/unit-tests/bench.t.cpp
index 038e97b..46b56ef 100644
--- a/tests/unit-tests/bench.t.cpp
+++ b/tests/unit-tests/bench.t.cpp
@@ -19,17 +19,10 @@
  */
 
 #include "ca-module.hpp"
-#include "identity-management-fixture.hpp"
 #include "client-module.hpp"
 #include "challenge-module/challenge-pin.hpp"
 #include "protocol-detail/info.hpp"
-
-#include <ndn-cxx/util/dummy-client-face.hpp>
-#include <ndn-cxx/security/signing-helpers.hpp>
-#include <ndn-cxx/security/transform/public-key.hpp>
-#include <ndn-cxx/security/verification-helpers.hpp>
-#include <ndn-cxx/metadata-object.hpp>
-#include <iostream>
+#include "test-common.hpp"
 
 namespace ndn {
 namespace ndncert {
diff --git a/tests/unit-tests/ca-config.t.cpp b/tests/unit-tests/ca-config.t.cpp
index 0de626b..0538cd8 100644
--- a/tests/unit-tests/ca-config.t.cpp
+++ b/tests/unit-tests/ca-config.t.cpp
@@ -20,11 +20,7 @@
 
 #include "ca-config.hpp"
 #include "protocol-detail/info.hpp"
-#include "identity-management-fixture.hpp"
-
-#include <ndn-cxx/security/transform/base64-encode.hpp>
-#include <ndn-cxx/security/transform/buffer-source.hpp>
-#include <ndn-cxx/security/transform/stream-sink.hpp>
+#include "test-common.hpp"
 
 namespace ndn {
 namespace ndncert {
diff --git a/tests/unit-tests/ca-memory.t.cpp b/tests/unit-tests/ca-memory.t.cpp
index c64d8f7..7425a0e 100644
--- a/tests/unit-tests/ca-memory.t.cpp
+++ b/tests/unit-tests/ca-memory.t.cpp
@@ -19,8 +19,8 @@
  */
 
 #include "ca-detail/ca-memory.hpp"
-#include "identity-management-fixture.hpp"
 #include "ca-detail/ca-sqlite.hpp"
+#include "test-common.hpp"
 
 namespace ndn {
 namespace ndncert {
diff --git a/tests/unit-tests/ca-module.t.cpp b/tests/unit-tests/ca-module.t.cpp
index 095ac19..40cb3d6 100644
--- a/tests/unit-tests/ca-module.t.cpp
+++ b/tests/unit-tests/ca-module.t.cpp
@@ -23,13 +23,8 @@
 #include "challenge-module/challenge-email.hpp"
 #include "challenge-module/challenge-pin.hpp"
 #include "client-module.hpp"
-#include "database-fixture.hpp"
 #include "protocol-detail/info.hpp"
-
-#include <ndn-cxx/security/signing-helpers.hpp>
-#include <ndn-cxx/security/transform/public-key.hpp>
-#include <ndn-cxx/security/verification-helpers.hpp>
-#include <ndn-cxx/util/dummy-client-face.hpp>
+#include "test-common.hpp"
 
 namespace ndn {
 namespace ndncert {
diff --git a/tests/unit-tests/ca-sqlite.t.cpp b/tests/unit-tests/ca-sqlite.t.cpp
index f47bf9d..07782a6 100644
--- a/tests/unit-tests/ca-sqlite.t.cpp
+++ b/tests/unit-tests/ca-sqlite.t.cpp
@@ -19,8 +19,7 @@
  */
 
 #include "ca-detail/ca-sqlite.hpp"
-
-#include "database-fixture.hpp"
+#include "test-common.hpp"
 
 namespace ndn {
 namespace ndncert {
diff --git a/tests/unit-tests/challenge-credential.t.cpp b/tests/unit-tests/challenge-credential.t.cpp
index 9072fa0..566ffd8 100644
--- a/tests/unit-tests/challenge-credential.t.cpp
+++ b/tests/unit-tests/challenge-credential.t.cpp
@@ -19,7 +19,7 @@
  */
 
 #include "challenge-module/challenge-credential.hpp"
-#include "identity-management-fixture.hpp"
+#include "test-common.hpp"
 #include <ndn-cxx/security/signing-helpers.hpp>
 #include <ndn-cxx/util/io.hpp>
 
@@ -101,6 +101,6 @@
 
 BOOST_AUTO_TEST_SUITE_END()
 
-} // namespace tests
-} // namespace ndncert
-} // namespace ndn
+}  // namespace tests
+}  // namespace ndncert
+}  // namespace ndn
diff --git a/tests/unit-tests/challenge-email.t.cpp b/tests/unit-tests/challenge-email.t.cpp
index 834411d..8ff47c4 100644
--- a/tests/unit-tests/challenge-email.t.cpp
+++ b/tests/unit-tests/challenge-email.t.cpp
@@ -19,8 +19,7 @@
  */
 
 #include "challenge-module/challenge-email.hpp"
-
-#include "identity-management-fixture.hpp"
+#include "test-common.hpp"
 
 namespace ndn {
 namespace ndncert {
diff --git a/tests/unit-tests/challenge-pin.t.cpp b/tests/unit-tests/challenge-pin.t.cpp
index 81ee1e1..a1fea0d 100644
--- a/tests/unit-tests/challenge-pin.t.cpp
+++ b/tests/unit-tests/challenge-pin.t.cpp
@@ -19,8 +19,7 @@
  */
 
 #include "challenge-module/challenge-pin.hpp"
-
-#include "identity-management-fixture.hpp"
+#include "test-common.hpp"
 
 namespace ndn {
 namespace ndncert {
diff --git a/tests/unit-tests/client-config.t.cpp b/tests/unit-tests/client-config.t.cpp
index 8aabcab..f23f502 100644
--- a/tests/unit-tests/client-config.t.cpp
+++ b/tests/unit-tests/client-config.t.cpp
@@ -19,8 +19,7 @@
  */
 
 #include "client-config.hpp"
-
-#include "boost-test.hpp"
+#include "test-common.hpp"
 
 namespace ndn {
 namespace ndncert {
diff --git a/tests/unit-tests/client-module.t.cpp b/tests/unit-tests/client-module.t.cpp
index 7e6214b..159eaaf 100644
--- a/tests/unit-tests/client-module.t.cpp
+++ b/tests/unit-tests/client-module.t.cpp
@@ -21,13 +21,7 @@
 #include "client-module.hpp"
 #include "challenge-module.hpp"
 #include "ca-module.hpp"
-
-#include "identity-management-fixture.hpp"
-
-#include <ndn-cxx/util/dummy-client-face.hpp>
-#include <ndn-cxx/security/signing-helpers.hpp>
-#include <ndn-cxx/security/transform/public-key.hpp>
-#include <ndn-cxx/security/verification-helpers.hpp>
+#include "test-common.hpp"
 
 namespace ndn {
 namespace ndncert {
diff --git a/tests/unit-tests/crypto-helper.t.cpp b/tests/unit-tests/crypto-helper.t.cpp
index 8f8d7c0..28fbe63 100644
--- a/tests/unit-tests/crypto-helper.t.cpp
+++ b/tests/unit-tests/crypto-helper.t.cpp
@@ -19,7 +19,7 @@
  */
 
 #include "crypto-support/crypto-helper.hpp"
-#include "identity-management-fixture.hpp"
+#include "test-common.hpp"
 
 namespace ndn {
 namespace ndncert {
diff --git a/tests/unit-tests/enc-tlv.t.cpp b/tests/unit-tests/enc-tlv.t.cpp
index 56817d3..99c5fbe 100644
--- a/tests/unit-tests/enc-tlv.t.cpp
+++ b/tests/unit-tests/enc-tlv.t.cpp
@@ -18,9 +18,9 @@
  * See AUTHORS.md for complete list of ndncert authors and contributors.
  */
 
-#include "boost-test.hpp"
 #include "crypto-support/crypto-helper.hpp"
 #include "crypto-support/enc-tlv.hpp"
+#include "test-common.hpp"
 
 namespace ndn {
 namespace ndncert {