File: update-expected

package info (click to toggle)
secnet 0.6.7
  • links: PTS
  • area: main
  • in suites: bookworm, trixie
  • size: 1,956 kB
  • sloc: ansic: 15,234; python: 1,057; perl: 966; sh: 596; tcl: 484; java: 231; asm: 114; yacc: 89; php: 64; makefile: 48; awk: 40
file content (23 lines) | stat: -rwxr-xr-x 609 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/bin/sh
# subdirmk - part of the test suite
#  Copyright 2019 Mark Wooding
#  Copyright 2019 Ian Jackson
# SPDX-License-Identifier: LGPL-2.0-or-later
# There is NO WARRANTY.
#
# Usual approach to updating the expected outputs is
#   tests/filter/check
#   tests/filter/update-expected
#   selectively git-add the things that are right, after inspecting them

set -e
files=$(find tests/filter -name \*.expected.tmp)
for f in $files; do
	perl -pe '
		(s/\n//, $stripnl=0) if $stripnl;
		next unless /^# doctests start/../^# doctests end/;
		$_="";
		$stripnl=1;
	' \
		<${f%.expected.tmp}.tmp >${f%.tmp}
done