Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Test-suite makefile fixes for Windows
Remove $(realpath ) which is no good for Windows executables running
under Cygwin's make
  • Loading branch information
wsfulton committed May 28, 2014
1 parent 68347cb commit 7871975
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 7 deletions.
6 changes: 3 additions & 3 deletions Examples/Makefile.in
Expand Up @@ -576,7 +576,7 @@ JAVAC = @JAVAC@ -d .
# ----------------------------------------------------------------

java: $(SRCDIR_SRCS)
$(SWIG) -java $(SWIGOPT) -o $(ISRCS) $(realpath $(INTERFACEPATH))
$(SWIG) -java $(SWIGOPT) -o $(ISRCS) $(INTERFACEPATH)
$(CC) -c $(CCSHARED) $(CPPFLAGS) $(CFLAGS) $(JAVACFLAGS) $(SRCDIR_SRCS) $(ISRCS) $(INCLUDES) $(JAVA_INCLUDE)
$(JAVALDSHARED) $(CFLAGS) $(LDFLAGS) $(OBJS) $(IOBJS) $(JAVA_DLNK) $(LIBS) -o $(JAVA_LIBPREFIX)$(TARGET)$(JAVASO)

Expand All @@ -585,7 +585,7 @@ java: $(SRCDIR_SRCS)
# ----------------------------------------------------------------

java_cpp: $(SRCDIR_SRCS)
$(SWIG) -java -c++ $(SWIGOPT) -o $(ICXXSRCS) $(realpath $(INTERFACEPATH))
$(SWIG) -java -c++ $(SWIGOPT) -o $(ICXXSRCS) $(INTERFACEPATH)
$(CXX) -c $(CCSHARED) $(CPPFLAGS) $(CXXFLAGS) $(JAVACFLAGS) $(SRCDIR_SRCS) $(SRCDIR_CXXSRCS) $(ICXXSRCS) $(INCLUDES) $(JAVA_INCLUDE)
$(JAVACXXSHARED) $(CXXFLAGS) $(LDFLAGS) $(OBJS) $(IOBJS) $(JAVA_DLNK) $(LIBS) $(CPP_DLLIBS) -o $(JAVA_LIBPREFIX)$(TARGET)$(JAVASO)

Expand Down Expand Up @@ -1373,7 +1373,7 @@ csharp_cpp: $(SRCDIR_SRCS)
# ----------------------------------------------------------------

ifneq (,$(SRCDIR))
SRCDIR_CSHARPSRCS = $(wildcard $(addprefix $(SRCDIR),$(CSHARPSRCS)))
SRCDIR_CSHARPSRCS = $(addprefix $(SRCDIR),$(CSHARPSRCS))
else
SRCDIR_CSHARPSRCS =
endif
Expand Down
16 changes: 12 additions & 4 deletions Examples/test-suite/java/preproc_line_file_runme.java
Expand Up @@ -13,13 +13,21 @@ public class preproc_line_file_runme {

private static void test_file(String file, String suffix) throws Throwable
{
String FILENAME_WINDOWS = "Examples\\test-suite\\preproc_line_file.i";
String FILENAME_UNIX = "Examples/test-suite/preproc_line_file.i";
// For swig-3.0.1 and earlier
// String FILENAME_WINDOWS = "Examples\\test-suite\\preproc_line_file.i";
// String FILENAME_UNIX = "Examples/test-suite/preproc_line_file.i";

String FILENAME_WINDOWS2 = "Examples\\test-suite\\java\\..\\preproc_line_file.i";
String FILENAME_UNIX2 = "Examples/test-suite/java/../preproc_line_file.i";

String FILENAME_WINDOWS3 = "..\\.\\..\\preproc_line_file.i";
String FILENAME_UNIX3 = ".././../preproc_line_file.i";

// We don't test for exact equality here because the file names are relative to the build directory, which can be different from the source directory,
// under Unix. But they do need to end with the same path components.
if (!file.endsWith(FILENAME_UNIX + suffix) && !file.endsWith(FILENAME_WINDOWS + suffix))
throw new RuntimeException("file \"" + file + "\" doesn't end with " + FILENAME_UNIX + suffix);
if (!file.endsWith(FILENAME_UNIX2 + suffix) && !file.endsWith(FILENAME_WINDOWS2 + suffix) &&
!file.endsWith(FILENAME_UNIX3 + suffix) && !file.endsWith(FILENAME_WINDOWS3 + suffix))
throw new RuntimeException("file \"" + file + "\" doesn't end with " + FILENAME_UNIX2 + suffix + " or " + FILENAME_UNIX3 + suffix);
}

public static void main(String argv[]) throws Throwable
Expand Down

0 comments on commit 7871975

Please sign in to comment.