waf: make benchmarks and tests be placed in common directories

Benchmarks now go to `build/<board>/benchmarks/` and tests to
`build/<board>/tests/`. That's done by using ardupilotwaf.program() and passing
blddestdir and program_name.
This commit is contained in:
Gustavo Jose de Sousa 2016-01-11 10:19:29 -02:00 committed by Lucas De Marchi
parent 59562ad693
commit f4a6d13cef

View File

@ -167,13 +167,15 @@ def find_tests(bld, use=[]):
includes = [bld.srcnode.abspath() + '/tests/'] includes = [bld.srcnode.abspath() + '/tests/']
for f in bld.path.ant_glob(incl='*.cpp'): for f in bld.path.ant_glob(incl='*.cpp'):
target = f.change_ext('.' + bld.env.BOARD) program(
bld.program( bld,
features=features, features=features,
target=target,
includes=includes, includes=includes,
source=[f], source=[f],
use=use, use=use,
program_name=f.change_ext('.' + bld.env.BOARD).name,
blddestdir='tests',
use_legacy_defines=False,
) )
def find_benchmarks(bld, use=[]): def find_benchmarks(bld, use=[]):
@ -183,13 +185,15 @@ def find_benchmarks(bld, use=[]):
includes = [bld.srcnode.abspath() + '/benchmarks/'] includes = [bld.srcnode.abspath() + '/benchmarks/']
for f in bld.path.ant_glob(incl='*.cpp'): for f in bld.path.ant_glob(incl='*.cpp'):
target = f.change_ext('.' + bld.env.BOARD) program(
bld.program( bld,
features=common_features(bld) + ['gbenchmark'], features=common_features(bld) + ['gbenchmark'],
target=target,
includes=includes, includes=includes,
source=[f], source=[f],
use=use, use=use,
program_name=f.change_ext('.' + bld.env.BOARD).name,
blddestdir='benchmarks',
use_legacy_defines=False,
) )
def test_summary(bld): def test_summary(bld):