File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -441,9 +441,11 @@ Local verification:
441441
442442``` sh
443443bash scripts/check.sh
444+ RSSCRIPT_FULL_TESTS=1 bash scripts/check.sh
445+ bash scripts/run_examples.sh
444446```
445447
446- CI sets ` RSSCRIPT_FULL_TESTS=1 ` so the same script runs full ` cargo test --workspace ` .
448+ CI sets ` RSSCRIPT_FULL_TESTS=1 ` so the same script runs full ` cargo test --workspace ` and executes every ` examples/*.rss ` file through ` rss run ` .
447449
448450---
449451
Original file line number Diff line number Diff line change @@ -14,6 +14,7 @@ cargo check --manifest-path tests/generated/runnable/Cargo.toml
1414
1515if [[ " ${RSSCRIPT_FULL_TESTS:- 0} " == " 1" ]]; then
1616 cargo test --workspace
17+ bash scripts/run_examples.sh
1718else
1819 cargo test --workspace --no-run
1920fi
Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+ set -euo pipefail
3+
4+ ROOT=" $( cd " $( dirname " ${BASH_SOURCE[0]} " ) /.." && pwd) "
5+ cd " $ROOT "
6+
7+ cleanup_example_artifacts () {
8+ rm -f \
9+ rsscript-buffer-consume.txt \
10+ rsscript-cache-image-input.bin \
11+ rsscript-cache-image-output.bin \
12+ rsscript-config-first.txt \
13+ rsscript-config-second.txt \
14+ rsscript-csv-example.csv \
15+ rsscript-file-copy-input.txt \
16+ rsscript-file-copy-output.txt \
17+ rsscript-image-input.bin \
18+ rsscript-image-output.bin \
19+ rsscript-rules-first.txt \
20+ rsscript-rules-second.txt
21+ }
22+
23+ cleanup_example_artifacts
24+ trap cleanup_example_artifacts EXIT
25+
26+ shopt -s nullglob
27+ examples=(examples/* .rss)
28+
29+ if [[ " ${# examples[@]} " == " 0" ]]; then
30+ echo " no examples found" >&2
31+ exit 1
32+ fi
33+
34+ for example in " ${examples[@]} " ; do
35+ echo " run $example "
36+ cargo run --quiet -- run " $example "
37+ done
You can’t perform that action at this time.
0 commit comments