X-Git-Url: https://git.cworth.org/git?p=apitrace-tests;a=blobdiff_plain;f=base_driver.py;h=d71cab10ff3cff21e2555f6aad4f5f743b7fc7ff;hp=51032bdab51cc9026a2990d20074c4fc23a72de8;hb=080f6bcc46197f37856d798cee0ec2b8ed9dcaf4;hpb=b8296ac85e510854e7ad57b02ddba25114b92775 diff --git a/base_driver.py b/base_driver.py index 51032bd..d71cab1 100644 --- a/base_driver.py +++ b/base_driver.py @@ -107,6 +107,9 @@ def get_build_program(program): def get_scripts_path(): + if options.apitrace_source: + return os.path.join(options.apitrace_source, 'scripts') + bin_path = get_bin_path() try_paths = [ @@ -124,8 +127,10 @@ def get_scripts_path(): sys.exit(1) -class Main: - global options +class Driver: + + def __init__(self): + pass def createOptParser(self): default_apitrace = 'apitrace' @@ -145,6 +150,10 @@ class Main: '--apitrace', metavar='PROGRAM', type='string', dest='apitrace', default=default_apitrace, help='path to apitrace executable') + optparser.add_option( + '--apitrace-source', metavar='PATH', + type='string', dest='apitrace_source', + help='path to apitrace source tree') optparser.add_option( '-C', '--directory', metavar='PATH', type='string', dest='cwd', default=None, @@ -160,12 +169,13 @@ class Main: if not args: optparser.error('an argument must be specified') - print get_scripts_path() - sys.path.insert(0, get_scripts_path()) + self.options = options + self.args = args + return options, args - def main(self): + def run(self): raise NotImplementedError