build: Updated precompiled header support (enabled by default)

Change-Id: Iaab62c740ac87b84256a3f71d934760865a54be5
diff --git a/tests/test-pch.hpp b/tests/test-pch.hpp
deleted file mode 100644
index 9f89474..0000000
--- a/tests/test-pch.hpp
+++ /dev/null
@@ -1,32 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2014,  Regents of the University of California,
- *                      Arizona Board of Regents,
- *                      Colorado State University,
- *                      University Pierre & Marie Curie, Sorbonne University,
- *                      Washington University in St. Louis,
- *                      Beijing Institute of Technology,
- *                      The University of Memphis
- *
- * This file is part of NFD (Named Data Networking Forwarding Daemon).
- * See AUTHORS.md for complete list of NFD authors and contributors.
- *
- * NFD 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.
- *
- * NFD 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 a copy of the GNU General Public License along with
- * NFD, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
- */
-
-#ifndef NFD_TESTS_TEST_PCH_HPP
-#define NFD_TESTS_TEST_PCH_HPP
-
-#include "common.hpp"
-#include "boost-test.hpp"
-
-#endif // NFD_TESTS_TEST_PCH_HPP
diff --git a/tests/wscript b/tests/wscript
index 7d8c36d..ca58e3b 100644
--- a/tests/wscript
+++ b/tests/wscript
@@ -28,12 +28,23 @@
 def build(bld):
     # Unit tests
     if bld.env['WITH_TESTS']:
+        # main()
         unit_test_main = bld(
             target='unit-tests-main',
             name='unit-tests-main',
             features='cxx',
-            source=bld.path.ant_glob(['*.cpp']),
             use='core-objects',
+            source='main.cpp',
+          )
+
+        # common test modules
+        unit_test_base = bld(
+            target='unit-tests-base',
+            name='unit-tests-base',
+            features='cxx pch',
+            source=bld.path.ant_glob(['*.cpp'], excl='main.cpp'),
+            use='core-objects',
+            headers='../common.hpp boost-test.hpp',
           )
 
         # core tests
@@ -41,10 +52,9 @@
             target='../unit-tests-core',
             features='cxx cxxprogram',
             source=bld.path.ant_glob(['core/**/*.cpp']),
-            use='core-objects unit-tests-main',
+            use='core-objects unit-tests-base unit-tests-main',
             includes='.',
             install_path=None,
-            pch='test-pch.hpp',
           )
 
         # NFD tests
@@ -55,10 +65,9 @@
                                      excl=['daemon/face/ethernet.cpp',
                                            'daemon/face/unix-*.cpp',
                                            'daemon/face/websocket-*.cpp']),
-            use='daemon-objects unit-tests-main',
+            use='daemon-objects unit-tests-base unit-tests-main',
             includes='.',
             install_path=None,
-            pch='test-pch.hpp',
           )
 
         if bld.env['HAVE_LIBPCAP']:
@@ -74,10 +83,9 @@
             target='../unit-tests-rib',
             features='cxx cxxprogram',
             source=bld.path.ant_glob(['rib/**/*.cpp']),
-            use='rib-objects unit-tests-main',
+            use='rib-objects unit-tests-base unit-tests-main',
             includes=['.'],
             install_path=None,
-            pch='test-pch.hpp',
           )
 
     # Other tests (e.g., stress tests that can be enabled even if unit tests are disabled)