From 068f08df005234e4054dedfa24521b47be8926d5 Mon Sep 17 00:00:00 2001 From: William S Fulton Date: Sat, 13 Jul 2024 11:07:35 +0100 Subject: [PATCH] fromdos consistency for removing CR Also fix mistakenly named todos which should be fromdos. tr is used as it is always available and unfortunately common.mk is not currently setup to use configure.ac output. --- Examples/test-suite/common.mk | 6 ++++-- Examples/test-suite/errors/Makefile.in | 9 ++++----- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/Examples/test-suite/common.mk b/Examples/test-suite/common.mk index 4bd14d3fc3f..4f28e73d833 100644 --- a/Examples/test-suite/common.mk +++ b/Examples/test-suite/common.mk @@ -74,6 +74,9 @@ SCRIPTDIR = $(srcdir) # This can be set to ":" on make command line to suppress progress messages. ECHO_PROGRESS := echo +# Portable dos2unix / fromdos for stripping CR +FROMDOS = tr -d '\r' + # Regenerate Makefile if Makefile.in or config.status have changed. Makefile: $(srcdir)/Makefile.in ../../../config.status cd ../../../ && $(SHELL) ./config.status $(EXAMPLES)/$(TEST_SUITE)/$(LANGUAGE)/Makefile @@ -969,8 +972,7 @@ swig_and_compile_c = \ $(LANGUAGE)$(VARIANT) swig_and_compile_multi_cpp = \ - for f in `cat $(top_srcdir)/$(EXAMPLES)/$(TEST_SUITE)/$*.list` ; do \ - f=`printf $${f} | grep -v '^$$'`; \ + for f in `cat $(top_srcdir)/$(EXAMPLES)/$(TEST_SUITE)/$*.list | $(FROMDOS)` ; do \ $(call swig_and_compile_cpp_helper,$${f},'$(SWIGOPT)'); \ done diff --git a/Examples/test-suite/errors/Makefile.in b/Examples/test-suite/errors/Makefile.in index 347bf385811..980df0e54fb 100644 --- a/Examples/test-suite/errors/Makefile.in +++ b/Examples/test-suite/errors/Makefile.in @@ -54,9 +54,8 @@ $(DOXYGEN_ERROR_TEST_CASES): SWIGOPT += -doxygen MODULE_OPTION=-module $* nomodule.ctest: MODULE_OPTION = -# Portable dos2unix / todos for stripping CR -TODOS = tr -d '\r' -#TODOS = sed -e 's/\r$$//' # On Mac OS X behaves as if written 's/r$$//' +# Portable dos2unix / fromdos for stripping CR +FROMDOS = tr -d '\r' # strip source directory from output, so that diffs compare STRIP_SRCDIR = sed -e 's|\\|/|g' -e 's|^$(SRCDIR)||' @@ -64,12 +63,12 @@ STRIP_SRCDIR = sed -e 's|\\|/|g' -e 's|^$(SRCDIR)||' # Rules for the different types of tests %.cpptest: echo "$(ACTION)ing errors testcase $*" - -$(SWIGINVOKE) -c++ -python -Wall -Fstandard $(MODULE_OPTION) $(SWIGOPT) $(SRCDIR)$*.i 2>&1 | $(TODOS) | $(STRIP_SRCDIR) > $*.$(ERROR_EXT) + -$(SWIGINVOKE) -c++ -python -Wall -Fstandard $(MODULE_OPTION) $(SWIGOPT) $(SRCDIR)$*.i 2>&1 | $(FROMDOS) | $(STRIP_SRCDIR) > $*.$(ERROR_EXT) $(COMPILETOOL) diff -c $(SRCDIR)$*.stderr $*.$(ERROR_EXT) %.ctest: echo "$(ACTION)ing errors testcase $*" - -$(SWIGINVOKE) -python -Wall -Fstandard $(MODULE_OPTION) $(SWIGOPT) $(SRCDIR)$*.i 2>&1 | $(TODOS) | $(STRIP_SRCDIR) > $*.$(ERROR_EXT) + -$(SWIGINVOKE) -python -Wall -Fstandard $(MODULE_OPTION) $(SWIGOPT) $(SRCDIR)$*.i 2>&1 | $(FROMDOS) | $(STRIP_SRCDIR) > $*.$(ERROR_EXT) $(COMPILETOOL) diff -c $(SRCDIR)$*.stderr $*.$(ERROR_EXT) %.clean: