Add basic tests. #3
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
on: [push, pull_request] | |
name: Continuous integration | |
jobs: | |
check: | |
name: Check | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: actions-rs/toolchain@v1 | |
with: | |
profile: minimal | |
toolchain: stable | |
override: true | |
- uses: actions-rs/cargo@v1 | |
with: | |
command: check | |
test: | |
name: Unit tests | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: actions-rs/toolchain@v1 | |
with: | |
profile: minimal | |
toolchain: stable | |
override: true | |
- uses: actions-rs/cargo@v1 | |
with: | |
command: test | |
validate: | |
name: Run testcases | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: actions-rs/toolchain@v1 | |
with: | |
profile: minimal | |
toolchain: stable | |
override: true | |
- uses: actions-rs/cargo@v1 | |
with: | |
command: build --release -- | |
- name: Test assembling | |
run: | | |
cargo run --release -- testcases/assembly_basic_instructions.wsa -t -f asm -o testcases/assembly_basic_instructions.2.ws | |
diff -u testcases/assembly_basic_instructions.ws testcases/assembly_basic_instructions.2.ws | |
- name: Test disassembling | |
run: | | |
cargo run --release -- testcases/assembly_basic_instructions.ws -t -f ws -o testcases/assembly_basic_instructions.2.wsa | |
diff -u testcases/assembly_basic_instructions.wsa testcases/assembly_basic_instructions.2.wsa | |
- name: Test running a known working whitespace program | |
run: | | |
cargo run --release -- testcases/big-quine.ws -o testcases/big-quine.2.ws | |
diff -u testcases/big-quine.ws testcases/big-quine.2.ws |