]> granicus.if.org Git - python/commitdiff
Adds test.support.PGO and skips tests that are not useful for PGO.
authorSteve Dower <steve.dower@microsoft.com>
Wed, 7 Sep 2016 02:38:15 +0000 (19:38 -0700)
committerSteve Dower <steve.dower@microsoft.com>
Wed, 7 Sep 2016 02:38:15 +0000 (19:38 -0700)
Lib/test/libregrtest/main.py
Lib/test/support/__init__.py
Lib/test/test_asyncore.py
Lib/test/test_gdb.py
Lib/test/test_multiprocessing_fork.py
Lib/test/test_multiprocessing_forkserver.py
Lib/test/test_multiprocessing_main_handling.py
Lib/test/test_multiprocessing_spawn.py
Lib/test/test_subprocess.py
Makefile.pre.in
Tools/msi/buildrelease.bat

index ba9e48b448635285374c482f0b4b188f71293413..dbbf72f1b5a4d5ed269806be1d3d2119a413ece4 100644 (file)
@@ -473,6 +473,8 @@ class Regrtest:
         if self.ns.wait:
             input("Press any key to continue...")
 
+        support.PGO = self.ns.pgo
+
         setup_tests(self.ns)
 
         self.find_tests(tests)
index 4a7cd40a0f92c3d074e9fa0dbb72cc1b44c1e336..3e2ab43ca4cd2bda482d5d6084eb35a31e9d8527 100644 (file)
@@ -105,7 +105,7 @@ __all__ = [
     "check_warnings", "check_no_resource_warning", "EnvironmentVarGuard",
     "run_with_locale", "swap_item",
     "swap_attr", "Matcher", "set_memlimit", "SuppressCrashReport", "sortdict",
-    "run_with_tz",
+    "run_with_tz", "PGO",
     ]
 
 class Error(Exception):
@@ -878,6 +878,10 @@ else:
 # Save the initial cwd
 SAVEDCWD = os.getcwd()
 
