summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorArnold D. Robbins <arnold@skeeve.com>2023-03-16 18:25:43 +0200
committerArnold D. Robbins <arnold@skeeve.com>2023-03-16 18:25:43 +0200
commit2e18b77f5b6926e6616ce22d2d3e6d511de69c9b (patch)
treedfb889b9411a7f126facaeb465aebb2247961d72 /test
parented09e9c66665f98eb070cc28d87abb9cb0096c3f (diff)
downloadgawk-2e18b77f5b6926e6616ce22d2d3e6d511de69c9b.tar.gz
Start revamp of CSV handling.
Diffstat (limited to 'test')
-rw-r--r--test/ChangeLog7
-rwxr-xr-xtest/Gentests11
-rw-r--r--test/Makefile.am5
-rw-r--r--test/Makefile.in7
-rw-r--r--test/Maketests2
-rw-r--r--test/badargs.ok1
-rw-r--r--test/csv1.awk6
7 files changed, 32 insertions, 7 deletions
diff --git a/test/ChangeLog b/test/ChangeLog
index e206fa9b..f247c540 100644
--- a/test/ChangeLog
+++ b/test/ChangeLog
@@ -1,3 +1,10 @@
+2023-03-16 Arnold D. Robbins <arnold@skeeve.com>
+
+ * Gentests: Handle NEED_CSV.
+ * Makefile.am (NEED_CSV): New list of tests that need --csv.
+ * badargs.ok: Update after code changes.
+ * csv1.awk: Adjust after code changes.
+
2023-03-09 Arnold D. Robbins <arnold@skeeve.com>
* badargs.ok: Update after code changes.
diff --git a/test/Gentests b/test/Gentests
index 42a81cff..b3a8f787 100755
--- a/test/Gentests
+++ b/test/Gentests
@@ -108,6 +108,13 @@ BEGIN {
next
}
+/^NEED_CSV *=/,/[^\\]$/ {
+ gsub(/(^NEED_CSV *=|\\$)/,"")
+ for (i = 1; i <= NF; i++)
+ csv[$i]
+ next
+}
+
/^GENTESTS_UNUSED *=/,/[^\\]$/ {
gsub(/(^GENTESTS_UNUSED *=|\\$)/,"")
for (i = 1; i <= NF; i++)
@@ -229,6 +236,10 @@ function generate(x, s, i, locale_string)
s = s " --re-interval"
delete re_interval[x]
}
+ if (x in csv) {
+ s = s " --csv"
+ delete csv[x]
+ }
if (x".in" in files) {
s = s " < \"$(srcdir)\"/$@.in"
delete files[x".in"]
diff --git a/test/Makefile.am b/test/Makefile.am
index 6d000178..7bb4c983 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -1604,9 +1604,12 @@ NEED_SANDBOX = sandbox1
# List of tests that need --traditional
NEED_TRADITIONAL = litoct tradanch rscompat
-# Lists of tests that need the PMA allocator and a backing file
+# List of tests that need the PMA allocator and a backing file
NEED_PMA = pma
+# List of tests that need --csv
+NEED_CSV = csv1
+
# Lists of tests that run a shell script
RUN_SHELL = exit fflush localenl modifiers next randtest rtlen rtlen01
diff --git a/test/Makefile.in b/test/Makefile.in
index 1cd775d1..28c5ebc5 100644
--- a/test/Makefile.in
+++ b/test/Makefile.in
@@ -1868,9 +1868,12 @@ NEED_SANDBOX = sandbox1
# List of tests that need --traditional
NEED_TRADITIONAL = litoct tradanch rscompat
-# Lists of tests that need the PMA allocator and a backing file
+# List of tests that need the PMA allocator and a backing file
NEED_PMA = pma
+# List of tests that need --csv
+NEED_CSV = csv1
+
# Lists of tests that run a shell script
RUN_SHELL = exit fflush localenl modifiers next randtest rtlen rtlen01
@@ -4484,7 +4487,7 @@ crlf:
csv1:
@echo $@
- @-AWKPATH="$(srcdir)" $(AWK) -f $@.awk < "$(srcdir)"/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-AWKPATH="$(srcdir)" $(AWK) -f $@.awk --csv < "$(srcdir)"/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@
dbugeval2:
diff --git a/test/Maketests b/test/Maketests
index 628ff3fa..d284aab6 100644
--- a/test/Maketests
+++ b/test/Maketests
@@ -1414,7 +1414,7 @@ crlf:
csv1:
@echo $@
- @-AWKPATH="$(srcdir)" $(AWK) -f $@.awk < "$(srcdir)"/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-AWKPATH="$(srcdir)" $(AWK) -f $@.awk --csv < "$(srcdir)"/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@
dbugeval2:
diff --git a/test/badargs.ok b/test/badargs.ok
index d2c67cac..1d79bc78 100644
--- a/test/badargs.ok
+++ b/test/badargs.ok
@@ -17,6 +17,7 @@ Short options: GNU long options: (extensions)
-h --help
-i includefile --include=includefile
-I --trace
+ -k --csv
-l library --load=library
-L[fatal|invalid|no-ext] --lint[=fatal|invalid|no-ext]
-M --bignum
diff --git a/test/csv1.awk b/test/csv1.awk
index 12bbf1e5..4896ef7c 100644
--- a/test/csv1.awk
+++ b/test/csv1.awk
@@ -1,6 +1,6 @@
-BEGIN {
- FS = ","
-}
+# BEGIN {
+# FS = ","
+# }
{
printf(" \t%s\t", $0)