blob: cea57235c7102ca2f111ba880e8fce85886276e3 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
|
#
# This file and its contents are supplied under the terms of the
# Common Development and Distribution License ("CDDL"), version 1.0.
# You may only use this file in accordance with the terms of version
# 1.0 of the CDDL.
#
# A full copy of the text of the CDDL should have accompanied this
# source. A copy of the CDDL is also available via the Internet at
# http://www.illumos.org/license/CDDL.
#
#
# Copyright 2018 Joyent, Inc.
#
include $(SRC)/cmd/Makefile.cmd
include $(SRC)/test/Makefile.com
DATA_FILES = \
test.countries \
test.data
BUGS_AWK :sh= (cd bugs-fixed; print *.awk)
BUGS_FILES = $(BUGS_AWK) $(BUGS_AWK:%.awk=%.ok)
EXAMPLES_FILES :sh= (cd examples/awk; print p.* t.*)
TESTS_FILES :sh= (cd tests; print T.* *.p *.ok chem.awk latin1 lilly.progs)
GNU_AWK :sh= (cd gnu; print *.awk)
GNU_KSH :sh= (cd gnu; print *.sh)
GNU_IN :sh= (cd gnu; print *.in)
#
# For the imported gnu/ tests, we have three different styles:
#
# - AWK scripts with input
# - AWK scripts with no input
# - Shell scripts that run AWK scripts themselves
#
# All of these have a corresponding *.ok file, and we generate a *.awk
# dependency from each *.in file to check for bad test setups.
#
GNU_FILES = \
$(GNU_AWK) $(GNU_AWK:%.awk=%.ok) \
$(GNU_KSH) $(GNU_KSH:%.sh=%.ok) \
$(GNU_IN) $(GNU_KSH:%.in=%.awk) \
arynocls.data out1.ok out2.ok out3.ok # arynocls.awk & messages.sh data
SYN_FILES :sh= (cd syn; print *.awk)
ROOTFILES = \
$(BUGS_FILES:%=$(TESTDIR)/bugs-fixed/%) \
$(DATA_FILES:%=$(TESTDIR)/data/%) \
$(EXAMPLES_FILES:%=$(TESTDIR)/examples/awk/%) \
$(EXAMPLES_FILES:%=$(TESTDIR)/examples/out/%) \
$(TESTS_FILES:%=$(TESTDIR)/tests/%) \
$(GNU_FILES:%=$(TESTDIR)/gnu/%) \
$(SYN_FILES:%=$(TESTDIR)/syn/%) \
$(SYN_FILES:%.awk=$(TESTDIR)/syn/%.ok) \
$(TESTDIR)/runtests.sh
SUBDIRS = bugs-fixed data examples/awk examples/out gnu syn tests
ROOTOPTPKG = $(ROOT)/opt/util-tests
TESTDIR = $(ROOTOPTPKG)/tests/awk
TESTSUBDIRS = $(SUBDIRS:%=$(TESTDIR)/%)
all lint clean clobber:
install: all $(ROOTFILES)
$(TESTDIR)/examples/% := FILEMODE=0444
$(TESTDIR)/data/% := FILEMODE=0444
$(TESTDIR)/%.data := FILEMODE=0444
$(TESTDIR)/%.awk := FILEMODE=0444
$(TESTDIR)/%.in := FILEMODE=0444
$(TESTDIR)/%.ok := FILEMODE=0444
$(TESTDIR)/%.sh := FILEMODE=0555
$(TESTDIR)/tests/lilly.progs := FILEMODE=0444
$(TESTDIR)/tests/latin1 := FILEMODE=0444
$(TESTDIR)/tests/T.% := FILEMODE=0555
$(TESTDIR)/tests/%.p := FILEMODE=0444
$(TESTDIR):
$(INS.dir)
$(TESTSUBDIRS): $(TESTDIR)
$(INS.dir)
$(TESTDIR)/%: % $(TESTSUBDIRS)
$(INS.file)
|