build: allow toggling benchmark/integration/unit tests independently

Change-Id: I88f7816c97a9884f328bf05b6c7e47b2e918ccf0
diff --git a/tests/benchmarks/wscript b/tests/benchmarks/wscript
index 02ca4f0..3c1e532 100644
--- a/tests/benchmarks/wscript
+++ b/tests/benchmarks/wscript
@@ -8,5 +8,5 @@
         bld.program(name=f'test-{name}',
                     target=name,
                     source=[test],
-                    use='tests-common',
+                    use='BOOST_TESTS ndn-cxx',
                     install_path=None)
diff --git a/tests/unit/wscript b/tests/unit/wscript
index 6b4e2b8..591353f 100644
--- a/tests/unit/wscript
+++ b/tests/unit/wscript
@@ -3,20 +3,20 @@
 top = '../..'
 
 def build(bld):
-    tmpdir = 'UNIT_TESTS_TMPDIR="%s"' % bld.bldnode.make_node('tmp-files')
+    tmpdir = 'UNIT_TESTS_TMPDIR="%s"' % bld.bldnode.make_node('tests-tmp')
 
-    # unit test objects
     srcFiles = bld.path.ant_glob('**/*.cpp',
                                  excl=['main.cpp',
                                        '**/*-osx.t.cpp',
                                        '**/*-sqlite3.t.cpp'])
 
-    if bld.env['HAVE_OSX_FRAMEWORKS']:
+    if bld.env.HAVE_OSX_FRAMEWORKS:
         srcFiles += bld.path.ant_glob('**/*-osx.t.cpp')
 
     # In case we want to make it optional later
     srcFiles += bld.path.ant_glob('**/*-sqlite3.t.cpp')
 
+    # unit test objects
     bld.objects(
         target='unit-tests-objects',
         source=srcFiles,
diff --git a/tests/wscript b/tests/wscript
index 7ab65d1..7277402 100644
--- a/tests/wscript
+++ b/tests/wscript
@@ -3,14 +3,19 @@
 top = '..'
 
 def build(bld):
-    # common objects that can be shared among all tests
-    bld.objects(
-        target='tests-common',
-        source=bld.path.ant_glob('*.cpp'),
-        features='pch',
-        headers='tests-pch.hpp',
-        use='BOOST_TESTS ndn-cxx')
+    if bld.env.WITH_INTEGRATION_TESTS or bld.env.WITH_UNIT_TESTS:
+        bld.objects(
+            target='tests-common',
+            source=bld.path.ant_glob('*.cpp'),
+            features='pch',
+            headers='tests-pch.hpp',
+            use='BOOST_TESTS ndn-cxx')
 
-    bld.recurse('benchmarks')
-    bld.recurse('integration')
-    bld.recurse('unit')
+    if bld.env.WITH_BENCHMARKS:
+        bld.recurse('benchmarks')
+
+    if bld.env.WITH_INTEGRATION_TESTS:
+        bld.recurse('integration')
+
+    if bld.env.WITH_UNIT_TESTS:
+        bld.recurse('unit')