java_director_exception_feature_nspace test case changes

- The implementation for SEP for the classpath is not portable, eg the
separator should be ':' not ';' on Cygwin, but clearly it could be ';'
if using a native Windows version of Java. In the past the test-suite
has been constructed to avoid this problem and these changes go back to
this approach at the expense of not testing nspace without -package (but
not specifying -package is quite unusual when using nspace, so no great
loss). This test could be restored to how it was if the separator is
detected at configure time from the JVM itself, eg by calling Java code:

  System.out.println(System.getProperty("path.separator"));

- Mangle the non-public classes in the _runme.java file so that they are
unique to this testcase (the .class files generated can interfere with
other tests).

- Const corrections and spelling mistakes fixed in test case.

test case improvements
This commit is contained in:
William S Fulton 2013-11-02 12:33:33 +00:00
commit baec61c5ab
4 changed files with 46 additions and 52 deletions

View file

@ -46,18 +46,9 @@ JAVA_PACKAGE = $*
JAVA_PACKAGEOPT = -package $(JAVA_PACKAGE)
SWIGOPT += $(JAVA_PACKAGEOPT)
RUNME_CLASSPATH = -classpath .
ifeq (Cygwin,$(shell uname -o 2>/dev/null))
SEP=;
else
SEP=:
endif
# Custom tests - tests with additional commandline options
java_nspacewithoutpackage.%: JAVA_PACKAGEOPT =
java_director_exception_feature_nspace.%: JAVA_PACKAGEOPT =
java_director_exception_feature_nspace.%: RUNME_CLASSPATH = -classpath .$(SEP)./java_director_exception_feature_nspace
java_director_exception_feature_nspace.%: JAVA_PACKAGE = $*Package
nspace.%: JAVA_PACKAGE = $*Package
nspace_extend.%: JAVA_PACKAGE = $*Package
director_nspace.%: JAVA_PACKAGE = $*Package
@ -96,8 +87,8 @@ setup = \
run_testcase = \
cd $(JAVA_PACKAGE) && $(COMPILETOOL) $(JAVAC) -classpath . `find . -name "*.java"` && cd .. && \
if [ -f $(srcdir)/$(SCRIPTPREFIX)$*$(SCRIPTSUFFIX) ]; then \
$(COMPILETOOL) $(JAVAC) $(RUNME_CLASSPATH) -d . $(srcdir)/$(SCRIPTPREFIX)$*$(SCRIPTSUFFIX) && \
env LD_LIBRARY_PATH="$(JAVA_PACKAGE):$$LD_LIBRARY_PATH" PATH="$(JAVA_PACKAGE):$$PATH" SHLIB_PATH="$(JAVA_PACKAGE):$$SHLIB_PATH" DYLD_LIBRARY_PATH="$(JAVA_PACKAGE):$$DYLD_LIBRARY_PATH" $(RUNTOOL) $(JAVA) $(JAVAFLAGS) $(RUNME_CLASSPATH) $*_runme; \
$(COMPILETOOL) $(JAVAC) -classpath . -d . $(srcdir)/$(SCRIPTPREFIX)$*$(SCRIPTSUFFIX) && \
env LD_LIBRARY_PATH="$(JAVA_PACKAGE):$$LD_LIBRARY_PATH" PATH="$(JAVA_PACKAGE):$$PATH" SHLIB_PATH="$(JAVA_PACKAGE):$$SHLIB_PATH" DYLD_LIBRARY_PATH="$(JAVA_PACKAGE):$$DYLD_LIBRARY_PATH" $(RUNTOOL) $(JAVA) $(JAVAFLAGS) -classpath . $*_runme; \
fi
# Clean: remove testcase directories