core: change logging from environment variable to configuration file-based

GlobalConfigurationFixture uses unit-tests.conf to determine default
and module specific logging levels. Logging will gracefully default to
INFO if unit-tests.conf is not found. See unit-tests.conf.sample for a
sample configuration file.

refs: #1375, #1267

Change-Id: Ib0c4eb4149748e6658f94ef1afa23ddd3072c0fa
diff --git a/tests/core/global-configuration.cpp b/tests/core/global-configuration.cpp
new file mode 100644
index 0000000..a288147
--- /dev/null
+++ b/tests/core/global-configuration.cpp
@@ -0,0 +1,35 @@
+/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
+/**
+ * Copyright (C) 2014 Named Data Networking Project
+ * See COPYING for copyright and distribution information.
+ */
+
+#include "../test-common.hpp"
+#include "core/logger.hpp"
+#include "mgmt/config-file.hpp"
+
+#include <boost/filesystem.hpp>
+
+namespace nfd {
+namespace tests {
+
+class GlobalConfigurationFixture
+{
+public:
+  GlobalConfigurationFixture()
+  {
+    const std::string filename = "unit-tests.conf";
+    if (boost::filesystem::exists(filename))
+      {
+        ConfigFile config;
+        LoggerFactory::getInstance().setConfigFile(config);
+
+        config.parse(filename, false);
+      }
+  }
+};
+
+BOOST_GLOBAL_FIXTURE(GlobalConfigurationFixture)
+
+} // namespace tests
+} // namespace nfd