dhbw-abb-typst-template/run-ci.sh

34 lines
773 B
Bash
Raw Normal View History

2024-07-01 14:17:54 +00:00
#!/bin/bash
function abort() {
echo "test case `$1` has failed" 1>&2
exit 1
}
echo "Compiling template..."
typst compile template/main.typ --root . || abort "template"
2024-07-01 14:17:54 +00:00
echo "Running tests..."
2024-07-01 17:25:45 +00:00
echo "Running test local-import..."
2024-07-01 14:17:54 +00:00
typst compile tests/local-import/main.typ --root . || abort "local-import"
echo "Running test invalid-config..."
echo "Expected to fail..."
typst compile tests/invalid-config/test-case-1.typ --root .
if [ $? -eq 0 ]; then
abort "invalid-config case 1"
fi
typst compile tests/invalid-config/test-case-2.typ --root . || abort "invalid-config case 2"
echo "Expected to fail..."
typst compile tests/invalid-config/test-case-3.typ --root .
if [ $? -eq 0 ]; then
abort "invalid-config case 3b"
fi
2024-07-01 14:17:54 +00:00
echo "Tests completed successfully"