Skip to content

Commit

Permalink
fromdos consistency for removing CR
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
wsfulton committed Jul 13, 2024
1 parent 00a1ec6 commit 068f08d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
6 changes: 4 additions & 2 deletions Examples/test-suite/common.mk
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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

Expand Down
9 changes: 4 additions & 5 deletions Examples/test-suite/errors/Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -54,22 +54,21 @@ $(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)||'

# 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:
Expand Down

0 comments on commit 068f08d

Please sign in to comment.