Revert Java test-suite makefile to adf51b5249

This commit is contained in:
William S Fulton 2013-01-18 23:47:23 +00:00
commit 55f4bfec8e

View file

@ -15,11 +15,7 @@ C_TEST_CASES = \
java_lib_arrays \ java_lib_arrays \
java_lib_various java_lib_various
CPP_TEST_CASES_PKGPRAGMA = \ CPP_TEST_CASES = \
java_nspacewithoutpackage
CPP_TEST_CASES_PKGOPT = \
enum_thorough_proper \ enum_thorough_proper \
enum_thorough_simple \ enum_thorough_simple \
enum_thorough_typeunsafe \ enum_thorough_typeunsafe \
@ -40,28 +36,11 @@ CPP_TEST_CASES_PKGOPT = \
java_typemaps_typewrapper java_typemaps_typewrapper
# li_boost_intrusive_ptr # li_boost_intrusive_ptr
CPP_TEST_CASES = $(CPP_TEST_CASES_PKGOPT) $(CPP_TEST_CASES_PKGPRAGMA)
include $(srcdir)/../common.mk include $(srcdir)/../common.mk
# Overridden variables here # Overridden variables here
JAVA_PACKAGE = $* JAVA_PACKAGE = $*
SWIGOPT += -package $(JAVA_PACKAGE)
ALL_PKGOPT := $(filter-out $(CPP_TEST_CASES_PKGPRAGMA:=.cpptest),$(NOT_BROKEN_TEST_CASES))
ALL_PKGPRAGMA := $(filter $(CPP_TEST_CASES_PKGPRAGMA:=.cpptest),$(NOT_BROKEN_TEST_CASES))
# Add '-package' swigopt for ALL tests except for CPP_TEST_CASES_PKGPRAGMA
# PKGDIRSETUP should leave 0 exitcode when successful
$(ALL_PKGOPT): SWIGOPT += -package $(JAVA_PACKAGE)
$(ALL_PKGOPT): PKGDIRSETUP = [ -d "$(JAVA_PACKAGE)" ] || mkdir -p "$(JAVA_PACKAGE)" && cd "$(JAVA_PACKAGE)"
# Set JNI_PACKAGE for the tests using internally coded pragma javapackage
# (and must match what is in the test .i file)
# Make sure that the pragma dir DOES NOT exist (since test should create)
# This may not find all the generated java to compile...
# NOTE: The variable JAVA_PACKAGE has nothing to do wih a package in this case, but
# needs to remain named the same so other targets work
$(ALL_PKGPRAGMA): JNI_PACKAGE = PragmaDefinedPackage
$(ALL_PKGPRAGMA): PKGDIRSETUP = [ -d "$(JAVA_PACKAGE)" ] || mkdir -p "$(JAVA_PACKAGE)" && cd "$(JAVA_PACKAGE)" &&rm -rf $(JAVA_PACKAGE)/$(JNI_PACKAGE)
# Custom tests - tests with additional commandline options # Custom tests - tests with additional commandline options
nspace.%: JAVA_PACKAGE = $*Package nspace.%: JAVA_PACKAGE = $*Package
@ -72,20 +51,31 @@ director_nspace_director_name_collision.%: JAVA_PACKAGE = $*Package
# Rules for the different types of tests # Rules for the different types of tests
%.cpptest: %.cpptest:
$(setup) $(setup)
+($(PKGDIRSETUP) && $(swig_and_compile_cpp)) +(cd $(JAVA_PACKAGE) && $(swig_and_compile_cpp))
$(run_testcase) $(run_testcase)
%.ctest: %.ctest:
$(setup) $(setup)
+($(PKGDIRSETUP) && $(swig_and_compile_c)) +(cd $(JAVA_PACKAGE) && $(swig_and_compile_c))
$(run_testcase) $(run_testcase)
%.multicpptest: %.multicpptest:
$(setup) $(setup)
+($(PKGDIRSETUP) && $(swig_and_compile_multi_cpp)) +(cd $(JAVA_PACKAGE) && $(swig_and_compile_multi_cpp))
$(run_testcase) $(run_testcase)
# COMPILES java files then runs the testcase. A testcase is only run if # Makes a directory for the testcase if it does not exist
setup = \
if [ -f $(srcdir)/$(SCRIPTPREFIX)$*$(SCRIPTSUFFIX) ]; then \
echo "$(ACTION)ing testcase $* (with run test) under $(LANGUAGE)" ; \
else \
echo "$(ACTION)ing testcase $* under $(LANGUAGE)" ; \
fi; \
if [ ! -d $(JAVA_PACKAGE) ]; then \
mkdir $(JAVA_PACKAGE); \
fi
# Compiles java files then runs the testcase. A testcase is only run if
# a file is found which has _runme.java appended after the testcase name. # a file is found which has _runme.java appended after the testcase name.
# Note Java uses LD_LIBRARY_PATH under Unix, PATH under Cygwin/Windows, SHLIB_PATH on HPUX and DYLD_LIBRARY_PATH on Mac OS X. # Note Java uses LD_LIBRARY_PATH under Unix, PATH under Cygwin/Windows, SHLIB_PATH on HPUX and DYLD_LIBRARY_PATH on Mac OS X.
run_testcase = \ run_testcase = \