# -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-

"""
Copyright (c) 2014-2016,  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/>.
"""

top = '..'

def build(bld):
    # Unit tests
    if bld.env['WITH_TESTS']:

        # 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='../core/common.hpp boost-test.hpp',
            defines='UNIT_TEST_CONFIG_PATH=\"%s/tmp-files/\"' % bld.bldnode,
          )

        for module, name in {"core": "Core Tests",
                             "daemon": "Daemon Tests",
                             "rib": "RIB Tests",
                             "tools": "Tools Tests"}.items():
            # main()
            bld(target='unit-tests-%s-main' % module,
                name='unit-tests-%s-main' % module,
                features='cxx',
                use='BOOST',
                source='main.cpp',
                defines=['BOOST_TEST_MODULE=%s' % name]
              )

            # unit-tests-%module
            unit_tests = bld.program(
                target='../unit-tests-%s' % module,
                features='cxx cxxprogram',
                source=bld.path.ant_glob(['%s/**/*.cpp' % module],
                                         excl=['%s/**/ethernet*.cpp' % module,
                                               '%s/**/unix*.cpp' % module,
                                               '%s/**/websocket*.cpp' % module]),
                use='%s-objects unit-tests-base unit-tests-%s-main' % (module, module),
                includes='.',
                install_path=None,
                defines='UNIT_TEST_CONFIG_PATH=\"%s/tmp-files/\"' % bld.bldnode,
              )

            if bld.env['HAVE_LIBPCAP']:
                unit_tests.source += bld.path.ant_glob('%s/**/ethernet*.cpp' % module)

            if bld.env['HAVE_UNIX_SOCKETS']:
                unit_tests.source += bld.path.ant_glob('%s/**/unix*.cpp' % module)

            if bld.env['HAVE_WEBSOCKET']:
                unit_tests.source += bld.path.ant_glob('%s/**/websocket*.cpp' % module)

    # 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")
