Skip to content

Commit 2c11df1

Browse files
committed
fix test_posixtime for v8, which lacks monotonic time, and add testing for that path
1 parent 67fe60f commit 2c11df1

File tree

3 files changed

+25
-3
lines changed

3 files changed

+25
-3
lines changed
File renamed without changes.
+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
Tests for clockid_t=0
2+
-----------------
3+
clock_getres resolution OK
4+
clock_gettime OK
5+
clock_settime failed with EPERM (OK)
6+
7+
Tests for clockid_t=1
8+
-----------------
9+
clock_getres failed
10+
clock_gettime failed
11+
clock_settime failed with EINVAL (OK)
12+
13+
Tests for clockid_t=42
14+
-----------------
15+
clock_gettime failed with EINVAL (OK)
16+
clock_getres failed with EINVAL (OK)
17+
clock_settime failed with EINVAL (OK)

tests/test_core.py

+8-3
Original file line numberDiff line numberDiff line change
@@ -4634,14 +4634,19 @@ def test_unistd_misc(self):
46344634

46354635
def test_posixtime(self):
46364636
test_path = path_from_root('tests', 'core', 'test_posixtime')
4637-
src, output = (test_path + s for s in ('.in', '.out'))
4638-
4637+
src, output = (test_path + s for s in ('.c', '.out'))
4638+
self.banned_js_engines = [V8_ENGINE] # v8 lacks monotonic time
46394639
self.do_run_from_file(src, output)
46404640

4641+
if V8_ENGINE in JS_ENGINES:
4642+
self.banned_js_engines = filter(lambda engine: engine != V8_ENGINE, JS_ENGINES)
4643+
self.do_run_from_file(src, test_path + '_no_monotonic.out')
4644+
else:
4645+
print '(no v8, skipping no-monotonic case)'
4646+
46414647
def test_uname(self):
46424648
test_path = path_from_root('tests', 'core', 'test_uname')
46434649
src, output = (test_path + s for s in ('.in', '.out'))
4644-
46454650
self.do_run_from_file(src, output)
46464651

46474652
def test_env(self):

0 commit comments

Comments
 (0)