Commit 6be11c94 authored by Tristan Gingold's avatar Tristan Gingold

testsuite: improve testing of gitsm

parent 1a91c34f
action = "simulation"
sim_tool="modelsim"
top_module = "gate"
fetchto = "ipcores"
files = [ "../files/gate.vhdl" ]
modules = { "gitsm" : "git@test.org:tester/module2.git" }
......@@ -5,11 +5,13 @@ import shutil
argv = sys.argv[1:]
# For debugging...
#sys.stderr.write("fake git: {}\n".format(argv))
if len(argv) == 0:
print("fake git version 0.0")
sys.exit(1)
if argv[0] == 'clone':
print("fake git clone: {}".format(argv[1:]))
if len(argv) == 2:
# Get the basename of the module
name = argv[1]
......@@ -20,6 +22,9 @@ if argv[0] == 'clone':
print("fake git cloning {} from {}".format(name, modpath))
# Copy all the files
shutil.copytree(modpath, name)
if os.path.exists(os.path.join(name, 'gitmodules')):
shutil.move(os.path.join(name, 'gitmodules'),
os.path.join(name, '.gitmodules'))
sys.exit(0)
else:
print("unhandled fake git clone")
......@@ -29,6 +34,12 @@ elif argv[0] == 'submodule':
sys.exit(0)
elif argv[1:] == ['update', '--recursive']:
sys.exit(0)
elif argv == ['config', '-f', '.gitmodules', '--list']:
sys.stdout.write(open('.gitmodules', 'r').read())
sys.exit(0)
elif argv == ['rev-parse', '--show-toplevel']:
print("..")
print("fake git unknown command: {}".format(argv))
sys.exit(1)
submodule.modules/module1.url=http://test.org/module1.git
submodule.modules/module1.path=ipcores/module1
entity mod1 is
port (i : bit;
o : out bit);
end mod1;
architecture arch of mod1 is
begin
o <= i;
end arch;
......@@ -144,6 +144,11 @@ def test_vlog_parser():
def test_vlog_parser025():
run_compare(path="025vlog_parser")
def test_gitsm_fetch026():
with Config(path="026gitsm_fetch") as _:
hdlmake.__main__.hdlmake(['fetch'])
shutil.rmtree('ipcores')
@pytest.mark.xfail
def test_xfail():
"""This is a self-consistency test: the test is known to fail"""
......
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