Commit e9637ef9 authored by Tristan Gingold's avatar Tristan Gingold

testsuite: factor code in test_all.py

parent 468bbb17
...@@ -50,15 +50,20 @@ def compare_makefile_filter(start): ...@@ -50,15 +50,20 @@ def compare_makefile_filter(start):
assert out == ref assert out == ref
os.remove('Makefile') os.remove('Makefile')
def compare_makefile_xilinx():
# HDLmake make the path absolute. Remove this line.
compare_makefile_filter("XILINX_INI_PATH")
def run_compare(**kwargs): def run_compare(**kwargs):
with Config(**kwargs) as _: with Config(**kwargs) as _:
hdlmake.main.hdlmake([]) hdlmake.main.hdlmake([])
compare_makefile() compare_makefile()
def run_compare_filter(filter, **kwargs):
with Config(**kwargs) as _:
hdlmake.main.hdlmake([])
compare_makefile_filter(filter)
def run_compare_xilinx(**kwargs):
# HDLmake make the path absolute. Remove this line.
run_compare_filter(filter="XILINX_INI_PATH", **kwargs)
def run(args, **kwargs): def run(args, **kwargs):
with Config(**kwargs) as _: with Config(**kwargs) as _:
hdlmake.main.hdlmake(args) hdlmake.main.hdlmake(args)
...@@ -116,20 +121,14 @@ def test_ghdl(): ...@@ -116,20 +121,14 @@ def test_ghdl():
run_compare(path="008ghdl") run_compare(path="008ghdl")
def test_icestorm(): def test_icestorm():
with Config(path="009icestorm") as _: run_compare_filter(filter="TOOL_PATH", path="009icestorm")
hdlmake.main.hdlmake([])
compare_makefile_filter("TOOL_PATH")
def test_isim010(): def test_isim010():
with Config(path="010isim") as _: run_compare_xilinx(path="010isim")
hdlmake.main.hdlmake([])
compare_makefile_xilinx()
def test_isim_windows060(): def test_isim_windows060():
with Config(path="060isim_windows", run_compare_xilinx(path="060isim_windows",
my_os='windows', fakebin="windows_fakebin") as _: my_os='windows', fakebin="windows_fakebin")
hdlmake.main.hdlmake([])
compare_makefile_xilinx()
def test_icarus012(): def test_icarus012():
run_compare(path="012icarus") run_compare(path="012icarus")
...@@ -340,9 +339,7 @@ def test_no_files(): ...@@ -340,9 +339,7 @@ def test_no_files():
run([], path="042nofiles") run([], path="042nofiles")
def test_no_bin_061(): def test_no_bin_061():
with Config(path="061err_nobin", fakebin="no_fakebin") as _: run_compare_xilinx(path="061err_nobin", fakebin="no_fakebin")
hdlmake.main.hdlmake([])
compare_makefile_xilinx()
def test_local043(): def test_local043():
run_compare(path="043local_fetch") run_compare(path="043local_fetch")
...@@ -538,18 +535,14 @@ def test_multi_sat(): ...@@ -538,18 +535,14 @@ def test_multi_sat():
run_compare(path="093multi_sat") run_compare(path="093multi_sat")
def test_sys_package_097(): def test_sys_package_097():
with Config(path="097sys_package") as _: run_compare_xilinx(path="097sys_package")
hdlmake.main.hdlmake([])
compare_makefile_xilinx()
def test_vhdl_libraries_ise_113(): def test_vhdl_libraries_ise_113():
run_compare(path="113_ise_libraries") run_compare(path="113_ise_libraries")
def test_vhdl_libraries_GHDLSyn_115(): def test_vhdl_libraries_GHDLSyn_115():
with Config(path="115_ghdlsyn_libraries") as _: run_compare_filter(filter="TOOL_PATH", path="115_ghdlsyn_libraries")
hdlmake.main.hdlmake([])
compare_makefile_filter("TOOL_PATH")
@pytest.mark.xfail @pytest.mark.xfail
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment