# -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-
"""
Copyright (c) 2014-2020,  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:
        tmpdir = 'UNIT_TESTS_TMPDIR="%s"' % bld.bldnode.make_node('tmp-files')

        # common test objects
        bld.objects(
            target='tests-common',
            features='pch',
            source=bld.path.ant_glob('*.cpp', excl='main.cpp'),
            use='core-objects',
            headers='../core/common.hpp boost-test.hpp',
            defines=[tmpdir])

        for module in ['core', 'daemon', 'rib', 'tools']:
            # main() for the module
            bld.objects(target='unit-tests-%s-main' % module,
                        source='main.cpp',
                        use='BOOST',
                        defines=['BOOST_TEST_MODULE=NFD %s' % module.capitalize()])

            subdir = 'daemon/rib' if module == 'rib' else module
            node = bld.path.find_dir(subdir)
            src = node.ant_glob('**/*.cpp', excl=['face/*ethernet*.cpp',
                                                  'face/pcap*.cpp',
                                                  'face/unix*.cpp',
                                                  'face/websocket*.cpp'])
            if bld.env.HAVE_LIBPCAP:
                src += node.ant_glob('face/*ethernet*.cpp')
                src += node.ant_glob('face/pcap*.cpp')
            if bld.env.HAVE_UNIX_SOCKETS:
                src += node.ant_glob('face/unix*.cpp')
            if bld.env.HAVE_WEBSOCKET:
                src += node.ant_glob('face/websocket*.cpp')
            if module == 'rib':
                src += ['daemon/global-io-fixture.cpp',
                        'daemon/limited-io.cpp',
                        'daemon/rib-io-fixture.cpp']

            objmod = 'daemon' if module == 'rib' else module
            # unit-tests binary for the module
            bld.program(name='unit-tests-%s' % module,
                        target='../unit-tests-%s' % module,
                        source=src,
                        use='%s-objects tests-common unit-tests-%s-main' % (objmod, module),
                        defines=[tmpdir],
                        install_path=None)

    # Other tests (e.g., stress tests and benchmarks that can be enabled even if unit tests are disabled)
    if bld.env.WITH_TESTS or bld.env.WITH_OTHER_TESTS:
        bld.recurse('other')
