diff options
author | Lars Wirzenius <liw@liw.fi> | 2023-05-05 09:24:02 +0300 |
---|---|---|
committer | Lars Wirzenius <liw@liw.fi> | 2023-05-05 09:24:02 +0300 |
commit | 7ccf78bebe74eb9eca3e2b2390c6f367f3991523 (patch) | |
tree | e3cafa8be092d061fca5733a0e8cfc3db76381b7 | |
parent | 85e26c059c4d0551513fdb3e40ee6f747dd0215e (diff) | |
download | vmdb2-7ccf78bebe74eb9eca3e2b2390c6f367f3991523.tar.gz |
tests: simplify scripts, put back document formatting
Drop attempts to use Subplot. It's not happening now, maybe later.
Sponsored-by: author
-rwxr-xr-x | check | 41 | ||||
-rwxr-xr-x | check-all | 15 | ||||
-rwxr-xr-x | format.sh | 25 |
3 files changed, 47 insertions, 34 deletions
@@ -2,20 +2,11 @@ set -euo pipefail -hideok=chronic -if ! command -v chronic >/dev/null; then - hideok= -fi -if [ "$#" -gt 0 ] && [ "$1" = -v ]; then - hideok= - shift -fi - -$hideok echo Running unit tests ============================================ -$hideok python3 -m CoverageTestRunner --ignore-missing-from=without-tests yarns vmdb -$hideok echo +echo Running unit tests ============================================ +python3 -m CoverageTestRunner --ignore-missing-from=without-tests yarns vmdb +echo -$hideok echo Checking every plugin looks OK ============================================ +echo Checking every plugin looks OK ============================================ for file in vmdb/plugins/*.py; do case "$file" in *_plugin.py) ;; @@ -29,27 +20,15 @@ for file in vmdb/plugins/*.py; do exit 1 fi done -$hideok echo - -if command -v sp-codegen >/dev/null; then - $hideok echo Running Subplot ============================================ - $hideok sp-codegen vmdb2.md -o test.py --run - $hideok echo -fi +echo -$hideok echo Running yarn tests ======================================== -if python3 -c 'import yarnutils' 2>/dev/null; then - $hideok yarn \ - --shell=python3 \ - --shell-arg '' \ - --shell-library yarns/lib.py \ - --env "PYTHONPATH=$(pwd)/yarns" \ - --cd-datadir \ - yarns/*.yarn "$@" - $hideok echo +if false && command -v subplot >/dev/null; then + echo Running Subplot ============================================ + subplot vmdb2.md -o test.py --run + echo fi -$hideok echo Formatting docs ======================================== +echo Formatting docs ======================================== ./format.sh plugindocs() { @@ -2,11 +2,20 @@ set -euo pipefail +hideok=chronic +if ! command -v chronic >/dev/null; then + hideok= +fi +if [ "$#" -gt 0 ] && [ "$1" = -v ]; then + hideok= + shift +fi + cachedir="$1" cd "$(dirname "$0")" -./check -./check-images "$cachedir" -./check-external "$cachedir" +$hideok ./check +$hideok ./check-images "$cachedir" +$hideok ./check-external "$cachedir" echo "All tests PASS" diff --git a/format.sh b/format.sh new file mode 100755 index 0000000..2a52b33 --- /dev/null +++ b/format.sh @@ -0,0 +1,25 @@ +#!/bin/sh + +set -eu + +cleanup() { + rm -f tmp.md +} + +trap cleanup EXIT + +( + cat vmdb2.md + for x in vmdb/plugins/*.mdwn; do + cat "$x" + echo + done +) >tmp.md +pandoc \ + --self-contained \ + --standalone \ + --css vmdb2.css \ + --toc \ + --number-sections \ + -o vmdb2.html \ + tmp.md |