Debian Codegraph @

tests/wscript_build

raw ◀ ▶
1 Debian patch touch this file
1 # vim:set syntax=python:
2
•3 import sys
4 import os.path
5
6 uselib = ['aubio']
7
8 includes = ['../src', '.']
9 programs_sources = ctx.path.ant_glob('src/**/*.c')
10
11 test_sound_target = '44100Hz_44100f_sine441_stereo.wav'
12 test_sound_abspath = bld.path.get_bld().make_node(test_sound_target)
13 # workaround to double escape backslash characters on windows
14 test_sound_abspath = str(test_sound_abspath).replace('\\', '\\\\')
15
16 b = bld(name='create_tests_source',
•17 rule=sys.executable + ' ${SRC} ${TGT}',
18 source='create_tests_source.py',
19 target=test_sound_target)
20 # use post() to create the task, keep a reference to it
21 b.post()
22 create_tests_source = b.tasks[0]
23
24 for source_file in programs_sources:
25 target = os.path.basename(os.path.splitext(str(source_file))[0])
26 a = bld(features = 'c cprogram test',
27 source = source_file,
28 target = target,
29 includes = includes,
30 use = uselib,
31 install_path = None,
32 defines = ['AUBIO_UNSTABLE_API=1',
33 'AUBIO_TESTS_SOURCE={}'.format(test_sound_abspath)]
34 )
35 a.post()
36 # make sure the unit_test task runs *after* the source is created
37 a.tasks[-1].set_run_after(create_tests_source)