Charles-François Natali | 6e6c59b | 2015-02-07 13:27:50 +0000 | [diff] [blame] | 1 | import os |
| 2 | import signal |
| 3 | import unittest |
| 4 | |
Berker Peksag | ce64391 | 2015-05-06 06:33:17 +0300 | [diff] [blame] | 5 | from test import support |
| 6 | from test.support import script_helper |
Charles-François Natali | 6e6c59b | 2015-02-07 13:27:50 +0000 | [diff] [blame] | 7 | |
| 8 | |
| 9 | @unittest.skipUnless(os.name == "posix", "only supported on Unix") |
| 10 | class EINTRTests(unittest.TestCase): |
| 11 | |
| 12 | @unittest.skipUnless(hasattr(signal, "setitimer"), "requires setitimer()") |
| 13 | def test_all(self): |
| 14 | # Run the tester in a sub-process, to make sure there is only one |
| 15 | # thread (for reliable signal delivery). |
| 16 | tester = support.findfile("eintr_tester.py", subdir="eintrdata") |
Victor Stinner | 98f223d | 2015-10-01 13:16:43 +0200 | [diff] [blame] | 17 | # use -u to try to get the full output if the test hangs or crash |
| 18 | script_helper.assert_python_ok("-u", tester) |
Charles-François Natali | 6e6c59b | 2015-02-07 13:27:50 +0000 | [diff] [blame] | 19 | |
| 20 | |
| 21 | if __name__ == "__main__": |
| 22 | unittest.main() |