The errors testcases use -module to obtain a unique module name

Fixes parallel make where each invocation of swig was writing and
deleting the same file resulting in lots of the newly introduced
warning messages:

  On exit, could not delete file xxx.py: No such file or directory
This commit is contained in:
William S Fulton 2019-07-30 07:27:32 +01:00
parent 2cf075558c
commit 0d76eb3b56
13 changed files with 19 additions and 14 deletions

View File

@ -45,6 +45,11 @@ include $(srcdir)/../common.mk
# whatever we do here.
$(DOXYGEN_ERROR_TEST_CASES): SWIGOPT += -doxygen
# Unique module names are obtained from the .i file name (required for parallel make).
# Note: -module overrides %module in the .i file.
MODULE_OPTION=-module $*
nomodule.ctest: MODULE_OPTION =
# Portable dos2unix / todos for stripping CR
TODOS = tr -d '\r'
#TODOS = sed -e 's/\r$$//' # On Mac OS X behaves as if written 's/r$$//'
@ -55,12 +60,12 @@ STRIP_SRCDIR = sed -e 's|\\|/|g' -e 's|^$(SRCDIR)||'
# Rules for the different types of tests
%.cpptest:
echo "$(ACTION)ing errors testcase $*"
-$(SWIGINVOKE) -c++ -python -Wall -Fstandard $(SWIGOPT) $(SRCDIR)$*.i 2>&1 | $(TODOS) | $(STRIP_SRCDIR) > $*.$(ERROR_EXT)
-$(SWIGINVOKE) -c++ -python -Wall -Fstandard $(MODULE_OPTION) $(SWIGOPT) $(SRCDIR)$*.i 2>&1 | $(TODOS) | $(STRIP_SRCDIR) > $*.$(ERROR_EXT)
$(COMPILETOOL) diff -c $(SRCDIR)$*.stderr $*.$(ERROR_EXT)
%.ctest:
echo "$(ACTION)ing errors testcase $*"
-$(SWIGINVOKE) -python -Wall -Fstandard $(SWIGOPT) $(SRCDIR)$*.i 2>&1 | $(TODOS) | $(STRIP_SRCDIR) > $*.$(ERROR_EXT)
-$(SWIGINVOKE) -python -Wall -Fstandard $(MODULE_OPTION) $(SWIGOPT) $(SRCDIR)$*.i 2>&1 | $(TODOS) | $(STRIP_SRCDIR) > $*.$(ERROR_EXT)
$(COMPILETOOL) diff -c $(SRCDIR)$*.stderr $*.$(ERROR_EXT)
%.clean:

View File

@ -1,4 +1,4 @@
%module cpp_extra_brackets
%module xxx
// Extra brackets was segfaulting in SWIG-3.0.0
struct ABC {

View File

@ -1,4 +1,4 @@
%module cpp_extra_brackets
%module xxx
// Extra brackets was segfaulting in SWIG-3.0.0
struct ABC {

View File

@ -1,4 +1,4 @@
%module cpp_invalid_qualifiers
%module xxx
// Constructors, destructors and static methods cannot have qualifiers
struct A {

View File

@ -1,4 +1,4 @@
%module cpp_invalid_scope
%module xxx
%template(abc) SSS::AAA<int>;

View File

@ -1,4 +1,4 @@
%module namespace_template
%module xxx
namespace test {
template<typename T> T max(T a, T b) { return (a > b) ? a : b; }

View File

@ -1,4 +1,4 @@
%module cpp_nested_namespace_alias
%module xxx
// C++17 nested namespaces

View File

@ -1,4 +1,4 @@
%module cpp_recursive_typedef
%module xxx
typedef std::set<pds> pds;

View File

@ -1,4 +1,4 @@
%module cpp_refqualifier
%module xxx
%ignore Host::h_ignored;
%ignore Host::i_ignored() &&;

View File

@ -1,4 +1,4 @@
%module cpp_shared_ptr
%module xxx
%include <boost_shared_ptr.i>

View File

@ -1,4 +1,4 @@
%module cpp_template_duplicate_names
%module xxx
// From test-suite/template_class_reuse.i test

View File

@ -1,4 +1,4 @@
%module cpp_template_friend
%module xxx
template<typename T> T template_friend1(T);
template<typename T> T template_friend1(T);

View File

@ -1,3 +1,3 @@
%module test
%module xxx
%include "missing_filename.i"