add lit filecheck

master
Anton Lydike 2 years ago
parent 0c37be3c4d
commit 189dc63ceb

@ -39,6 +39,9 @@ jobs:
- name: Test with pytest - name: Test with pytest
run: | run: |
pytest -W error pytest -W error
- name: Test with lit
run: |
lit -v test/filecheck
#- name: Execute lit tests #- name: Execute lit tests
# run: | # run: |

@ -1,3 +1,5 @@
black==23.3.0 black==23.3.0
pre-commit==3.2.2 pre-commit==3.2.2
pytest==7.3.1 pytest==7.3.1
filecheck==0.0.23
lit==16.0.2

@ -0,0 +1 @@
8.836818e-02 hello-world.asm

@ -0,0 +1,15 @@
// RUN: python3 -m riscemu -v %s | filecheck %s
.data
msg: .ascii "Hello world\n"
.text
addi a0, zero, 1 // print to stdout
addi a1, zero, msg // load msg address
addi a2, zero, 12 // write 12 bytes
addi a7, zero, SCALL_WRITE // write syscall code
scall
addi a0, zero, 0 // set exit code to 0
addi a7, zero, SCALL_EXIT // exit syscall code
scall
// CHECK: Hello world
// CHECK: [CPU] Program exited with code 0

@ -0,0 +1,10 @@
import lit.formats
import os
config.test_source_root = os.path.dirname(__file__)
xdsl_src = os.path.dirname(os.path.dirname(config.test_source_root))
config.name = "riscemu"
config.test_format = lit.formats.ShTest(preamble_commands=[f"cd {xdsl_src}"])
config.suffixes = ['.asm']
Loading…
Cancel
Save