From 2e18b77f5b6926e6616ce22d2d3e6d511de69c9b Mon Sep 17 00:00:00 2001 From: "Arnold D. Robbins" Date: Thu, 16 Mar 2023 18:25:43 +0200 Subject: Start revamp of CSV handling. --- test/ChangeLog | 7 +++++++ test/Gentests | 11 +++++++++++ test/Makefile.am | 5 ++++- test/Makefile.in | 7 +++++-- test/Maketests | 2 +- test/badargs.ok | 1 + test/csv1.awk | 6 +++--- 7 files changed, 32 insertions(+), 7 deletions(-) (limited to 'test') 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 + + * 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 * 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) -- cgit v1.2.1