[LNT] r203115 - [lnt] Expose ability to run under qemu.

Daniel Sanders daniel.sanders at imgtec.com
Thu Mar 6 05:01:48 PST 2014


Author: dsanders
Date: Thu Mar  6 07:01:48 2014
New Revision: 203115

URL: http://llvm.org/viewvc/llvm-project?rev=203115&view=rev
Log:
[lnt] Expose ability to run under qemu.

Adds a --qemu-user-mode=VALUE option that sets USER_EMULATION_MODE to '1' and
RUNUNDER to the given value. It also records the use of qemu in report.json.

If qemu's default options and environment are sufficient then the option value
should be a qemu binary. If you need special options or environment variables,
then the option value should be a rununder script. In future, there will
hopefully be a way to generate a trivial rununder script to add options such as
'-cpu foo'.


Modified:
    lnt/trunk/lnt/tests/nt.py

Modified: lnt/trunk/lnt/tests/nt.py
URL: http://llvm.org/viewvc/llvm-project/lnt/trunk/lnt/tests/nt.py?rev=203115&r1=203114&r2=203115&view=diff
==============================================================================
--- lnt/trunk/lnt/tests/nt.py (original)
+++ lnt/trunk/lnt/tests/nt.py Thu Mar  6 07:01:48 2014
@@ -382,6 +382,11 @@ class TestConfiguration(object):
         else:
             public_vars = make_variables
 
+        # Set qemu user mode variables, if used.
+        if self.qemu_user_mode:
+            make_variables['USER_MODE_EMULATION'] = '1'
+            make_variables['RUNUNDER'] = self.qemu_user_mode
+
         return make_variables, public_vars
         
 ###
@@ -967,6 +972,10 @@ def run_test(nick_prefix, iteration, con
             run_info['remote_sw_vers'] = capture(remote_args + ["sw_vers"],
                                                  include_stderr=True).strip()
 
+    # Query qemu user mode properties if in use.
+    if config.qemu_user_mode:
+        run_info['qemu_user_mode'] = config.qemu_user_mode
+
     # Add machine dependent info.
     if config.use_machdep_info:
         machdep_info = machine_info
@@ -1246,6 +1255,11 @@ class NTTest(builtintest.BuiltinTest):
                                "non-test directories)"),
                          action="store_true", default=False)
 
+        group.add_option("", "--qemu-user-mode", dest="qemu_user_mode",
+                         help=("Enable qemu user mode emulation using this "
+                               "qemu executable [%default]"),
+                         type=str, default=None)
+
         group.add_option("", "--multisample", dest="multisample",
                          help="Accumulate test data from multiple runs",
                          type=int, default=None, metavar="N")





More information about the llvm-commits mailing list