Skip to content

Commit 4527b4f

Browse files
committed
TST: Tests for build -j auto
1 parent bbd9a40 commit 4527b4f

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

spin/tests/test_build_cmds.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,20 @@ def test_debug_builds(example_pkg):
3636
assert len(list(debug_files)) != 0, "debug files not generated for gcov build"
3737

3838

39+
def test_build_jobs_auto(example_pkg):
40+
"""Does `spin build -j auto` work?"""
41+
p = spin("build", "-j", "auto")
42+
assert b"Building with" in p.stdout
43+
assert b"parallel jobs" in p.stdout
44+
45+
46+
def test_build_jobs_invalid(example_pkg):
47+
"""Does `spin build -j nan` fail with a clear error?"""
48+
p = spin("build", "-j", "nan", sys_exit=False)
49+
assert p.returncode != 0
50+
assert b"Expected an integer or 'auto'" in p.stderr
51+
52+
3953
def test_prefix_builds(example_pkg):
4054
"""does spin build --prefix create a build-install directory with the correct structure?"""
4155
spin("build", "--prefix=/foobar/")

0 commit comments

Comments
 (0)