diff options
author | William S Fulton <wsf@fultondesigns.co.uk> | 2013-01-18 23:47:23 +0000 |
---|---|---|
committer | William S Fulton <wsf@fultondesigns.co.uk> | 2013-01-18 23:47:23 +0000 |
commit | 55f4bfec8e3ce00207c5d1e8bec2ac48b8ac62f8 (patch) | |
tree | 24eb596117a5801830c7b56daee3c8eb6be35dc7 | |
parent | 9318ece01ffa6d1de64e5930217ef42de24cc411 (diff) | |
download | swig-55f4bfec8e3ce00207c5d1e8bec2ac48b8ac62f8.tar.gz |
Revert Java test-suite makefile to adf51b5249e6b1a7a11fc3adcc01ed196d6c9135
-rw-r--r-- | Examples/test-suite/java/Makefile.in | 48 |
1 files changed, 19 insertions, 29 deletions
diff --git a/Examples/test-suite/java/Makefile.in b/Examples/test-suite/java/Makefile.in index 72fad777d..f8da8e6cc 100644 --- a/Examples/test-suite/java/Makefile.in +++ b/Examples/test-suite/java/Makefile.in @@ -15,11 +15,7 @@ C_TEST_CASES = \ java_lib_arrays \ java_lib_various -CPP_TEST_CASES_PKGPRAGMA = \ - java_nspacewithoutpackage - - -CPP_TEST_CASES_PKGOPT = \ +CPP_TEST_CASES = \ enum_thorough_proper \ enum_thorough_simple \ enum_thorough_typeunsafe \ @@ -40,28 +36,11 @@ CPP_TEST_CASES_PKGOPT = \ java_typemaps_typewrapper # li_boost_intrusive_ptr -CPP_TEST_CASES = $(CPP_TEST_CASES_PKGOPT) $(CPP_TEST_CASES_PKGPRAGMA) include $(srcdir)/../common.mk # Overridden variables here 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) +SWIGOPT += -package $(JAVA_PACKAGE) # Custom tests - tests with additional commandline options nspace.%: JAVA_PACKAGE = $*Package @@ -70,22 +49,33 @@ director_nspace.%: JAVA_PACKAGE = $*Package director_nspace_director_name_collision.%: JAVA_PACKAGE = $*Package # Rules for the different types of tests -%.cpptest: +%.cpptest: $(setup) - +($(PKGDIRSETUP) && $(swig_and_compile_cpp)) + +(cd $(JAVA_PACKAGE) && $(swig_and_compile_cpp)) $(run_testcase) %.ctest: $(setup) - +($(PKGDIRSETUP) && $(swig_and_compile_c)) + +(cd $(JAVA_PACKAGE) && $(swig_and_compile_c)) $(run_testcase) -%.multicpptest: +%.multicpptest: $(setup) - +($(PKGDIRSETUP) && $(swig_and_compile_multi_cpp)) + +(cd $(JAVA_PACKAGE) && $(swig_and_compile_multi_cpp)) $(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. # 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 = \ |