CSharp test-suite support on windows

- Add pathconvert tool to convert to a windows path for input files for
  C# compiler
- Simplify vcfilter
This commit is contained in:
William S Fulton 2015-01-23 07:46:33 +00:00
commit 2347e87451
4 changed files with 36 additions and 13 deletions

View file

@ -6,8 +6,7 @@ LANGUAGE = csharp
SCRIPTSUFFIX = _runme.cs
CSHARPCILINTERPRETER = @CSHARPCILINTERPRETER@
CSHARPCILINTERPRETER_FLAGS = @CSHARPCILINTERPRETER_FLAGS@
CSHARPPATHSEPARATOR = "@CSHARPPATHSEPARATOR@"
CSHARPCYGPATH_W = @CSHARPCYGPATH_W@
CSHARPCONVERTPATH = @top_srcdir@/@CSHARPCONVERTPATH@
srcdir = @srcdir@
top_srcdir = ../@top_srcdir@
@ -79,13 +78,13 @@ run_testcase = \
if [ -f $(SCRIPTDIR)/$(SCRIPTPREFIX)$*$(SCRIPTSUFFIX) ]; then \
$(MAKE) -f $*/$(top_builddir)/$(EXAMPLES)/Makefile \
CSHARPFLAGS='-nologo -debug+ $(CSHARPFLAGSSPECIAL) -out:$*_runme.exe' \
CSHARPSRCS='`$(CSHARPCYGPATH_W) $(SCRIPTDIR)/$(SCRIPTPREFIX)$*$(SCRIPTSUFFIX)` `find $* -name "*.cs" -exec $(CSHARPCYGPATH_W) "{}" \+`' csharp_compile && \
CSHARPSRCS='`$(CSHARPCONVERTPATH) $(SCRIPTDIR)/$(SCRIPTPREFIX)$*$(SCRIPTSUFFIX)` `find $* -name "*.cs" -exec $(CSHARPCONVERTPATH) "{}" \+`' csharp_compile && \
env LD_LIBRARY_PATH="$*:$$LD_LIBRARY_PATH" PATH="$*:$$PATH" SHLIB_PATH="$*:$$SHLIB_PATH" DYLD_FALLBACK_LIBRARY_PATH= $(RUNTOOL) $(CSHARPCILINTERPRETER) $(CSHARPCILINTERPRETER_FLAGS) ./$*_runme.exe; \
else \
cd $* && \
$(MAKE) -f $(top_builddir)/$(EXAMPLES)/Makefile \
CSHARPFLAGS='-nologo -debug+ $(CSHARPFLAGSSPECIAL) -t:module -out:$*.netmodule' \
CSHARPSRCS='`find . -name "*.cs" -exec $(CSHARPCYGPATH_W) "{}" \+`' csharp_compile; \
CSHARPSRCS='`find . -name "*.cs" -exec ../$(CSHARPCONVERTPATH) "{}" \+`' csharp_compile; \
fi
# Clean: remove testcase directories

27
Tools/convertpath Executable file
View file

@ -0,0 +1,27 @@
#!/bin/sh
# Unix to Windows relative path conversion in a script.
# Useful for avoiding backslash quoting difficulties in Makefiles.
# Acts as a much dumbed down 'cygpath -w' tool.
usage()
{
cat <<EOF
Usage: $0 [-w|-u|-h] [path]...
Convert Windows and Unix paths (intended for simple relative paths only)
-w Convert backslashes to forward slashes in the paths
-u Convert forward slashes to backslashes in the paths
EOF
}
option="$1"
case "$option" in
-w) shift; echo $@ | sed -e 's,/,\\,g' ;;
-u) shift; echo $@ | sed -e 's,\\,/,g' ;;
-h) shift; usage; ;;
*) usage; exit 1 ;;
esac
exit 0

View file

@ -2,9 +2,9 @@
# This is a simple utility for Cygwin/Mingw which is useful when running the SWIG
# test-suite through Visual Studio. If the output from the test-suite is piped
# through this utility, it will filter the junk that the compiler generates.
# through this utility, it will filter the junk that the compiler outputs to stdout.
# Typical usage: make check | vcfilter
# dos2unix needed for ^ and $ to work.
2>&1 dos2unix | grep -v "\.cxx$" | grep -v "\.c$" | grep -v "^ Creating library" | grep -v "^Generating Code"
2>&1 dos2unix | grep -v -e "\.cxx$" -e "\.c$" -e "^ Creating library" -e "^Generating Code"

View file

@ -1993,8 +1993,7 @@ else
CSHARPCOMPILER="$CSHARPCOMPILERBIN"
fi
CSHARPPATHSEPARATOR="/"
CSHARPCYGPATH_W=echo
CSHARPCONVERTPATH="Tools/convertpath -u"
if test -z "$CSHARPBIN" ; then
CSHARPCILINTERPRETER=""
CSHARPCILINTERPRETER_FLAGS=""
@ -2021,8 +2020,7 @@ if test -z "$CSHARPBIN" ; then
CSHARPCILINTERPRETER_FLAGS="--debug"
else
if test "csc" = "$CSHARPCOMPILER"; then
CSHARPPATHSEPARATOR="\\\\"
CSHARPCYGPATH_W='cygpath -w'
CSHARPCONVERTPATH="Tools/convertpath -w"
fi
fi
fi
@ -2065,11 +2063,10 @@ fi
AC_SUBST(CSHARPCILINTERPRETER_FLAGS)
AC_SUBST(CSHARPCILINTERPRETER)
AC_SUBST(CSHARPPATHSEPARATOR)
AC_SUBST(CSHARPCYGPATH_W)
AC_SUBST(CSHARPCONVERTPATH)
AC_SUBST(CSHARPCOMPILER)
AC_SUBST(CSHARPDYNAMICLINKING)
AC_SUBST(CSHARPLIBRARYPREFIX) # Is this going to be used?
AC_SUBST(CSHARPLIBRARYPREFIX)
AC_SUBST(CSHARPCFLAGS)
AC_SUBST(CSHARPSO)