spacevim/bundle/rust.vim/test/run-tests
JIe 2bb7059579
Some checks failed
Detach Plugins / check (FlyGrep.vim) (push) Has been cancelled
Detach Plugins / check (GitHub.vim) (push) Has been cancelled
Detach Plugins / check (JavaUnit.vim) (push) Has been cancelled
Detach Plugins / check (SourceCounter.vim) (push) Has been cancelled
Detach Plugins / check (cpicker.nvim) (push) Has been cancelled
Detach Plugins / check (dein-ui.vim) (push) Has been cancelled
Detach Plugins / check (git.vim) (push) Has been cancelled
Detach Plugins / check (iedit.vim) (push) Has been cancelled
Detach Plugins / check (scrollbar.vim) (push) Has been cancelled
Detach Plugins / check (vim-chat) (push) Has been cancelled
Detach Plugins / check (vim-cheat) (push) Has been cancelled
Detach Plugins / check (vim-todo) (push) Has been cancelled
Detach Plugins / check (xmake.vim) (push) Has been cancelled
test / Linux (nvim, nightly) (push) Has been cancelled
test / Linux (nvim, v0.3.8) (push) Has been cancelled
test / Linux (nvim, v0.4.0) (push) Has been cancelled
test / Linux (nvim, v0.4.2) (push) Has been cancelled
test / Linux (nvim, v0.4.3) (push) Has been cancelled
test / Linux (nvim, v0.4.4) (push) Has been cancelled
test / Linux (nvim, v0.5.0) (push) Has been cancelled
test / Linux (nvim, v0.5.1) (push) Has been cancelled
test / Linux (nvim, v0.6.0) (push) Has been cancelled
test / Linux (nvim, v0.6.1) (push) Has been cancelled
test / Linux (nvim, v0.7.0) (push) Has been cancelled
test / Linux (nvim, v0.7.2) (push) Has been cancelled
test / Linux (nvim, v0.8.0) (push) Has been cancelled
test / Linux (nvim, v0.8.1) (push) Has been cancelled
test / Linux (nvim, v0.8.2) (push) Has been cancelled
test / Linux (nvim, v0.8.3) (push) Has been cancelled
test / Linux (nvim, v0.9.0) (push) Has been cancelled
test / Linux (nvim, v0.9.1) (push) Has been cancelled
test / Linux (true, vim, v7.4.052) (push) Has been cancelled
test / Linux (true, vim, v7.4.1689) (push) Has been cancelled
test / Linux (true, vim, v7.4.629) (push) Has been cancelled
test / Linux (true, vim, v8.0.0027) (push) Has been cancelled
test / Linux (true, vim, v8.0.0183) (push) Has been cancelled
test / Linux (vim, nightly) (push) Has been cancelled
test / Linux (vim, v8.0.0184) (push) Has been cancelled
test / Linux (vim, v8.0.1453) (push) Has been cancelled
test / Linux (vim, v8.1.2269) (push) Has been cancelled
test / Linux (vim, v8.2.2434) (push) Has been cancelled
test / Linux (vim, v8.2.3995) (push) Has been cancelled
test / Windows (nvim, nightly) (push) Has been cancelled
test / Windows (nvim, v0.3.8) (push) Has been cancelled
test / Windows (nvim, v0.4.2) (push) Has been cancelled
test / Windows (nvim, v0.4.3) (push) Has been cancelled
test / Windows (nvim, v0.4.4) (push) Has been cancelled
test / Windows (nvim, v0.5.0) (push) Has been cancelled
test / Windows (nvim, v0.5.1) (push) Has been cancelled
test / Windows (nvim, v0.6.0) (push) Has been cancelled
test / Windows (nvim, v0.6.1) (push) Has been cancelled
test / Windows (nvim, v0.7.0) (push) Has been cancelled
test / Windows (nvim, v0.7.2) (push) Has been cancelled
test / Windows (nvim, v0.8.0) (push) Has been cancelled
test / Windows (nvim, v0.8.1) (push) Has been cancelled
test / Windows (nvim, v0.8.2) (push) Has been cancelled
test / Windows (nvim, v0.8.3) (push) Has been cancelled
test / Windows (nvim, v0.9.0) (push) Has been cancelled
test / Windows (nvim, v0.9.1) (push) Has been cancelled
test / Windows (vim, nightly) (push) Has been cancelled
test / Windows (vim, v7.4.1185) (push) Has been cancelled
test / Windows (vim, v7.4.1689) (push) Has been cancelled
test / Windows (vim, v8.0.0027) (push) Has been cancelled
test / Windows (vim, v8.0.1453) (push) Has been cancelled
test / Windows (vim, v8.1.2269) (push) Has been cancelled
test / Windows (vim, v8.2.2434) (push) Has been cancelled
test / Windows (vim, v8.2.3995) (push) Has been cancelled
docker / docker (push) Has been cancelled
mirror / check (coding) (push) Has been cancelled
mirror / check (gitee) (push) Has been cancelled
mirror / check (gitlab) (push) Has been cancelled
init
2024-08-21 14:17:26 +08:00

