Skip to content

Commit 4da779b

Browse files
authored
[mypyc] Make C unit tests faster by compiling with -O0 (#17884)
Most time is spent in compilation, so runtime performance doesn't really matter.
1 parent 13d6738 commit 4da779b

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

Diff for: mypyc/test/test_external.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,9 @@ def test_c_unit_test(self) -> None:
2020
cppflags: list[str] = []
2121
env = os.environ.copy()
2222
if sys.platform == "darwin":
23-
cppflags += ["-mmacosx-version-min=10.10", "-stdlib=libc++"]
23+
cppflags += ["-O0", "-mmacosx-version-min=10.10", "-stdlib=libc++"]
24+
elif sys.platform == "linux":
25+
cppflags += ["-O0"]
2426
env["CPPFLAGS"] = " ".join(cppflags)
2527
# Build Python wrapper for C unit tests.
2628

0 commit comments

Comments
 (0)