Commit Graph

14 Commits

Author SHA1 Message Date
Miss Islington (bot) 4499e6caff
[3.11] gh-103053: Fix test_tools.test_freeze on FreeBSD (GH-110451) (#110457)
gh-103053: Fix test_tools.test_freeze on FreeBSD (GH-110451)

Fix test_tools.test_freeze on FreeBSD: run "make distclean" instead
of "make clean" in the copied source directory to remove also the
"python" program.

Other test_freeze changes:

* Log executed commands and directories, and the current directory.
* No longer uses make -C option to change the directory, instead use
  subprocess cwd parameter.
(cherry picked from commit a4baa9e8ac)

Co-authored-by: Victor Stinner <vstinner@python.org>
2023-10-06 01:32:21 +00:00
Victor Stinner 8ac20e5404
[3.11] gh-109615: Fix support test_copy_python_src_ignore() (#109958) (#109962)
gh-109615: Fix support test_copy_python_src_ignore() (#109958)

Fix the test when run on an installed Python: use "abs_srcdir" of
sysconfig, and skip the test if the Python source code cannot be
found.

* Tools/patchcheck/patchcheck.py, Tools/freeze/test/freeze.py and
  Lib/test/libregrtest/utils.py now first try to get "abs_srcdir"
  from sysconfig, before getting "srcdir" from sysconfig.
* test.pythoninfo logs sysconfig "abs_srcdir".

(cherry picked from commit b89ed9df39)
2023-09-27 11:00:22 +00:00
Victor Stinner 2423168604
[3.11] gh-109615: Fix test_tools.test_freeze SRCDIR (#109935) (#109951)
gh-109615: Fix test_tools.test_freeze SRCDIR (#109935)

Fix copy_source_tree() function of test_tools.test_freeze:

* Don't copy SRC_DIR/build/ anymore. This directory is modified by
  other tests running in parallel.
* Add test.support.copy_python_src_ignore().
* Use sysconfig to get the source directory.
* Use sysconfig.get_config_var() to get CONFIG_ARGS variable.

(cherry picked from commit 1512d6c6ee)
2023-09-27 08:59:02 +00:00
Miss Islington (bot) 3cc00127a2
gh-102151: Correctly fetch CONFIG_ARGS in Tools/freeze/test/freeze.py (GH-102152)
(cherry picked from commit c3a178398c)

Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
2023-02-23 06:36:28 -08:00
Miss Islington (bot) cec99ed1a7
gh-89792: Limit test_tools freeze test build parallelism based on the number of cores (GH-101841)
unhardcode freeze test build parallelism. base it on the number of cpus, don't use more than max(2, os.cpu_count()/3).
(cherry picked from commit dfc2e065a2)

Co-authored-by: Gregory P. Smith <greg@krypto.org>
2023-02-11 22:33:13 -08:00
Miss Islington (bot) d17cc3dfeb
gh-89792: Prevent test_tools from copying 1000M of "source" in freeze test (GH-101837)
Prevent test_tools from copying 1000M of "source"

It doesn't need a git repo, just the checkout.  We skip .git metadata, Doc/build, Doc/venv, and `__pycache__` subdirs, that developers often have in their clients to reduce the size of the source tree copy ten-fold.

This should significantly reduce IO and presumably time on buildbots during this long test.
(cherry picked from commit 1d194235e4)

Co-authored-by: Gregory P. Smith <greg@krypto.org>
2023-02-11 21:18:07 -08:00
Victor Stinner 329afe78c3
gh-57684: Update tests for PYTHONSAFEPATH=1 (#92358)
Fix tests failing with the PYTHONSAFEPATH=1 env var.

Enhance also -P help in Python usage (python --help).
2022-05-06 03:41:24 +02:00
Inada Naoki 9a5dec4e97
Fix EncodingWarning in Tools/freeze/test/freeze.py (GH-29742) 2021-11-30 13:16:40 +09:00
Eric Snow 8ed1495ad9
bpo-45783: Preserve file moves and deletions in the tests for the freeze tool. (GH-29527)
Use shutil.copytree rather than Git, which might be missing (or configured
differently) when testing Python built from a source release.
2021-11-23 14:43:40 +01:00
Guido van Rossum 1cbaa505d0
bpo-45696: Deep-freeze selected modules (GH-29118)
This gains 10% or more in startup time for `python -c pass` on UNIX-ish systems.

The Makefile.pre.in generating code builds on Eric's work for bpo-45020, but the .c file generator is new.

Windows version TBD.
2021-11-10 18:01:53 -08:00
Eric Snow 13d9205f40
bpo-45629: Add a test for the "freeze" tool. (gh-29222)
The "freeze" tool has been part of the repo for a long time. However, it hasn't had any tests in the test suite to guard against regressions. We add such a test here. This is especially important as there has been a lot of change recently related to frozen modules, with more to come.

Note that as part of the test we build Python out-of-tree and install it in a temp dir.

https://bugs.python.org/issue45629
2021-10-28 10:14:37 -06:00
Serhiy Storchaka 13ad3b7a82 bpo-31462: Remove trailing whitespaces. (#3564) 2017-09-14 09:38:36 +03:00
Martin v. Löwis 227bb3813a Run test program. 2014-03-30 21:27:17 +02:00
Martin v. Löwis 80c09cfa49 Add test case for freeze. 2014-03-30 20:18:58 +02:00