fixed failing tests
Gitea Action for checking typst compilation / run-ci-linux (push) Successful in 1m41s Details

This commit is contained in:
Sven Vogel 2024-08-27 20:54:33 +02:00
parent 6c8f94e4b7
commit dabe0a2ef5
5 changed files with 71 additions and 61 deletions

View File

@ -26,8 +26,17 @@ function enter-section() {
eval "$2"
exit_status=$?
if ! [ $exit_status -eq $3 ]; then
abort "command: $2 failed in section: $1"
if [ "$3" == "should fail" ]; then
log "INFO" "expected to fail..."
if [ $exit_status -eq 0 ]; then
abort "command: $2 failed in section: $1 with: $exit_status"
fi
else
log "INFO" "expected to pass..."
if [ ! $exit_status -eq 0 ]; then
abort "command: $2 failed in section: $1 with: $exit_status"
fi
fi
printf "\\n"
@ -36,10 +45,10 @@ function enter-section() {
enter-section "Typstyle checking" "./run-fmt.sh --check src/lib.typ" 0
enter-section "BUILD: ABB code theme" "./generate-theme.sh" 0
enter-section "Compiling template..." "typst compile template/main.typ --root . example.pdf" 0
enter-section "TEST: local template import" "typst compile tests/local-import/main.typ --root ." 0
enter-section "TEST: invalid config case 1" "typst compile tests/invalid-config/test-case-1.typ --root ." 1
enter-section "TEST: invalid config case 2" "compile tests/invalid-config/test-case-2.typ" 0
enter-section "TEST: invalid config case 3" "typst compile tests/invalid-config/test-case-3.typ --root ." 1
enter-section "Compiling template..." "typst compile template/main.typ --root . example.pdf"
enter-section "TEST: local template import" "typst compile tests/local-import/main.typ --root ."
enter-section "TEST: invalid config case 1" "typst compile tests/invalid-config/test-case-1.typ --root ." "should fail"
enter-section "TEST: invalid config case 2" "typst compile tests/invalid-config/test-case-2.typ --root ."
enter-section "TEST: invalid config case 3" "typst compile tests/invalid-config/test-case-3.typ --root ." "should fail"
log "INFO" "CI completed successfully"

View File

@ -1,8 +1,7 @@
#import "../../src/lib.typ": dhbw-template
#show: dhbw-template.with(
config: (
#show: dhbw-template.with((
lang: none,
region: "en",
author: (

View File

@ -1,8 +1,7 @@
#import "../../src/lib.typ": dhbw-template
#show: dhbw-template.with(
config: (
#show: dhbw-template.with((
lang: "en",
this-key-is-not-in-config: "Ha Ha",
region: "en",
@ -15,7 +14,8 @@
university: "DHBW Mannheim",
company: "ABB AG",
supervisor: "Benny Goodman",
matriculation-number: 123456789),
matriculation-number: 123456789,
),
thesis: (
title: "Unofficial ABB/DHBW Typst template",
subtitle: "for reports and thesises",
@ -24,7 +24,9 @@
kind: "T2000",
summary: none,
abstract: none,
keywords: ( "IT", "other stuff" ),
keywords: ("IT", "other stuff"),
bibliography: none,
glossary: none,
appendices: none)))
appendices: none,
),
))

View File

@ -1,15 +1,15 @@
#import "../../src/lib.typ": dhbw-template
#show: dhbw-template.with(
config: (
#show: dhbw-template.with((
lang: "en",
region: "en",
author: (
university: "DHBW Mannheim",
company: "ABB AG",
supervisor: none,
matriculation-number: 123456789),
matriculation-number: 123456789,
),
thesis: (
title: "Unofficial ABB/DHBW Typst template",
subtitle: "for reports and thesises",
@ -18,7 +18,9 @@
kind: "T2000",
summary: none,
abstract: none,
keywords: ( "IT", "other stuff" ),
keywords: ("IT", "other stuff"),
bibliography: none,
glossary: none,
appendices: none)))
appendices: none,
),
))

View File

@ -1,7 +1,7 @@
#import "../../src/lib.typ": dhbw-template
#show: dhbw-template((
#show: dhbw-template.with((
lang: "en",
region: "en",
author: (
@ -23,6 +23,4 @@
glossary: none,
appendices: none,
),
))[
test
]
))