Skip to content

Commit 7c64ccf

Browse files
andreasttAutomatedTester
authored andcommitted
make: move validation to Makefile and add respec test
1 parent e65af93 commit 7c64ccf

File tree

2 files changed

+21
-16
lines changed

2 files changed

+21
-16
lines changed

Makefile

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
.DEFAULT_GOAL = test
2+
.PHONY: test validate respec
3+
4+
VALIDATOR ?= https://validator.w3.org/nu/
5+
VALIDATOR_OPTS ?= -F laxtype=yes -F parser=html5 -F level=error
6+
7+
curl = curl -sSLf
8+
respec = respec2html --disable-sandbox -ew
9+
10+
out := $(shell mktemp)
11+
12+
test: validate respec
13+
14+
validate: index.html
15+
@$(curl) $(VALIDATOR_OPTS) -F out=gnu -F doc=@$< $(VALIDATOR) | sed -e 's/^"$<"/$</g' >$(out)
16+
@cat $(out)
17+
@trap 'rm -rf $(out)' EXIT
18+
@test -z "$(shell cat $(out))"
19+
20+
respec: index.html
21+
@$(respec) -s $< -o /dev/null

validate

Lines changed: 0 additions & 16 deletions
This file was deleted.

0 commit comments

Comments
 (0)