Index: llvm/utils/lit/lit/LitConfig.py =================================================================== --- llvm/utils/lit/lit/LitConfig.py +++ llvm/utils/lit/lit/LitConfig.py @@ -19,7 +19,7 @@ """ def __init__(self, progname, path, quiet, - useValgrind, valgrindLeakCheck, valgrindArgs, + useQEMU, qemuArgs, useValgrind, valgrindLeakCheck, valgrindArgs, noExecute, debug, isWindows, params, config_prefix = None): # The name of the test runner. @@ -27,6 +27,8 @@ # The items to add to the PATH environment variable. self.path = [str(p) for p in path] self.quiet = bool(quiet) + self.useQEMU = bool(useQEMU) + self.qemuUserArgs = list(qemuArgs) self.useValgrind = bool(useValgrind) self.valgrindLeakCheck = bool(valgrindLeakCheck) self.valgrindUserArgs = list(valgrindArgs) @@ -45,6 +47,10 @@ self.numErrors = 0 self.numWarnings = 0 + self.qemuArgs = [] + if self.useQEMU: + self.qemuArgs.extend(self.qemuUserArgs) + self.valgrindArgs = [] if self.useValgrind: self.valgrindArgs = ['valgrind', '-q', '--run-libc-freeres=no', Index: llvm/utils/lit/lit/TestingConfig.py =================================================================== --- llvm/utils/lit/lit/TestingConfig.py +++ llvm/utils/lit/lit/TestingConfig.py @@ -51,6 +51,8 @@ available_features.append('valgrind') if litConfig.valgrindLeakCheck: available_features.append('vg_leak') + if litConfig.useQEMU: + available_features.append('qemu') return TestingConfig(None, name = '', Index: llvm/utils/lit/lit/discovery.py =================================================================== --- llvm/utils/lit/lit/discovery.py +++ llvm/utils/lit/lit/discovery.py @@ -239,6 +239,8 @@ litConfig = LitConfig.LitConfig(progname = 'lit', path = [], quiet = False, + useQEMU = False, + qemuArgs = [], useValgrind = False, valgrindLeakCheck = False, valgrindArgs = [], Index: llvm/utils/lit/lit/main.py =================================================================== --- llvm/utils/lit/lit/main.py +++ llvm/utils/lit/lit/main.py @@ -174,6 +174,12 @@ group.add_option("", "--path", dest="path", help="Additional paths to add to testing environment", action="append", type=str, default=[]) + group.add_option("", "--qemu", dest="useQEMU", + help="Run tests via QEMU", + action="store_true", default=False) + group.add_option("", "--qemu-arg", dest="qemuArgs", metavar="ARG", + help="Specify arguments for QEMU", + action="append", default=[]) group.add_option("", "--vg", dest="useValgrind", help="Run tests under valgrind", action="store_true", default=False) @@ -264,6 +270,8 @@ progname = os.path.basename(sys.argv[0]), path = opts.path, quiet = opts.quiet, + useQEMU = opts.useQEMU, + qemuArgs = opts.qemuArgs, useValgrind = opts.useValgrind, valgrindLeakCheck = opts.valgrindLeakCheck, valgrindArgs = opts.valgrindArgs,