1 #! /usr/bin/ksh93
2 #
3 #
4 # This file and its contents are supplied under the terms of the
5 # Common Development and Distribution License ("CDDL"), version 1.0.
6 # You may only use this file in accordance with the terms of version
7 # 1.0 of the CDDL.
8 #
9 # A full copy of the text of the CDDL should have accompanied this
10 # source. A copy of the CDDL is also available via the Internet at
11 # http://www.illumos.org/license/CDDL.
12 #
13
14 #
15 # Copyright 2018, Joyent, Inc.
16 #
17
18 AWK=/usr/bin/nawk
19 WORKDIR=$(mktemp -d /tmp/nawktest.XXXXXX)
20
21 SUCCESSES=0
22 TOTAL=0
23
24 function proctemplate {
25 bash <<-EOF
26 IFS= read -rd '' OUTPUT < $1;
27 printf "%s" "\${OUTPUT//\\\$AWK/\$AWK}";
28 EOF
29 }
30
31 while [[ $# -gt 0 ]]; do
32 case $1 in
33 -o)
34 AWK=$2
35 shift 2
36 ;;
37 *)
38 printf 'Usage: runtests.sh [-o <override awk executable>]\n' >&2
|
1 #! /usr/bin/ksh93
2 #
3 #
4 # This file and its contents are supplied under the terms of the
5 # Common Development and Distribution License ("CDDL"), version 1.0.
6 # You may only use this file in accordance with the terms of version
7 # 1.0 of the CDDL.
8 #
9 # A full copy of the text of the CDDL should have accompanied this
10 # source. A copy of the CDDL is also available via the Internet at
11 # http://www.illumos.org/license/CDDL.
12 #
13
14 #
15 # Copyright 2020 Joyent, Inc.
16 #
17
18 AWK=/usr/bin/awk
19 WORKDIR=$(mktemp -d /tmp/nawktest.XXXXXX)
20
21 SUCCESSES=0
22 TOTAL=0
23
24 function proctemplate {
25 bash <<-EOF
26 IFS= read -rd '' OUTPUT < $1;
27 printf "%s" "\${OUTPUT//\\\$AWK/\$AWK}";
28 EOF
29 }
30
31 while [[ $# -gt 0 ]]; do
32 case $1 in
33 -o)
34 AWK=$2
35 shift 2
36 ;;
37 *)
38 printf 'Usage: runtests.sh [-o <override awk executable>]\n' >&2
|