[PATCH] D61662: in test_suite run_test function, opt and self.opt is same obect

Lily He via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue May 7 19:23:16 PDT 2019


Lily_He updated this revision to Diff 198574.
Lily_He added a reviewer: LLVM.
Lily_He removed a project: LLVM.
Lily_He removed a subscriber: llvm-commits.

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D61662/new/

https://reviews.llvm.org/D61662

Files:
  lnt/tests/test_suite.py


Index: lnt/tests/test_suite.py
===================================================================
--- lnt/tests/test_suite.py
+++ lnt/tests/test_suite.py
@@ -271,27 +271,27 @@
 
     def run_test(self, opts):
 
-        if opts.cc is not None:
-            opts.cc = resolve_command_path(opts.cc)
+        if self.opts.cc is not None:
+            self.opts.cc = resolve_command_path(self.opts.cc)
 
-            if not lnt.testing.util.compilers.is_valid(opts.cc):
+            if not lnt.testing.util.compilers.is_valid(self.opts.cc):
                 self._fatal('--cc does not point to a valid executable.')
 
             # If there was no --cxx given, attempt to infer it from the --cc.
-            if opts.cxx is None:
-                opts.cxx = \
-                    lnt.testing.util.compilers.infer_cxx_compiler(opts.cc)
-                if opts.cxx is not None:
+            if self.opts.cxx is None:
+                self.opts.cxx = \
+                    lnt.testing.util.compilers.infer_cxx_compiler(self.opts.cc)
+                if self.opts.cxx is not None:
                     logger.info("Inferred C++ compiler under test as: %r"
                                 % (self.opts.cxx,))
                 else:
                     self._fatal("unable to infer --cxx - set it manually.")
             else:
-                opts.cxx = resolve_command_path(opts.cxx)
+                self.opts.cxx = resolve_command_path(self.opts.cxx)
 
-            if not os.path.exists(opts.cxx):
+            if not os.path.exists(self.opts.cxx):
                 self._fatal("invalid --cxx argument %r, does not exist"
-                            % (opts.cxx))
+                            % (self.opts.cxx))
 
         if opts.test_suite_root is None:
             self._fatal('--test-suite is required')
@@ -333,7 +333,7 @@
             # --only-test can either point to a particular test or a directory.
             # Therefore, test_suite_root + opts.only_test or
             # test_suite_root + dirname(opts.only_test) must be a directory.
-            path = os.path.join(opts.test_suite_root, one_test)
+            path = os.path.join(self.opts.test_suite_root, one_test)
             parent_path = os.path.dirname(path)
             if os.path.isdir(path):
                 opts.only_test[i] = (one_test, None)
@@ -375,16 +375,16 @@
         self.start_time = timestamp()
 
         # Work out where to put our build stuff
-        if opts.timestamp_build:
+        if self.opts.timestamp_build:
             ts = self.start_time.replace(' ', '_').replace(':', '-')
             build_dir_name = "test-%s" % ts
         else:
             build_dir_name = "build"
-        basedir = os.path.join(opts.sandbox_path, build_dir_name)
+        basedir = os.path.join(self.opts.sandbox_path, build_dir_name)
         self._base_path = basedir
 
         cmakecache = os.path.join(self._base_path, 'CMakeCache.txt')
-        self.configured = not opts.run_configure and \
+        self.configured = not self.opts.run_configure and \
             os.path.exists(cmakecache)
 
         #  If we are doing diagnostics, skip the usual run and do them now.
@@ -438,7 +438,7 @@
             c = i < opts.compile_multisample
             e = i < opts.exec_multisample
             # only gather perf profiles on a single run.
-            p = i == 0 and opts.use_perf in ('profile', 'all')
+            p = i == 0 and self.opts.use_perf in ('profile', 'all')
             # <SYNOPSYS>
             run_report, json_data = self.run(cmake_vars, test_modules, compile=c, test=e,
                                              profile=p)
@@ -470,7 +470,7 @@
         with open(csv_report_path, 'w') as fd:
             fd.write(str_template)
 
-        return self.submit(report_path, opts, 'nts')
+        return self.submit(report_path, self.opts, 'nts')
 
     def _configure_if_needed(self):
         mkdir_p(self._base_path)


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D61662.198574.patch
Type: text/x-patch
Size: 3930 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190508/fe17b862/attachment.bin>


More information about the llvm-commits mailing list