From dabec6257798c99da9138ac7e0dad969ff00ac24 Mon Sep 17 00:00:00 2001 From: Guilherme Puida Moreira Date: Tue, 27 Aug 2024 21:50:05 -0300 Subject: [PATCH] Enable running test with gawk built in another location Signed-off-by: Guilherme Puida Moreira --- test/Makefile.am | 11 ++++++----- test/Makefile.in | 10 +++++----- test/fflush.sh | 16 ++++++++-------- 3 files changed, 19 insertions(+), 18 deletions(-) diff --git a/test/Makefile.am b/test/Makefile.am index 5ee6a36c..1e5368d3 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -1746,11 +1746,12 @@ VALGRIND = # # This can also be done in individual tests where we wish to # check things specifically not in the C locale. +LOCALES = LANGUAGE= LC_ALL=$${GAWKLOCALE:-C} LANG=$${GAWKLOCALE:-C} -# # And we set AWKLIBPATH to find the extension libraries we built. -LOCALES = LANGUAGE= LC_ALL=$${GAWKLOCALE:-C} LANG=$${GAWKLOCALE:-C} -AWK = $(LOCALES) AWKLIBPATH=../extension/.libs GAWK_NO_MPFR_WARN=1 $(VALGRIND) $(AWKPROG) $(GAWK_TEST_ARGS) +AWKLIBPATH=../extension/.libs + +AWK = $(LOCALES) AWKLIBPATH=$(AWKLIBPATH) GAWK_NO_MPFR_WARN=1 $(VALGRIND) $(AWKPROG) $(GAWK_TEST_ARGS) # Message stuff is to make it a little easier to follow. # Make the pass-fail last and dependent on others to avoid @@ -2162,7 +2163,7 @@ rsstart3:: rtlenmb:: @echo $@ @-[ -z "$$GAWKLOCALE" ] && GAWKLOCALE=en_US.UTF-8; export GAWKLOCALE ; \ - "$(srcdir)"/rtlen.sh >_$@ || echo EXIT CODE: $$? >>_$@ + AWK="$(AWKPROG)" "$(srcdir)"/rtlen.sh >_$@ || echo EXIT CODE: $$? >>_$@ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ nofile:: @@ -2213,7 +2214,7 @@ beginfile1:: beginfile2: @echo $@ $(ZOS_FAIL) - @-( cd "$(srcdir)" && LC_ALL=C AWK="$(abs_builddir)/$(AWKPROG)" $(abs_srcdir)/$@.sh $(abs_srcdir)/$@.in ) > _$@ 2>&1 || echo EXIT CODE: $$? >> _$@ + @-( cd "$(srcdir)" && LC_ALL=C AWK="$(AWKPROG)" $(abs_srcdir)/$@.sh $(abs_srcdir)/$@.in ) > _$@ 2>&1 || echo EXIT CODE: $$? >> _$@ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ dumpvars:: diff --git a/test/Makefile.in b/test/Makefile.in index 135807b2..3dbc14f2 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -163,7 +163,7 @@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ -AWK = $(LOCALES) AWKLIBPATH=../extension/.libs GAWK_NO_MPFR_WARN=1 $(VALGRIND) $(AWKPROG) $(GAWK_TEST_ARGS) +AWK = $(LOCALES) AWKLIBPATH=$(AWKLIBPATH) GAWK_NO_MPFR_WARN=1 $(VALGRIND) $(AWKPROG) $(GAWK_TEST_ARGS) CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ @@ -2011,10 +2011,10 @@ VALGRIND = # # This can also be done in individual tests where we wish to # check things specifically not in the C locale. +LOCALES = LANGUAGE= LC_ALL=$${GAWKLOCALE:-C} LANG=$${GAWKLOCALE:-C} -# # And we set AWKLIBPATH to find the extension libraries we built. -LOCALES = LANGUAGE= LC_ALL=$${GAWKLOCALE:-C} LANG=$${GAWKLOCALE:-C} +AWKLIBPATH = ../extension/.libs all: all-am .SUFFIXES: @@ -2612,7 +2612,7 @@ rsstart3:: rtlenmb:: @echo $@ @-[ -z "$$GAWKLOCALE" ] && GAWKLOCALE=en_US.UTF-8; export GAWKLOCALE ; \ - "$(srcdir)"/rtlen.sh >_$@ || echo EXIT CODE: $$? >>_$@ + AWK="$(AWKPROG)" "$(srcdir)"/rtlen.sh >_$@ || echo EXIT CODE: $$? >>_$@ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ nofile:: @@ -2663,7 +2663,7 @@ beginfile1:: beginfile2: @echo $@ $(ZOS_FAIL) - @-( cd "$(srcdir)" && LC_ALL=C AWK="$(abs_builddir)/$(AWKPROG)" $(abs_srcdir)/$@.sh $(abs_srcdir)/$@.in ) > _$@ 2>&1 || echo EXIT CODE: $$? >> _$@ + @-( cd "$(srcdir)" && LC_ALL=C AWK="$(AWKPROG)" $(abs_srcdir)/$@.sh $(abs_srcdir)/$@.in ) > _$@ 2>&1 || echo EXIT CODE: $$? >> _$@ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ dumpvars:: diff --git a/test/fflush.sh b/test/fflush.sh index 42d624c9..19b171f2 100755 --- a/test/fflush.sh +++ b/test/fflush.sh @@ -1,16 +1,16 @@ #! /bin/sh -../gawk 'BEGIN{print "1st";fflush("/dev/stdout");print "2nd"|"cat"}' +$AWK 'BEGIN{print "1st";fflush("/dev/stdout");print "2nd"|"cat"}' -../gawk 'BEGIN{print "1st";fflush("/dev/stdout");print "2nd"|"cat"}'|cat +$AWK 'BEGIN{print "1st";fflush("/dev/stdout");print "2nd"|"cat"}'|cat -../gawk 'BEGIN{print "1st";fflush("/dev/stdout");close("/dev/stdout");print "2nd"|"cat"}'|cat +$AWK 'BEGIN{print "1st";fflush("/dev/stdout");close("/dev/stdout");print "2nd"|"cat"}'|cat -../gawk 'BEGIN{print "1st";fflush("/dev/stdout");print "2nd"|"cat";close("cat")}'|cat +$AWK 'BEGIN{print "1st";fflush("/dev/stdout");print "2nd"|"cat";close("cat")}'|cat -../gawk 'BEGIN{print "1st";fflush("/dev/stdout");print "2nd"|"cat";close("cat")}'|cat +$AWK 'BEGIN{print "1st";fflush("/dev/stdout");print "2nd"|"cat";close("cat")}'|cat -../gawk 'BEGIN{print "1st";fflush("/dev/stdout");print "2nd"|"cat";close("cat")}'|cat +$AWK 'BEGIN{print "1st";fflush("/dev/stdout");print "2nd"|"cat";close("cat")}'|cat -../gawk 'BEGIN{print "1st";fflush("/dev/stdout");print "2nd"|"sort"}'|cat +$AWK 'BEGIN{print "1st";fflush("/dev/stdout");print "2nd"|"sort"}'|cat -../gawk 'BEGIN{print "1st";fflush("/dev/stdout");print "2nd"|"sort";close("sort")}'|cat +$AWK 'BEGIN{print "1st";fflush("/dev/stdout");print "2nd"|"sort";close("sort")}'|cat -- 2.45.2