106 lines
2.7 KiB
Python

#!/usr/bin/env python
import os
import sys
REPO = "alonid/vim-testbed"
TAG = "10-rust.vim"
IMAGE = "%s:%s" % (REPO, TAG)
class Error(Exception):
pass
def system(cmd, capture=False, ok_fail=False):
if capture:
f = os.popen(cmd)
d = f.read()
return d
res = os.system(cmd)
if res != 0:
if ok_fail:
return res
raise Error("Error executing: %s" % (cmd, ))
return 0
def root():
return os.path.dirname(os.path.dirname(os.path.realpath(__file__)))
def prep():
d = os.path.join(root(), "test")
for i in [".cargo", ".rustup", ".multirust"]:
l = os.path.join(d, i)
if not os.path.lexists(l):
os.symlink("/rust/" + i, l)
l = os.path.join(root(), "test/.vimrc")
if not os.path.lexists(l):
os.symlink("vimrc", l)
if not os.path.exists(os.path.join(d, ".profile")):
f = open(os.path.join(d, ".profile"), "w")
f.write('export PATH="$HOME/.cargo/bin:$PATH"\n')
f.close()
def docker_run(cmd, interactive=False, ok_fail=False):
prep()
d = root()
params = "-v %s:/testplugin -v %s/test:/home/vimtest" % (d, d)
params += " -e HOME=/home/vimtest"
if not interactive:
params += " -a stderr"
params += " -e VADER_OUTPUT_FILE=/dev/stderr"
params += " -u %s" % (os.getuid(), )
params += " -w /testplugin"
if interactive:
interactive_str = "-it"
else:
interactive_str = ""
return system("docker run %s --rm %s %s %s" % (interactive_str, params, IMAGE, cmd),
ok_fail=ok_fail)
def image_exists():
r = system("docker images -q %s" % (IMAGE, ), capture=True)
return len(r.strip().splitlines()) >= 1
def tests_on_docker():
res = docker_run("bash -lc 'python /home/vimtest/run-tests inside-docker'", ok_fail=True)
if res == 0:
print("Tests OK")
else:
print("Tests Failed")
sys.exit(1)
def inside_docker():
res = system("/vim-build/bin/vim80 --not-a-term '+Vader! test/*.vader'", ok_fail=True)
if res != 0:
sys.exit(1)
def run_with_vimrc(vimrc):
res = system("vim -u %s --not-a-term '+Vader! test/*.vader'" % (vimrc, ), ok_fail=True)
if res != 0:
sys.exit(1)
def main():
if sys.argv[1:] == ["inside-docker"]:
inside_docker()
return
if sys.argv[1:2] == ["run-with-vimrc"]:
run_with_vimrc(sys.argv[2])
return
if not image_exists():
print("Need to take image from remote")
system("docker pull %s" % (IMAGE, ))
if "-i" in sys.argv[1:]:
docker_run("bash -l", interactive=True)
return
tests_on_docker()
if __name__ == "__main__":
main()