blob: aabad835a0a802e686f8de6f9cffd69ab528f012 [file] [log] [blame]
Charles-François Natali6e6c59b2015-02-07 13:27:50 +00001import os
2import signal
Victor Stinner4b352172015-09-18 11:29:16 +02003import subprocess
4import sys
Charles-François Natali6e6c59b2015-02-07 13:27:50 +00005import unittest
6
Berker Peksagce643912015-05-06 06:33:17 +03007from test import support
8from test.support import script_helper
Charles-François Natali6e6c59b2015-02-07 13:27:50 +00009
10
11@unittest.skipUnless(os.name == "posix", "only supported on Unix")
12class EINTRTests(unittest.TestCase):
13
14 @unittest.skipUnless(hasattr(signal, "setitimer"), "requires setitimer()")
15 def test_all(self):
16 # Run the tester in a sub-process, to make sure there is only one
17 # thread (for reliable signal delivery).
18 tester = support.findfile("eintr_tester.py", subdir="eintrdata")
Victor Stinner4b352172015-09-18 11:29:16 +020019
20 if support.verbose:
21 args = [sys.executable, tester]
22 with subprocess.Popen(args) as proc:
23 exitcode = proc.wait()
24 self.assertEqual(exitcode, 0)
25 else:
26 script_helper.assert_python_ok(tester)
Charles-François Natali6e6c59b2015-02-07 13:27:50 +000027
28
29if __name__ == "__main__":
30 unittest.main()