[lit] Remove redundancy from names and comments

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@375456 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/utils/lit/lit/LitTestCase.py b/utils/lit/lit/LitTestCase.py
index c498313..d8a3fc3 100644
--- a/utils/lit/lit/LitTestCase.py
+++ b/utils/lit/lit/LitTestCase.py
@@ -27,7 +27,7 @@
     def runTest(self):
         # Run the test.
-        result = lit.worker._execute_test(self._test, self._lit_config)
+        result = lit.worker._execute(self._test, self._lit_config)
         # Adapt the result to unittest.
         if result.code is lit.Test.UNRESOLVED:
diff --git a/utils/lit/lit/run.py b/utils/lit/lit/run.py
index 9cf5713..a246eaa 100644
--- a/utils/lit/lit/run.py
+++ b/utils/lit/lit/run.py
@@ -66,14 +66,7 @@
         return end - start
-    def _consume_test_result(self, test, result):
-        """Test completion callback for lit.worker.run_one_test
-        Updates the test result status in the parent process. Each task in the
-        pool returns the test index and the result, and we use the index to look
-        up the original test object. Also updates the progress bar as tasks
-        complete.
-        """
+    def _process_result(self, test, result):
         # Don't add any more test results after we've hit the maximum failure
         # count.  Otherwise we're racing with the main thread, which is going
         # to terminate the process pool soon.
@@ -100,8 +93,8 @@
     def _execute(self, deadline):
         # TODO(yln): ignores deadline
         for test in self.tests:
-            result = lit.worker._execute_test(test, self.lit_config)
-            self._consume_test_result(test, result)
+            result = lit.worker._execute(test, self.lit_config)
+            self._process_result(test, result)
             if self.hit_max_failures:
@@ -121,7 +114,7 @@
         # interrupts the workers before we make it into our task callback, they
         # will each raise a KeyboardInterrupt exception and print to stderr at
         # the same time.
-        pool = multiprocessing.Pool(self.workers, lit.worker.initializer,
+        pool = multiprocessing.Pool(self.workers, lit.worker.initialize,
                                     (self.lit_config, semaphores))
         # Install a console-control signal handler on Windows.
@@ -135,10 +128,10 @@
             lit.util.win32api.SetConsoleCtrlHandler(console_ctrl_handler, True)
-            async_results = [pool.apply_async(lit.worker.run_one_test,
-                                              args=(test,),
-                                              callback=lambda r,t=test: self._consume_test_result(t, r))
-                             for test in self.tests]
+            async_results = [
+                pool.apply_async(lit.worker.execute, args=[test],
+                    callback=lambda r, t=test: self._process_result(t, r))
+                for test in self.tests]
             # Wait for all results to come in. The callback that runs in the
diff --git a/utils/lit/lit/worker.py b/utils/lit/lit/worker.py
index 5527d97..02fcc20 100644
--- a/utils/lit/lit/worker.py
+++ b/utils/lit/lit/worker.py
@@ -1,5 +1,10 @@
-# The functions in this module are meant to run on a separate worker process.
-# Exception: in single process mode _execute_test is called directly.
+The functions in this module are meant to run on a separate worker process.
+Exception: in single process mode _execute is called directly.
+For efficiency, we copy all data needed to execute all tests into each worker
+and store it in global variables. This reduces the cost of each task.
 import time
 import traceback
@@ -9,35 +14,32 @@
 _lit_config = None
 _parallelism_semaphores = None
-def initializer(lit_config, parallelism_semaphores):
-    """Copy expensive repeated data into worker processes"""
+def initialize(lit_config, parallelism_semaphores):
+    """Copy data shared by all test executions into worker processes"""
     global _lit_config
     global _parallelism_semaphores
     _lit_config = lit_config
     _parallelism_semaphores = parallelism_semaphores
-def run_one_test(test):
+def execute(test):
     """Run one test in a multiprocessing.Pool
     Side effects in this function and functions it calls are not visible in the
     main lit process.
     Arguments and results of this function are pickled, so they should be cheap
-    to copy. For efficiency, we copy all data needed to execute all tests into
-    each worker and store it in global variables. This reduces the cost of each
-    task.
+    to copy.
-        return _execute_test_in_parallelism_group(test, _lit_config,
-                                                  _parallelism_semaphores)
+        return _execute_in_parallelism_group(test, _lit_config,
+                                             _parallelism_semaphores)
     except KeyboardInterrupt:
         # If a worker process gets an interrupt, abort it immediately.
-def _execute_test_in_parallelism_group(test, lit_config, parallelism_semaphores):
-    """Execute one test inside the appropriate parallelism group"""
+def _execute_in_parallelism_group(test, lit_config, parallelism_semaphores):
     pg = test.config.parallelism_group
     if callable(pg):
         pg = pg(test)
@@ -46,14 +48,14 @@
         semaphore = parallelism_semaphores[pg]
-            return _execute_test(test, lit_config)
+            return _execute(test, lit_config)
-        return _execute_test(test, lit_config)
+        return _execute(test, lit_config)
-def _execute_test(test, lit_config):
+def _execute(test, lit_config):
     """Execute one test"""
     start = time.time()
     result = _execute_test_handle_errors(test, lit_config)