Commit Graph

93443 Commits

Author SHA1 Message Date
Victor Stinner 3aac0adfe0 Cleanup regrtest "main()" function
* Rename libregrtest.main_in_temp_cwd() to libregrtest.main()
* Add regrtest.main_in_temp_cwd() alias to libregrtest.main()
* Move old main_in_temp_cwd() code into libregrtest.Regrtest.main()
* Update multiple scripts to call libregrtest.main()
2016-03-24 17:53:20 +01:00
Victor Stinner 8c08e0db8f rt.bat: use -m test instead of Lib\test\regrtest.py 2016-03-24 17:46:24 +01:00
Victor Stinner 4ffcc3ee1e Cleanup regrtest.py
* Move code into a new _main() function
* Fix loop to cleanup sys.path
* Remove unused import
2016-03-24 17:43:53 +01:00
Victor Stinner e40390473d support.temp_dir(): call support.rmtree() instead of shutil.rmtree() 2016-03-24 17:42:10 +01:00
Victor Stinner 3899b549e3 test_os: use support.rmtree() to cleanup WalkTests 2016-03-24 17:21:17 +01:00
Victor Stinner ae39d236b4 Enhance and modernize test_os
* add create_file() helper function
* create files using "x" mode instead of "w" to detect when a previous test
  forget to remove a file
* open file for writing in unbuferred mode (buffering=0)
* replace "try/finally: unlink" with self.addCleanup(support.unlink)
* register unlink cleanup function *before* creating new files
2016-03-24 17:12:55 +01:00
Victor Stinner f95a19b900 test_os: use @support.requires_linux_version 2016-03-24 16:50:41 +01:00
Victor Stinner bc6b72ed06 Closes #26620: Fix ResourceWarning in test_urllib2_localnet
* Use context manager on urllib objects to ensure that they are closed on error
* Use self.addCleanup() to cleanup resources even if a test is interrupted
  with CTRL+c
2016-03-24 13:55:58 +01:00
Victor Stinner e321274b2e Enhance and modernize test_genericpath
* Replace "try/finally: os.remove()" with self.addCleanup(support.unlink) or
  self.addCleanup(support.rmdir): the support function handles the case when
  the file doesn't exist
* Replace "try/finally: f.close()" with "with open(...) as f:"
* test_getsize: add a second test with a different size
* Create file using "x" mode to ensure that the file didn't exist before, to
  detect bugs in tests
* Open files in unbuffered mode (buferring=0) to write immediatly data on disk
* Replace map() with simpler code
* Split isdir() unit test into two units tests to make them less dependant,
  same change for isfile() test
* test_samefile(): test also two different files
2016-03-24 13:44:19 +01:00
Victor Stinner ba8b0a7db4 Enhance os._DummyDirEntry
Issue #25911:

* Try to fix test_os.BytesWalkTests on Windows
* Try to mimick better the reference os.DirEntry on Windows
* _DummyDirEntry now caches os.stat() result
* _DummyDirEntry constructor now tries to get os.stat()
2016-03-24 12:23:18 +01:00
Victor Stinner 56db16cd44 regrtest: when parallel tests are interrupted, display progress 2016-03-24 12:04:15 +01:00
Victor Stinner 2b60b7237e regrtest: mention in tests run sequentially or in parallel 2016-03-24 11:55:29 +01:00
Victor Stinner 5de16e80c1 regrtest: fix --fromfile feature
* Update code for the name regrtest output format.
* Enhance also test_regrtest test on --fromfile
2016-03-24 09:43:00 +01:00
Victor Stinner 923590e397 Fix DeprecationWarning on Windows
Issue #25911: Use support.check_warnings() to expect or ignore
DeprecationWarning in test_os.
2016-03-24 09:11:48 +01:00
Victor Stinner 5e14a38e8e _tracemalloc: use compact key for traces
Issue #26588: Optimize memory footprint of _tracemalloc before non-zero domain
is used. Start with compact key (Py_uintptr_t) and also switch to pointer_t key
when the first memory block with a non-zero domain is tracked.
2016-03-23 22:03:55 +01:00
Victor Stinner cc73932125 socketmodule.c: error if option larger than INT_MAX
On Windows, socket.setsockopt() raises an OverflowError if the socket option is
larger than INT_MAX bytes.
2016-03-23 21:35:29 +01:00
Victor Stinner 0069aef51a Fix test_spwd on OpenIndiana
Issue #18787: restore "bin" name in test_spwd but catch KeyError.
2016-03-23 21:15:55 +01:00
Victor Stinner c53195bbf0 Try to fix test_gdb on s390x SLES 3.x
Ignore empty lines in stderr.
2016-03-23 21:08:25 +01:00
Stefan Krah 63fd8b0c92 Null merge. 2016-03-23 20:53:47 +01:00
Stefan Krah 1129084ebd Issue #26621: Remove unnecessary test. 2016-03-23 20:53:22 +01:00
Stefan Krah 66e9d03bf4 Issue #26621: Update libmpdec version and remove unnecessary test case. 2016-03-23 20:50:10 +01:00
Victor Stinner 4a1c7d2c36 Try to fix test_spwd on OpenIndiana
Issue #18787: try to get the "root" entry which should exist on all UNIX
instead of "bin" which doesn't exist on OpenIndiana.
2016-03-23 18:45:55 +01:00
Terry Jan Reedy d0217ab660 Merge heads 2016-03-23 13:40:14 -04:00
Terry Jan Reedy 9d9fc4101e Merge heads 2016-03-23 13:39:18 -04:00
Victor Stinner 82d44f0598 Issue #23848: Fix usage of _Py_DumpDecimal() 2016-03-23 18:37:54 +01:00
Terry Jan Reedy 4c181cf448 Merge with 3.5 2016-03-23 13:37:15 -04:00
Victor Stinner f963c13597 longobject.c: fix compilation warning on Windows 64-bit
We know that Py_SIZE(b) is -1 or 1 an so fits into the sdigit type.
2016-03-23 18:36:54 +01:00
Terry Jan Reedy 01a9a958b6 Issue #26525: Change chr example to match change in ord example. 2016-03-23 13:36:52 -04:00
Victor Stinner 904f5def5c Try to fix test_gdb on s390x buildbots 2016-03-23 18:32:54 +01:00
Victor Stinner 023654fa68 get_warnings_attr(): Fix coverity warning
Don't check if the dict key exists before getting the key. Instead get the key
and handle error.
2016-03-23 17:48:22 +01:00
Victor Stinner d1700a9360 Fix typo in doc: avoid the french "& cie" :-) 2016-03-23 16:57:51 +01:00
Victor Stinner 1c3069aed6 Rework _Py_DumpASCII() to make Coverity happy 2016-03-23 16:10:07 +01:00
Victor Stinner 928ad285b5 Issue #23848: Try to fix test_faulthandler on ARM
Restore the previous code for stack_overflow().
2016-03-23 15:19:12 +01:00
Victor Stinner 412a5e7e23 faulthandler: only log fatal exceptions
Issue #23848, #26622:

