# Copyright AllSeen Alliance. All rights reserved.
#
#    Permission to use, copy, modify, and/or distribute this software for any
#    purpose with or without fee is hereby granted, provided that the above
#    copyright notice and this permission notice appear in all copies.
#
#    THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
#    WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
#    MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
#    ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
#    WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
#    ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
#    OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
# 

Import('env')

test_env = env.Clone()
test_env.Append(CPPPATH = test_env.Dir('..').srcnode())

if test_env['BR'] == 'on':
    # Build apps with bundled daemon support
    test_env.Prepend(LIBS = [test_env['ajrlib']])

# Test Programs
progs = [
    test_env.Program('aclient',       ['aclient.cc']),
    test_env.Program('ajxmlcop',      ['ajxmlcop.cc']),
    test_env.Program('aservice',      ['aservice.cc']),
    test_env.Program('bastress',      ['bastress.cc']),
    test_env.Program('bastress2',     ['bastress2.cc']),
    test_env.Program('bignum',        ['bignum.cc']),
    test_env.Program('propstresstest',['propstresstest.cc']),
    test_env.Program('proptester',    ['proptester.cc']),
    test_env.Program('socktest',      ['socktest.cc']),
    test_env.Program('remarshal',     ['remarshal.cc']),
    test_env.Program('unpack',        ['unpack.cc']),
    test_env.Program('srp',           ['srp.cc']),
    test_env.Program('aes_ccm',       ['aes_ccm.cc']),
    test_env.Program('bbservice',     ['bbservice.cc']),
    test_env.Program('bbsig',         ['bbsig.cc']),
    test_env.Program('bbclient',      ['bbclient.cc']),
    test_env.Program('bbjoin',        ['bbjoin.cc']),
    test_env.Program('bbjitter',      ['bbjitter.cc']),
    test_env.Program('marshal',       ['marshal.cc']),
    test_env.Program('names',         ['names.cc']),
    test_env.Program('rawclient',     ['rawclient.cc']),
    test_env.Program('rawservice',    ['rawservice.cc']),
    test_env.Program('sessions',      ['sessions.cc']),
    test_env.Program('bbsigtest',     ['bbsigtest.cc']),
    test_env.Program('init',          ['init.cc']),
    test_env.Program('eventsactionservice', ['eventsactionservice.cc'])
    ]

if test_env['OS'] == 'linux':
   progs.extend(test_env.Program('observer-multipeer',     ['observer-multipeer.cc']))

if test_env['OS'] == 'linux' or test_env['OS'] == 'android':
    progs.extend(test_env.Program('mc-rcv',     ['mc-rcv.cc']))
    progs.extend(test_env.Program('mc-snd',     ['mc-snd.cc']))

if test_env['OS'] in ['win7', 'win10']:
    progs.extend(test_env.Program('mouseclient', ['mouseclient.cc']))
    progs.extend(test_env.Program('litegen',     ['litegen.cc']))

Return('progs')
