aboutsummaryrefslogtreecommitdiff
path: root/tests/linting.sh
blob: b18c0f6a7e214310fbaf2c9caf15bc06cf564eca (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#!/bin/sh
set -u

. tests/lib.sh

TD='../../../src/td'
for d in tests/lint-resources/*; do
	testing "lint of $d"
	cd "$d"

	N="$LINENO"
	OUT="$(mkstemp)"
	ERR="$(mkstemp)"
	LANG=POSIX.UTF-8 "$TD" -L 1>"$OUT" 2>"$ERR"
	STATUS=$?
	assert_status "$(cat status.txt 2>/dev/null || echo 0)"
	assert_empty_stdout
	assert_stderr "$(cat err.txt 2>/dev/null)"

	cd - >/dev/null
	test_ok
done