More complex GitLab pipeline.

parent df35db56
Pipeline #55580782 passed with stages
in 30 minutes and 42 seconds
image: debian:stable
before_script:
- apt-get update -qq && apt-get install -y -qq build-essential nasm qemu-system-x86 python3 gcc-multilib git
- git submodule update --init --recursive
- cd http && python3 -m http.server 8080 &
- apt-get update -qq && apt-get install -y -qq build-essential nasm qemu-system-x86 python3 gcc-multilib git
- git submodule update --init --recursive
- cd http && python3 -m http.server 8080 &
run_qemu:
stages:
- build
- test
build:
stage: build
script:
- make
- ls -l build/asmg.x86.exe build/asmg_dbg.x86.exe
tests:
stage: test
script:
- rm -fr build
- sed -i -e 's|const RUN_MM0 1|const RUN_MM0 0|' asmg/main.g
- sed -i -e 's|const RUN_TINYCC 1|const RUN_TINYCC 0|' asmg/main.g
- make
- "(qemu-system-i386 -hda build/boot_asmg.x86 -serial stdio -device isa-debug-exit -display none -m 256M || true) | ./test/decode_tests.py"
mm0:
stage: test
script:
- rm -fr build
- sed -i -e 's|const TEST_ALL 1|const TEST_ALL 0|' asmg/main.g
- sed -i -e 's|const RUN_TINYCC 1|const RUN_TINYCC 0|' asmg/main.g
- make
- "(qemu-system-i386 -hda build/boot_asmg.x86 -serial stdio -device isa-debug-exit -display none -m 256M || true) | ./test/decode_tests.py just_malloc"
tinycc:
stage: test
script:
- make
- qemu-system-i386 -hda build/boot_asmg.x86 -serial stdio -device isa-debug-exit -display none -m 256M | ./test/decode_tests.py
- ls -l build/asmg.x86.exe build/asmg_dbg.x86.exe
- rm -fr build
- sed -i -e 's|const TEST_ALL 1|const TEST_ALL 0|' asmg/main.g
- sed -i -e 's|const RUN_MM0 1|const RUN_MM0 0|' asmg/main.g
- make
- "(qemu-system-i386 -hda build/boot_asmg.x86 -serial stdio -device isa-debug-exit -display none -m 256M || true) | ./test/decode_tests.py just_malloc"
......@@ -31,6 +31,8 @@ TEST_RE = re.compile("Testing ([^ ]*) in file ([^ ]*)... ([^ ]*)!")
MALLOC_RE = re.compile("0 malloc-ed regions were never free-d")
def main():
just_malloc = "just_malloc" in sys.argv
test_num = 0
test_success = 0
malloc_ok = False
......@@ -48,13 +50,14 @@ def main():
if MALLOC_RE.match(line):
malloc_ok = True
if test_num == 0:
print("No test detected, failing...")
sys.exit(2)
if test_num != test_success:
print("Only {} / {} tests succeeded, how bad...".format(test_success, test_num))
sys.exit(1)
print("All {} tests succeeded, very good! :-)".format(test_num))
if not just_malloc:
if test_num == 0:
print("No test detected, failing...")
sys.exit(2)
if test_num != test_success:
print("Only {} / {} tests succeeded, how bad...".format(test_success, test_num))
sys.exit(1)
print("All {} tests succeeded, very good! :-)".format(test_num))
if not malloc_ok:
print("Some malloc-ed region was not free-d, that's terrible...")
......
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