aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEdwin Török <[email protected]>2023-12-19 19:16:42 +0000
committerJohn MacFarlane <[email protected]>2023-12-19 15:00:23 -0800
commitc6892bec243fd3c8118fa87885455a7e6ce87f78 (patch)
tree0b18c2b6345e2e47fb87a20af16bcf85aea8ecc1
parent0e86a84e3323980dd8a0071d6ad901179cdc4a35 (diff)
ci(validate-docx-golden-tests2): fail on errors
The validator just prints errors, but always exited with nonzero. Signed-off-by: Edwin Török <[email protected]>
-rw-r--r--Makefile2
-rw-r--r--tools/validate-docx2.sh10
2 files changed, 11 insertions, 1 deletions
diff --git a/Makefile b/Makefile
index 2684d4284..e873aaf59 100644
--- a/Makefile
+++ b/Makefile
@@ -249,7 +249,7 @@ validate-docx-golden-tests2: ## validate docx golden tests using OOXMLValidator
test -d ./OOXML-Validator || \
(git clone https://github.com/mikeebowen/OOXML-Validator.git \
&& cd OOXML-Validator && dotnet build --configuration=Release)
- dotnet run --configuration=Release --no-build --no-restore --project OOXML-Validator/OOXMLValidatorCLI -- test/docx/golden -r | json_reformat
+ sh ./tools/validate-docx2.sh test/docx/golden/
.PHONY: validate-docx-golden-tests2
validate-epub: ## generate an epub and validate it with epubcheck
diff --git a/tools/validate-docx2.sh b/tools/validate-docx2.sh
new file mode 100644
index 000000000..65827452e
--- /dev/null
+++ b/tools/validate-docx2.sh
@@ -0,0 +1,10 @@
+#!/bin/bash
+
+set -eu
+
+(for i in "$@"; do
+ dotnet run --configuration=Release --no-build --no-restore --project OOXML-Validator/OOXMLValidatorCLI -- "${i}" -r
+done) >validation
+json_reformat -s <validation
+
+[ $(cat validation | wc -c) = 2 ]