diff options
Diffstat (limited to 'tester')
-rw-r--r-- | tester/rt/options.py | 23 | ||||
-rw-r--r-- | tester/rt/test.py | 2 | ||||
-rwxr-xr-x | tester/rtems-test | 3 | ||||
-rw-r--r-- | tester/rtems/testing/defaults.mc | 1 | ||||
-rw-r--r-- | tester/wscript | 45 |
5 files changed, 62 insertions, 12 deletions
diff --git a/tester/rt/options.py b/tester/rt/options.py index f637017..2190818 100644 --- a/tester/rt/options.py +++ b/tester/rt/options.py @@ -48,6 +48,11 @@ from rtemstoolkit import path import version +# +# The path for the defaults. +# +defaults_mc = 'rtems/testing/defaults.mc' + class command_line(options.command_line): """Process the command line in a common way for all Tool Builder commands.""" @@ -71,7 +76,7 @@ class command_line(options.command_line): def load(args, optargs = None, command_path = None, - defaults = '%{_rtdir}/rtems/testing/defaults.mc'): + defaults = '%s' % (defaults_mc)): # # The path to this command if not supplied by the upper layers. # @@ -80,20 +85,30 @@ def load(args, optargs = None, if len(command_path) == 0: command_path = '.' # + # Check if there is a defaults.mc file under the command path. If so this is + # the tester being run from within the git repo. If not found assume the tools + # have been installed and the defaults is in the install prefix. + # + print path.join(command_path, defaults_mc) + if path.exists(path.join(command_path, defaults_mc)): + rtdir = command_path + else: + rtdir = '%{_prefix}/share/rtems/tester' + defaults = '%s/%s' % (rtdir, defaults_mc) + # # The command line contains the base defaults object all build objects copy # and modify by loading a configuration. # opts = command_line(args, optargs, - macros.macros(name = defaults, - rtdir = command_path), + macros.macros(name = defaults, rtdir = rtdir), command_path) options.load(opts) return opts def run(args): try: - _opts = load(args = args, defaults = 'rtems/testing/defaults.mc') + _opts = load(args = args, defaults = defaults_mc) log.notice('RTEMS Test - Defaults, v%s' % (version.str())) _opts.log_info() log.notice('Options:') diff --git a/tester/rt/test.py b/tester/rt/test.py index b1ae0cd..d9a04da 100644 --- a/tester/rt/test.py +++ b/tester/rt/test.py @@ -307,7 +307,7 @@ def run(command_path = None): except error.exit, eerr: sys.exit(2) except KeyboardInterrupt: - if opts.find_arg('--stacktrace'): + if opts is not None and opts.find_arg('--stacktrace'): print '}} dumping:', threading.active_count() for t in threading.enumerate(): print '}} ', t.name diff --git a/tester/rtems-test b/tester/rtems-test index 53c81cd..1684abc 100755 --- a/tester/rtems-test +++ b/tester/rtems-test @@ -32,7 +32,8 @@ import sys, os base = os.path.dirname(os.path.abspath(sys.argv[0])) parent = os.path.dirname(base) -sys.path = [base, parent] + sys.path +rtems = os.path.join(parent, 'share', 'rtems') +sys.path = [base, parent, rtems] + sys.path try: import rt.test diff --git a/tester/rtems/testing/defaults.mc b/tester/rtems/testing/defaults.mc index bf220f3..bf3186c 100644 --- a/tester/rtems/testing/defaults.mc +++ b/tester/rtems/testing/defaults.mc @@ -75,7 +75,6 @@ _infodir: dir, none, '%{_datarootdir}/info' _localedir: dir, none, '%{_datarootdir}/locale' _localedir: dir, none, '%{_datadir}/locale' _localstatedir: dir, none, '%{_prefix}/var' -_prefix: dir, none, '%{_usr}' _usr: dir, none, '/usr/local' _usrsrc: dir, none, '%{_usr}/src' _var: dir, none, '/usr/local/var' diff --git a/tester/wscript b/tester/wscript index 1c5139c..16030df 100644 --- a/tester/wscript +++ b/tester/wscript @@ -1,6 +1,6 @@ # # RTEMS Tools Project (http://www.rtems.org/) -# Copyright 2014 Chris Johns (chrisj@rtems.org) +# Copyright 2015 Chris Johns (chrisj@rtems.org) # All rights reserved. # # This file is part of the RTEMS Tools package in 'rtems-tools'. @@ -34,14 +34,49 @@ def recurse(ctx): for sd in subdirs: ctx.recurse(sd) -def options(ctx): - recurse(ctx) +def options(opt): + recurse(opt) + opt.load('python') def configure(ctx): recurse(ctx) + conf.load('python') + conf.check_python_version((2,7,3)) -def build(ctx): - recurse(ctx) +def build(bld): + recurse(bld) + + # + # Install the tester code. + # + bld(features = 'py', + source = ['rt/__init__.py', + 'rt/bsps.py', + 'rt/config.py', + 'rt/console.py', + 'rt/gdb.py', + 'rt/options.py', + 'rt/report.py', + 'rt/stty.py', + 'rt/test.py', + 'rt/version.py'], + install_path = '${PREFIX}/share/rtems/rt') + bld(features = 'py', + source = ['rt/pygdb/__init__.py', + 'rt/pygdb/mi_parser.py', + 'rt/pygdb/spark.py'], + install_path = '${PREFIX}/share/rtems/rt/pygdb') + bld.install_files('${PREFIX}/bin', ['rtems-test'], chmod = 0755) + bld.install_files('${PREFIX}/bin', ['rtems-test'], chmod = 0755) + + # + # Install the tester configuration files. + # + config = bld.path.find_dir('rtems') + bld.install_files('${PREFIX}/share/rtems/tester/rtems', + config.ant_glob('**', excl=['*~']), + cwd = config, + relative_trick = True) def install(ctx): recurse(ctx) |