+# Set by libregrtest/main.py so we can skip tests that are not
+# useful for PGO
+PGO = False
+
 @contextlib.contextmanager
 def temp_dir(path=None, quiet=False):
     """Return a context manager that creates a temporary directory.
index 38579168cfd47ddb80db1a8bcb2cf77b54a2bbe8..dbee593c54450f9bafc5fbdba53689be3792f11e 100644 (file)
@@ -11,6 +11,9 @@ import struct
 from test import support
 from io import BytesIO
 
+if support.PGO:
+    raise unittest.SkipTest("test is not helpful for PGO")
+
 try:
     import threading
 except ImportError:
index 09bafbdd933699668effbd773a50c60ba54763be..30b5f16780128a4f27221dc23c7a7de0730a7995 100644 (file)
@@ -110,6 +110,7 @@ HAS_PYUP_PYDOWN = gdb_has_frame_select()
 
 BREAKPOINT_FN='builtin_id'
 
+@support.skipIf(support.PGO, "not useful for PGO")
 class DebuggerTests(unittest.TestCase):
 
     """Test that the debugger can debug Python."""
index 2bf4e756449b4b6d020ee2be897b78b01cb048fb..9f22500e8fca85cd70cd05a3af473b8bfd54f0e9 100644 (file)
@@ -1,6 +1,12 @@
 import unittest
 import test._test_multiprocessing
 
+from test import support
+
+if support.PGO:
+    raise unittest.SkipTest("test is not helpful for PGO")
+
+
 test._test_multiprocessing.install_tests_in_module_dict(globals(), 'fork')
 
 if __name__ == '__main__':
index 193a04a5fcb9dc0b31cfdc81c12638df0c01acc6..407bb3f9b694c8c50d85363de4fb2b4bada8624e 100644 (file)
@@ -1,6 +1,11 @@
 import unittest
 import test._test_multiprocessing
 
+from test import support
+
+if support.PGO:
+    raise unittest.SkipTest("test is not helpful for PGO")
+
 test._test_multiprocessing.install_tests_in_module_dict(globals(), 'forkserver')
 
 if __name__ == '__main__':
index 2e15cd8a6bff6c2a8259981a4e50ea35e9068369..32593dab86da16c9bec3323aa9e73f13eca1a621 100644 (file)
@@ -16,6 +16,9 @@ from test.support.script_helper import (
     make_pkg, make_script, make_zip_pkg, make_zip_script,
     assert_python_ok)
 
+if support.PGO:
+    raise unittest.SkipTest("test is not helpful for PGO")
+
 # Look up which start methods are available to test
 import multiprocessing
 AVAILABLE_START_METHODS = set(multiprocessing.get_all_start_methods())
index 334ae9e8f7a5897501f8f346b78bb037c5b8721c..6558952308f25ccdd2a665c1df4fb875577087d9 100644 (file)
@@ -1,6 +1,11 @@
 import unittest
 import test._test_multiprocessing
 
+from test import support
+
+if support.PGO:
+    raise unittest.SkipTest("test is not helpful for PGO")
+
 test._test_multiprocessing.install_tests_in_module_dict(globals(), 'spawn')
 
 if __name__ == '__main__':
index 2bfb69cbfe09c892264518a33b41f223d11ce16c..09066063cb25e7c8d211e2105401ebdd6ba43a6f 100644 (file)
@@ -21,6 +21,9 @@ try:
 except ImportError:
     threading = None
 
+if support.PGO:
+    raise unittest.SkipTest("test is not helpful for PGO")
+
 mswindows = (sys.platform == "win32")
 
 #
index f0d1bb1586eef6eaf40200d348a7ea1b465130d4..e4bee4fec565f370fcecab58bce46264417da652 100644 (file)
@@ -235,7 +235,7 @@ TCLTK_LIBS= @TCLTK_LIBS@
 # The task to run while instrumented when building the profile-opt target.
 # We exclude unittests with -x that take a rediculious amount of time to
 # run in the instrumented training build or do not provide much value.
-PROFILE_TASK=-m test.regrtest --pgo -x test_asyncore test_gdb test_multiprocessing_fork test_multiprocessing_forkserver test_multiprocessing_main_handling test_multiprocessing_spawn test_subprocess
+PROFILE_TASK=-m test.regrtest --pgo
 
 # report files for gcov / lcov coverage report
 COVERAGE_INFO= $(abs_builddir)/coverage.info
index 2eae07ad4a7dfe492d95b90e9b04fd64aa049b11..89e6ec13dd84c62c084690ceba358a931f4e87bb 100644 (file)
@@ -35,7 +35,7 @@ set BUILDX86=
 set BUILDX64=\r
 set TARGET=Rebuild\r
 set TESTTARGETDIR=\r
-set PGO=\r
+set PGO=default\r
 \r
 \r
 :CheckOpts\r
@@ -55,6 +55,7 @@ if "%1" EQU "--build" (set TARGET=Build) && shift && goto CheckOpts
 if "%1" EQU "-x86" (set BUILDX86=1) && shift && goto CheckOpts\r
 if "%1" EQU "-x64" (set BUILDX64=1) && shift && goto CheckOpts\r
 if "%1" EQU "--pgo" (set PGO=%~2) && shift && shift && goto CheckOpts\r
+if "%1" EQU "--skip-pgo" (set PGO=) && shift && goto CheckOpts\r
 \r
 if "%1" NEQ "" echo Invalid option: "%1" && exit /B 1\r
 \r
@@ -195,7 +196,7 @@ exit /B 0
 \r
 :Help\r
 echo buildrelease.bat [--out DIR] [-x86] [-x64] [--certificate CERTNAME] [--build] [--skip-build]\r
-echo                  [--pgo COMMAND] [--skip-doc] [--download DOWNLOAD URL] [--test TARGETDIR]\r
+echo                  [--pgo COMMAND] [--skip-pgo] [--skip-doc] [--download DOWNLOAD URL] [--test TARGETDIR]\r
 echo                  [-h]\r
 echo.\r
 echo    --out (-o)          Specify an additional output directory for installers\r
@@ -204,7 +205,8 @@ echo    -x64                Build x64 installers
 echo    --build (-b)        Incrementally build Python rather than rebuilding\r
 echo    --skip-build (-B)   Do not build Python (just do the installers)\r
 echo    --skip-doc (-D)     Do not build documentation\r
-echo    --pgo               Build x64 installers using PGO\r
+echo    --pgo               Specify PGO command for x64 installers\r
+echo    --skip-pgo          Build x64 installers using PGO\r
 echo    --download          Specify the full download URL for MSIs\r
 echo    --test              Specify the test directory to run the installer tests\r
 echo    -h                  Display this help information\r