X-Git-Url: https://git.cworth.org/git?p=apitrace-tests;a=blobdiff_plain;f=base_driver.py;h=1971fce5a88d616608c918fd16b6152ceadd0673;hp=51032bdab51cc9026a2990d20074c4fc23a72de8;hb=660ae172b47404abb185e2ab74deac02cda7260e;hpb=b8296ac85e510854e7ad57b02ddba25114b92775 diff --git a/base_driver.py b/base_driver.py index 51032bd..1971fce 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, @@ -164,8 +173,11 @@ class Main: sys.path.insert(0, get_scripts_path()) + self.options = options + self.args = args + return options, args - def main(self): + def run(self): raise NotImplementedError