# -*- 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']:
        # main()
        unit_test_main = bld(
            target='unit-tests-main',
            name='unit-tests-main',
            features='cxx',
            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
        unit_tests_core = bld.program(
            target='../unit-tests-core',
            features='cxx cxxprogram',
            source=bld.path.ant_glob(['core/**/*.cpp']),
            use='core-objects unit-tests-base unit-tests-main',
            includes='.',
            install_path=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',
                                           'daemon/face/websocket-*.cpp']),
            use='daemon-objects unit-tests-base unit-tests-main',
            includes='.',
            install_path=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')

        if bld.env['HAVE_WEBSOCKET']:
            unit_tests_nfd.source += bld.path.ant_glob('daemon/face/websocket-*.cpp')

        unit_tests_rib = bld.program(
            target='../unit-tests-rib',
            features='cxx cxxprogram',
            source=bld.path.ant_glob(['rib/**/*.cpp']),
            use='rib-objects unit-tests-base unit-tests-main',
            includes=['.'],
            install_path=None,
          )

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