build: Updated precompiled header support (enabled by default)

Change-Id: Iaab62c740ac87b84256a3f71d934760865a54be5
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)