Merge latest master into doxygen branch again.
Update Doxygen-specific Python unit tests to work with the new indentation. Update one of Doxygen-specific Java tests to still build with the new handling of srcdir.
This commit is contained in:
commit
6cce652762
557 changed files with 4998 additions and 4138 deletions
|
|
@ -7,6 +7,7 @@ JAVA = @JAVA@
|
|||
JAVAC = @JAVAC@
|
||||
JAVAFLAGS = -Xcheck:jni
|
||||
SCRIPTSUFFIX = _runme.java
|
||||
|
||||
srcdir = @srcdir@
|
||||
top_srcdir = ../@top_srcdir@
|
||||
top_builddir = ../@top_builddir@
|
||||
|
|
@ -48,6 +49,7 @@ DOXYGEN_TEST_CASES := \
|
|||
include $(srcdir)/../common.mk
|
||||
|
||||
# Overridden variables here
|
||||
SRCDIR = ../$(srcdir)/
|
||||
JAVA_PACKAGE = $*
|
||||
JAVA_PACKAGEOPT = -package $(JAVA_PACKAGE)
|
||||
SWIGOPT += $(JAVA_PACKAGEOPT)
|
||||
|
|
@ -59,6 +61,7 @@ nspace.%: JAVA_PACKAGE = $*Package
|
|||
nspace_extend.%: JAVA_PACKAGE = $*Package
|
||||
director_nspace.%: JAVA_PACKAGE = $*Package
|
||||
director_nspace_director_name_collision.%: JAVA_PACKAGE = $*Package
|
||||
doxygen_misc_constructs.%: INCLUDES = -I../$(srcdir)/..
|
||||
|
||||
# Rules for the different types of tests
|
||||
%.cpptest:
|
||||
|
|
@ -78,7 +81,7 @@ director_nspace_director_name_collision.%: JAVA_PACKAGE = $*Package
|
|||
|
||||
# Makes a directory for the testcase if it does not exist
|
||||
setup = \
|
||||
if [ -f $(srcdir)/$(SCRIPTPREFIX)$*$(SCRIPTSUFFIX) ]; then \
|
||||
if [ -f $(SCRIPTDIR)/$(SCRIPTPREFIX)$*$(SCRIPTSUFFIX) ]; then \
|
||||
echo "$(ACTION)ing $(LANGUAGE) testcase $* (with run test)" ; \
|
||||
else \
|
||||
echo "$(ACTION)ing $(LANGUAGE) testcase $*" ; \
|
||||
|
|
@ -98,8 +101,8 @@ $(DOXYGEN_TEST_CASES:=.cpptest): DOXYGEN_COMMENT_PARSER := $(srcdir)/CommentPars
|
|||
# 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 = \
|
||||
cd $(JAVA_PACKAGE) && $(COMPILETOOL) $(JAVAC) -classpath . `find . -name "*.java"` && cd .. && \
|
||||
if [ -f $(srcdir)/$(SCRIPTPREFIX)$*$(SCRIPTSUFFIX) ]; then \
|
||||
$(COMPILETOOL) $(JAVAC) -classpath $(JAVA_CLASSPATH) -d . $(DOXYGEN_COMMENT_PARSER) $(srcdir)/$(SCRIPTPREFIX)$*$(SCRIPTSUFFIX) && \
|
||||
if [ -f $(SCRIPTDIR)/$(SCRIPTPREFIX)$*$(SCRIPTSUFFIX) ]; then \
|
||||
$(COMPILETOOL) $(JAVAC) -classpath $(JAVA_CLASSPATH) -d . $(DOXYGEN_COMMENT_PARSER) $(SCRIPTDIR)/$(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 $(JAVA_CLASSPATH) $*_runme; \
|
||||
fi
|
||||
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@ public class li_boost_intrusive_ptr_runme {
|
|||
// Change loop count to run for a long time to monitor memory
|
||||
final int loopCount = 5000; //5000;
|
||||
for (int i=0; i<loopCount; i++) {
|
||||
new li_boost_intrusive_ptr_runme().runtest();
|
||||
new li_boost_intrusive_ptr_runme().runtest(i);
|
||||
System.gc();
|
||||
System.runFinalization();
|
||||
try {
|
||||
|
|
@ -78,7 +78,9 @@ public class li_boost_intrusive_ptr_runme {
|
|||
System.out.println("Finished");
|
||||
}
|
||||
|
||||
private void runtest() {
|
||||
private int loopCount = 0;
|
||||
private void runtest(int loopCount) {
|
||||
this.loopCount = loopCount;
|
||||
// simple shared_ptr usage - created in C++
|
||||
{
|
||||
Klass k = new Klass("me oh my");
|
||||
|
|
@ -671,36 +673,36 @@ private void toIgnore() {
|
|||
}
|
||||
private void verifyValue(String expected, String got) {
|
||||
if (!expected.equals(got))
|
||||
throw new RuntimeException("verify value failed. Expected: " + expected + " Got: " + got);
|
||||
throw new RuntimeException("verify value failed. Expected: " + expected + " Got: " + got + " loopCount: " + loopCount);
|
||||
}
|
||||
private void verifyCount(int expected, Klass k) {
|
||||
int got = li_boost_intrusive_ptr.use_count(k);
|
||||
if (expected != got)
|
||||
throw new RuntimeException("verify use_count failed. Expected: " + expected + " Got: " + got);
|
||||
throw new RuntimeException("verify use_count failed. Expected: " + expected + " Got: " + got + " loopCount: " + loopCount);
|
||||
}
|
||||
private void verifyCount(int expected, KlassDerived kd) {
|
||||
int got = li_boost_intrusive_ptr.use_count(kd);
|
||||
if (expected != got)
|
||||
throw new RuntimeException("verify use_count failed. Expected: " + expected + " Got: " + got);
|
||||
throw new RuntimeException("verify use_count failed. Expected: " + expected + " Got: " + got + " loopCount: " + loopCount);
|
||||
}
|
||||
private void verifyCount(int expected, KlassDerivedDerived kdd) {
|
||||
int got = li_boost_intrusive_ptr.use_count(kdd);
|
||||
if (expected != got)
|
||||
throw new RuntimeException("verify use_count failed. Expected: " + expected + " Got: " + got);
|
||||
throw new RuntimeException("verify use_count failed. Expected: " + expected + " Got: " + got + " loopCount: " + loopCount);
|
||||
}
|
||||
private void verifyIntrusiveCount(int expected, Klass k) {
|
||||
int got = k.use_count();
|
||||
if (expected != got)
|
||||
throw new RuntimeException("verify use_count failed. Expected: " + expected + " Got: " + got);
|
||||
throw new RuntimeException("verify use_count failed. Expected: " + expected + " Got: " + got + " loopCount: " + loopCount);
|
||||
}
|
||||
private void verifyIntrusiveCount(int expected, KlassDerived kd) {
|
||||
int got = kd.use_count();
|
||||
if (expected != got)
|
||||
throw new RuntimeException("verify use_count failed. Expected: " + expected + " Got: " + got);
|
||||
throw new RuntimeException("verify use_count failed. Expected: " + expected + " Got: " + got + " loopCount: " + loopCount);
|
||||
}
|
||||
private void verifyIntrusiveCount(int expected, KlassDerivedDerived kdd) {
|
||||
int got = kdd.use_count();
|
||||
if (expected != got)
|
||||
throw new RuntimeException("verify use_count failed. Expected: " + expected + " Got: " + got);
|
||||
throw new RuntimeException("verify use_count failed. Expected: " + expected + " Got: " + got + " loopCount: " + loopCount);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
45
Examples/test-suite/java/nested_extend_c_runme.java
Normal file
45
Examples/test-suite/java/nested_extend_c_runme.java
Normal file
|
|
@ -0,0 +1,45 @@
|
|||
import nested_extend_c.*;
|
||||
|
||||
public class nested_extend_c_runme {
|
||||
|
||||
static {
|
||||
try {
|
||||
System.loadLibrary("nested_extend_c");
|
||||
} catch (UnsatisfiedLinkError e) {
|
||||
System.err.println("Native code library failed to load. See the chapter on Dynamic Linking Problems in the SWIG Java documentation for help.\n" + e);
|
||||
System.exit(1);
|
||||
}
|
||||
}
|
||||
|
||||
public static void main(String argv[]) throws Throwable
|
||||
{
|
||||
{
|
||||
hiA hi = new hiA();
|
||||
if (hi.hi_extend() != 'h')
|
||||
throw new RuntimeException("test failed");
|
||||
}
|
||||
{
|
||||
lowA low = new lowA();
|
||||
if (low.low_extend() != 99)
|
||||
throw new RuntimeException("test failed");
|
||||
}
|
||||
|
||||
{
|
||||
hiB hi = new hiB();
|
||||
if (hi.hi_extend() != 'h')
|
||||
throw new RuntimeException("test failed");
|
||||
}
|
||||
{
|
||||
lowB low = new lowB();
|
||||
if (low.low_extend() != 99)
|
||||
throw new RuntimeException("test failed");
|
||||
}
|
||||
{
|
||||
FOO_bar foobar = new FOO_bar();
|
||||
foobar.setD(1234);
|
||||
if (foobar.getD() != 1234)
|
||||
throw new RuntimeException("test failed");
|
||||
foobar.bar_extend();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue