Commit Graph

122 Commits

Author SHA1 Message Date
Victor Stinner 6f20a2e01f Issue #25220, libregrtest: Pass directly ns to runtest()
* Remove runtest_ns(): pass directly ns to runtest().
* Create also Regrtest.rerun_failed_tests() method.
* Inline again Regrtest.run_test(): it's no more justified to have a method
2015-09-30 02:32:11 +02:00
Victor Stinner a204502dbf Issue #25220, libregrtest: Set support.use_resources in setup_tests()
* Rename setup_python() to setup_tests()
* Remove use_resources parameter of runtest()
2015-09-30 02:17:28 +02:00
Victor Stinner ecef622fec Issue #25220, libregrtest: Call setup_python(ns) in the slaves
Slaves (child processes running tests for regrtest -jN) now inherit
--memlimit/-M, --threshold/-t and --nowindows/-n options.

* -M, -t and -n are now supported with -jN
* Factorize code to run tests.
* run_test_in_subprocess() now pass the whole "ns" namespace to the child
  process.
2015-09-30 01:39:28 +02:00
Victor Stinner 8bb19f094b Issue #25220, libregrtest: Add runtest_ns() function
* Factorize code to run tests.
* run_test_in_subprocess() now pass the whole "ns" namespace to the child
  process.
2015-09-30 01:32:39 +02:00
Victor Stinner 234cbef39f Issue #25220, libregrtest: Move setup_python() to a new submodule 2015-09-30 01:13:53 +02:00
Victor Stinner c7eab0528c Issue #25220, libregrtest: Cleanup setup code 2015-09-30 00:59:35 +02:00
Victor Stinner f33536c430 Issue #25220: Use print(flush=True) in libregrtest 2015-09-30 00:48:27 +02:00
Victor Stinner 76f756d934 Issue #25220: Enhance regrtest -jN
Running the Python test suite with -jN now:

- Display the duration of tests which took longer than 30 seconds
- Display the tests currently running since at least 30 seconds
- Display the tests we are waiting for when the test suite is interrupted

Clenaup also run_test_in_subprocess() code.
2015-09-30 00:33:29 +02:00
Victor Stinner 02319804ea Don't strip refcount in libregrtest/runtest_mp.py
Python doesn't display the refcount anymore by default. It only displays it
when -X showrefcount command line option is used, which is not the case here.
regrtest can be run with -X showrefcount, the option is not inherited by child
processes.
2015-09-29 23:52:33 +02:00
Victor Stinner 86e8c31b8d Issue #25220, libregrtest: Remove unused import 2015-09-29 23:50:19 +02:00
Victor Stinner 6448b8041a Issue #25220: truncate some long lines in libregrtest/*.py 2015-09-29 23:43:33 +02:00
Victor Stinner 37554525aa Issue #25220: regrtest setups Python after parsing command line options 2015-09-29 23:37:14 +02:00
Victor Stinner bd1a72c455 Issue #25220: Enhance regrtest --coverage
Add a new Regrtest.run_test() method to ensure that --coverage pass the same
options to the runtest() function.
2015-09-29 23:36:27 +02:00
Victor Stinner 56e05dd0b0 Issue #25220: Create libregrtest/runtest_mp.py
Move the code to run tests in multiple processes using threading and subprocess
to a new submodule.

Move also slave_runner() (renamed to run_tests_slave()) and
run_test_in_subprocess() (renamed to run_tests_in_subprocess()) there.
2015-09-29 23:15:38 +02:00
Victor Stinner dad20e4876 Issue #25220: Split the huge main() function of libregrtest.main into a class
with attributes and methods.

The --threshold command line option is now ignored if the gc module is missing.

* Convert main() variables to Regrtest attributes, document some attributes
* Convert accumulate_result() function to a method
* Create setup_python() function and setup_regrtest() method.
* Import gc at top level
* Move resource.setrlimit() and the code to make the module paths absolute into
  the new setup_python() function. So this code is no more executed when the
  module is imported, only when main() is executed. We have a better control on
  when the setup is done.
* Move textwrap import from printlist() to the top level.
* Some other minor cleanup.
2015-09-29 22:48:52 +02:00
Victor Stinner feabaed054 Oops, revert unwanted change, sorry 2015-09-29 14:02:35 +02:00
Victor Stinner 3f7468507a test 2015-09-29 13:47:15 +02:00
Victor Stinner 36b3fbb0ee Issue #25220: Fix Lib/test/autotest.py 2015-09-27 11:19:08 +02:00
Victor Stinner 3844fe5ed8 Issue #25220: Move most regrtest.py code to libregrtest 2015-09-26 10:38:01 +02:00
Victor Stinner 98de5340d4 Issue #25220: Create Lib/test/libregrtest/
Start to split regrtest.py into smaller parts with the creation of
Lib/test/libregrtest/cmdline.py: code to handle the command line, especially
parsing command line arguments. This part of the code is tested by
test_regrtest.
2015-09-26 09:43:45 +02:00
Victor Stinner 0cca00b67e Issue #25220: Backed out changeset eaf9a99b6bb8 2015-09-23 23:16:47 +02:00
Victor Stinner 7b92abf0e9 Issue #25220: Create Lib/test/libregrtest/
Start to split regrtest.py into smaller parts with the creation of
Lib/test/libregrtest/cmdline.py.
2015-09-23 23:04:18 +02:00