Skip to content

Commit 665390d

Browse files
roxellbhcopeland
authored andcommitted
test: add test for missing user-supplied CROSS_COMPILE
Check that CompilerNotFoundError names the right compiler when the user passes CROSS_COMPILE and the compiler is not found. Suggested-by: Ben Copeland <ben.copeland@linaro.org> Signed-off-by: Anders Roxell <anders.roxell@linaro.org>
1 parent a7e97db commit 665390d

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

test/test_build.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -914,6 +914,16 @@ def test_null_runtime_cross_compile_override(self, linux, mocker):
914914
assert build.runtime.name == "null"
915915
which.assert_called_with("arm-linux-gnueabi-gcc")
916916

917+
def test_null_runtime_cross_compile_not_found(self, linux, mocker):
918+
mocker.patch("shutil.which", return_value=None)
919+
with pytest.raises(tuxmake.exceptions.CompilerNotFoundError, match="foo-gcc"):
920+
Build(
921+
tree=linux,
922+
target_arch="arm",
923+
toolchain="gcc",
924+
make_variables={"CROSS_COMPILE": "foo-"},
925+
)
926+
917927

918928
class TestDebug:
919929
def test_no_debug_without_debug_options(self, linux, capfd):

0 commit comments

Comments
 (0)