From ee5dc627d2a7913b1466de8f6ef4bea4eb42bd5c Mon Sep 17 00:00:00 2001 From: Nick <nicholas.curtis@uconn.edu> Date: Tue, 15 Jan 2019 11:47:29 -0500 Subject: [PATCH] update missing compiler test to actually execute a default toolchain --- test/test_c_execution.py | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/test/test_c_execution.py b/test/test_c_execution.py index c355893e4..bf168c11d 100644 --- a/test/test_c_execution.py +++ b/test/test_c_execution.py @@ -323,14 +323,24 @@ def test_missing_compilers(): b=np.arange(10, dtype=np.int32))[1], np.arange(10)) import os path_store = os.environ["PATH"] + ccomp = None try: # test with path wiped out such that we can't find gcc with pytest.raises(ExecError): os.environ["PATH"] = '' - __test(eval_tester, ExecutableCTarget) + ccomp = CCompiler() + __test(eval_tester, ExecutableCTarget, compiler=ccomp) finally: - # make sure we restore the path regardless for future testing + # make sure we restore the path os.environ["PATH"] = path_store + # and, with the path restored we should now be able to properly execute with + # the default (non-guessed) toolchain! + __test(eval_tester, ExecutableCTarget, compiler=ccomp) + + # and test that we will fail if we remove a required attribute + del ccomp.toolchain.undefines + with pytest.raises(AttributeError): + __test(eval_tester, ExecutableCTarget, compiler=ccomp) # next test that some made up compiler can be specified ccomp = CCompiler(cc='foo') -- GitLab