From a7d5a284865c5ea67d6f6d93f03db17d8aab4732 Mon Sep 17 00:00:00 2001 From: Unai Martinez-Corral Date: Mon, 30 May 2022 16:21:52 +0200 Subject: [PATCH] test: wrappers without F4PGA_INSTALL_DIR (exception expected) Signed-off-by: Unai Martinez-Corral --- test/test_wrappers.py | 52 ++++++++++++++++++++++++++++++------------- 1 file changed, 36 insertions(+), 16 deletions(-) diff --git a/test/test_wrappers.py b/test/test_wrappers.py index 069c1b9..d6ce1bb 100644 --- a/test/test_wrappers.py +++ b/test/test_wrappers.py @@ -1,28 +1,31 @@ +from os import environ from pytest import mark from sys import stdout, stderr from subprocess import check_call +wrappers = [ + 'symbiflow_generate_constraints', + 'symbiflow_pack', + 'symbiflow_place', + 'symbiflow_route', + 'symbiflow_synth', + 'symbiflow_write_bitstream', + 'symbiflow_write_fasm', + 'symbiflow_write_xml_rr_graph', + 'vpr_common', + 'symbiflow_analysis', + 'symbiflow_repack', + 'symbiflow_generate_bitstream', + 'symbiflow_generate_libfile', + 'ql_symbiflow' +] + @mark.xfail @mark.parametrize( "wrapper", - [ - 'symbiflow_generate_constraints', - 'symbiflow_pack', - 'symbiflow_place', - 'symbiflow_route', - 'symbiflow_synth', - 'symbiflow_write_bitstream', - 'symbiflow_write_fasm', - 'symbiflow_write_xml_rr_graph', - 'vpr_common', - 'symbiflow_analysis', - 'symbiflow_repack', - 'symbiflow_generate_bitstream', - 'symbiflow_generate_libfile', - 'ql_symbiflow' - ] + wrappers ) def test_shell_wrapper(wrapper): print(f"\n::group::Test {wrapper}") @@ -32,3 +35,20 @@ def test_shell_wrapper(wrapper): check_call(f"{wrapper}") finally: print("\n::endgroup::") + +@mark.xfail +@mark.parametrize( + "wrapper", + wrappers +) +def test_shell_wrapper_without_F4PGA_INSTALL_DIR(wrapper): + test_environ = environ.copy() + del test_environ['F4PGA_INSTALL_DIR'] + + print(f"\n::group::Test {wrapper}") + stdout.flush() + stderr.flush() + try: + check_call(f"{wrapper}", env=test_environ) + finally: + print("\n::endgroup::")