Skip to content

Commit 8964ba6

Browse files
committed
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.
1 parent 00a1ec6 commit 8964ba6

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

Examples/test-suite/common.mk

+4-2
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,9 @@ SCRIPTDIR = $(srcdir)
7474
# This can be set to ":" on make command line to suppress progress messages.
7575
ECHO_PROGRESS := echo
7676

77+
# Portable dos2unix / fromdos for stripping CR
78+
FROMDOS = tr -d '\r'
79+
7780
# Regenerate Makefile if Makefile.in or config.status have changed.
7881
Makefile: $(srcdir)/Makefile.in ../../../config.status
7982
cd ../../../ && $(SHELL) ./config.status $(EXAMPLES)/$(TEST_SUITE)/$(LANGUAGE)/Makefile
@@ -969,8 +972,7 @@ swig_and_compile_c = \
969972
$(LANGUAGE)$(VARIANT)
970973

971974
swig_and_compile_multi_cpp = \
972-
for f in `cat $(top_srcdir)/$(EXAMPLES)/$(TEST_SUITE)/$*.list` ; do \
973-
f=`printf $${f} | grep -v '^$$'`; \
975+
for f in $(cat $(top_srcdir)/$(EXAMPLES)/$(TEST_SUITE)/$*.list | $(FROMDOS)) ; do \
974976
$(call swig_and_compile_cpp_helper,$${f},'$(SWIGOPT)'); \
975977
done
976978

Examples/test-suite/errors/Makefile.in

+4-5
Original file line numberDiff line numberDiff line change
@@ -54,22 +54,21 @@ $(DOXYGEN_ERROR_TEST_CASES): SWIGOPT += -doxygen
5454
MODULE_OPTION=-module $*
5555
nomodule.ctest: MODULE_OPTION =
5656

57-
# Portable dos2unix / todos for stripping CR
58-
TODOS = tr -d '\r'
59-
#TODOS = sed -e 's/\r$$//' # On Mac OS X behaves as if written 's/r$$//'
57+
# Portable dos2unix / fromdos for stripping CR
58+
FROMDOS = tr -d '\r'
6059

6160
# strip source directory from output, so that diffs compare
6261
STRIP_SRCDIR = sed -e 's|\\|/|g' -e 's|^$(SRCDIR)||'
6362

6463
# Rules for the different types of tests
6564
%.cpptest:
6665
echo "$(ACTION)ing errors testcase $*"
67-
-$(SWIGINVOKE) -c++ -python -Wall -Fstandard $(MODULE_OPTION) $(SWIGOPT) $(SRCDIR)$*.i 2>&1 | $(TODOS) | $(STRIP_SRCDIR) > $*.$(ERROR_EXT)
66+
-$(SWIGINVOKE) -c++ -python -Wall -Fstandard $(MODULE_OPTION) $(SWIGOPT) $(SRCDIR)$*.i 2>&1 | $(FROMDOS) | $(STRIP_SRCDIR) > $*.$(ERROR_EXT)
6867
$(COMPILETOOL) diff -c $(SRCDIR)$*.stderr $*.$(ERROR_EXT)
6968

7069
%.ctest:
7170
echo "$(ACTION)ing errors testcase $*"
72-
-$(SWIGINVOKE) -python -Wall -Fstandard $(MODULE_OPTION) $(SWIGOPT) $(SRCDIR)$*.i 2>&1 | $(TODOS) | $(STRIP_SRCDIR) > $*.$(ERROR_EXT)
71+
-$(SWIGINVOKE) -python -Wall -Fstandard $(MODULE_OPTION) $(SWIGOPT) $(SRCDIR)$*.i 2>&1 | $(FROMDOS) | $(STRIP_SRCDIR) > $*.$(ERROR_EXT)
7372
$(COMPILETOOL) diff -c $(SRCDIR)$*.stderr $*.$(ERROR_EXT)
7473

7574
%.clean:

0 commit comments

Comments
 (0)