src: Reorganizing source code in preparation to merge NRD code

Note that as of this commit, there are several changes in location of
compiled binaries in `build/` folder:

* `nfd` has been moved to `build/bin/nfd`
* `unit-tests` has been split into `unit-tests-core` and `unit-tests-daemon`

Change-Id: I2c830c117879edbaa5457d6423c13f0273285919
Refs: #1486
diff --git a/tests/wscript b/tests/wscript
new file mode 100644
index 0000000..423e5e3
--- /dev/null
+++ b/tests/wscript
@@ -0,0 +1,69 @@
+# -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-
+
+"""
+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
+
+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/>.
+"""
+
+top = '..'
+
+def build(bld):
+    # Unit tests
+    if bld.env['WITH_TESTS']:
+        unit_test_main = bld(
+            target='unit-tests-main',
+            name='unit-tests-main',
+            features='cxx',
+            source=bld.path.ant_glob(['*.cpp']),
+            use='core-objects',
+          )
+
+        # core tests
+        unit_tests_core = bld.program(
+            target='../unit-tests-core',
+            features='cxx cxxprogram',
+            source=bld.path.ant_glob(['core/**/*.cpp']),
+            use='core-objects unit-tests-main',
+            includes='.',
+            install_prefix=None,
+          )
+
+        # NFD tests
+        unit_tests_nfd = bld.program(
+            target='../unit-tests-daemon',
+            features='cxx cxxprogram',
+            source=bld.path.ant_glob(['daemon/**/*.cpp'],
+                                     excl=['daemon/face/ethernet.cpp',
+                                           'daemon/face/unix-*.cpp']),
+            use='daemon-objects unit-tests-main',
+            includes='.',
+            install_prefix=None,
+          )
+
+        if bld.env['HAVE_LIBPCAP']:
+            unit_tests_nfd.source += bld.path.ant_glob('daemon/face/ethernet.cpp')
+
+        if bld.env['HAVE_UNIX_SOCKETS']:
+            unit_tests_nfd.source += bld.path.ant_glob('daemon/face/unix-*.cpp')
+
+    # Other tests (e.g., stress tests that can be enabled even if unit tests are disabled)
+    if bld.env['WITH_TESTS'] or bld.env['WITH_OTHER_TESTS']:
+        bld.recurse("other")