Skip to content

Commit ca389cb

Browse files
committed
work on macos
1 parent 1cf4530 commit ca389cb

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

graalpython/com.oracle.graal.python.test/src/tests/test_tagged_unittests.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,11 +100,17 @@ def fun():
100100
else:
101101
glob_pattern = os.path.join(os.path.dirname(test.__file__), "test_*.py")
102102

103+
p = subprocess.run(["/usr/bin/which", "timeout"], **kwargs)
104+
if p.returncode != 0:
105+
print("Cannot find the 'timeout' GNU tool. Do you have coreutils installed?")
106+
sys.exit(1)
107+
timeout = p.stdout.strip()
108+
103109
testfiles = glob.glob(glob_pattern)
104110
for idx, testfile in enumerate(testfiles):
105111
testfile_stem = os.path.splitext(os.path.basename(testfile))[0]
106112
testmod = "test." + testfile_stem
107-
cmd = ["/usr/bin/timeout", "-s", "9", "60"] + executable + ["-m"]
113+
cmd = [timeout, "-s", "9", "60"] + executable + ["-m"]
108114
tagfile = os.path.join(TAGS_DIR, testfile_stem + ".txt")
109115
test_selectors = working_selectors(tagfile)
110116

0 commit comments

Comments
 (0)