* faulthandler now only logs fatal Windows exceptions.
* write error code as decimal, not as hexadecimal
* replace "Windows exception" with "Windows fatal exception"
2016-03-23 14:44:14 +01:00
doko@ubuntu.com b9e0834f46 Merge 3.5 2016-03-23 12:58:00 +01:00
doko@ubuntu.com 3a56b775da Makefile.pre.in (profile-opt): Fix bashism. 2016-03-23 12:57:29 +01:00
Victor Stinner 96f6e7a1ed Buildbots: change also Windows timeout from 1 hour to 15 min 2016-03-23 12:38:01 +01:00
Victor Stinner 69649f21f0 regrtest: display test duration in sequential mode
Only display duration if a test takes more than 30 seconds.
2016-03-23 12:14:10 +01:00
Victor Stinner e985726553 _msi.c: try to fix compiler warnings 2016-03-23 11:37:41 +01:00
Victor Stinner 976bb4099c compiler.c: fix compiler warnings on Windows 2016-03-23 11:36:19 +01:00
Victor Stinner ccb1f8cb1a getpathp.c: fix compiler warning
wcsnlen_s() result type is size_t.
2016-03-23 11:31:58 +01:00
Victor Stinner 0aed3a4ebc _PyMem_DebugFree(): fix compiler warning on Windows
Don't return a void value.
2016-03-23 11:30:43 +01:00
Victor Stinner 404cdc5a92 faulthandler: add Windows exception handler
Issue #23848: On Windows, faulthandler.enable() now also installs an exception
handler to dump the traceback of all Python threads on any Windows exception,
not only on UNIX signals (SIGSEGV, SIGFPE, SIGABRT).
2016-03-23 10:39:17 +01:00
Victor Stinner bd31b7c483 Issue #23848: Expose _Py_DumpHexadecimal()
This function will be reused by faulthandler.
2016-03-23 10:32:26 +01:00
Victor Stinner 5dacbd4c42 Cleanup hashtable.h
Issue #26588:

* Pass the hash table rather than the key size to hash and compare functions
* _Py_HASHTABLE_READ_KEY() and _Py_HASHTABLE_ENTRY_READ_KEY() macros now expect
  the hash table as the first parameter, rather than the key size
* tracemalloc_get_traces_fill(): use _Py_HASHTABLE_ENTRY_READ_DATA() rather
  than pointer dereference
* Remove the _Py_HASHTABLE_ENTRY_WRITE_PKEY() macro
* Move "PKEY" and "PDATA" macros inside hashtable.c
2016-03-23 09:52:13 +01:00
Victor Stinner ca79ccd9e6 Issue #26588:
* Optimize tracemalloc_add_trace(): modify hashtable entry data (trace) if the
  memory block is already tracked, rather than trying to remove the old trace
  and then add a new trace.
* Add _Py_HASHTABLE_ENTRY_WRITE_DATA() macro
2016-03-23 09:38:54 +01:00
Victor Stinner e8c6b2fd1b Issue #26588:
* _Py_HASHTABLE_ENTRY_DATA: change type from "char *" to "const void *"
* Add _Py_HASHTABLE_ENTRY_WRITE_PKEY() macro
* Rename _Py_HASHTABLE_ENTRY_WRITE_DATA() macro to
  _Py_HASHTABLE_ENTRY_WRITE_PDATA()
* Add _Py_HASHTABLE_ENTRY_WRITE_DATA() macro
2016-03-23 09:25:01 +01:00
Victor Stinner 42bcf37fcf Issue #26588: Optimize tracemalloc_realloc()
No need to remove the old trace if the memory block didn't move.
2016-03-23 09:08:08 +01:00
Victor Stinner d65e0c7560 Makefile: change default value of TESTTIMEOUT from 1 hour to 15 min
The whole test suite takes 6 minutes on my laptop. It takes less than 30
minutes on most buildbots. The TESTTIMEOUT is the timeout for a single test
file.
2016-03-23 02:05:39 +01:00
Victor Stinner 6d7f4f6675 regrtest: add timeout to main process when using -jN
libregrtest: add a watchdog to run_tests_multiprocess() using
faulthandler.dump_traceback_later().
2016-03-23 02:04:32 +01:00