Fix %import and %fragment forced inclusion to not generate code.
This commit is contained in:
parent
857a62425c
commit
57a89f987d
8 changed files with 186 additions and 7 deletions
|
|
@ -246,6 +246,7 @@ CPP_TEST_CASES += \
|
|||
global_vars \
|
||||
grouping \
|
||||
ignore_parameter \
|
||||
import_fragments \
|
||||
import_nomodule \
|
||||
inherit \
|
||||
inherit_member \
|
||||
|
|
|
|||
18
Examples/test-suite/import_fragments.i
Normal file
18
Examples/test-suite/import_fragments.i
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
%module import_fragments
|
||||
|
||||
// Check %fragments forced inclusion does not result in code generation when using %import
|
||||
%import "import_fragments_a.i"
|
||||
|
||||
%{
|
||||
template<typename T>
|
||||
struct TemplateA4 {};
|
||||
%}
|
||||
|
||||
%template(TemplateA4Int) TemplateA4<int>;
|
||||
|
||||
%inline %{
|
||||
int getImport4() {
|
||||
// Requires the ImportA4 fragment to be generated in order to compile
|
||||
return ImportA4;
|
||||
}
|
||||
%}
|
||||
45
Examples/test-suite/import_fragments_a.i
Normal file
45
Examples/test-suite/import_fragments_a.i
Normal file
|
|
@ -0,0 +1,45 @@
|
|||
%module import_fragments_a
|
||||
|
||||
%fragment("ImportA1", "header") %{
|
||||
ImportA1_this_will_not_compile;
|
||||
%}
|
||||
%fragment("ImportA2", "header") %{
|
||||
ImportA2_this_will_not_compile;
|
||||
%}
|
||||
%fragment("ImportA3", "header") %{
|
||||
ImportA3_this_will_not_compile;
|
||||
%}
|
||||
%fragment("ImportA4", "header") %{
|
||||
static int ImportA4 = 99;
|
||||
%}
|
||||
%fragment("ImportA5", "header") %{
|
||||
ImportA5_this_will_not_compile;
|
||||
%}
|
||||
|
||||
%fragment("ImportA1");
|
||||
|
||||
%{
|
||||
Import_will_not_compile;
|
||||
%}
|
||||
|
||||
struct StructA {
|
||||
%fragment("ImportA2");
|
||||
};
|
||||
|
||||
template<typename T>
|
||||
struct TemplateA3 {
|
||||
%fragment("ImportA3");
|
||||
};
|
||||
|
||||
template<typename T>
|
||||
struct TemplateA4 {
|
||||
%fragment("ImportA4");
|
||||
};
|
||||
|
||||
template<typename T>
|
||||
struct TemplateA5 {
|
||||
%fragment("ImportA5");
|
||||
};
|
||||
%template(TemplateA5Double) TemplateA5<double>;
|
||||
|
||||
%include "import_fragments_b.i"
|
||||
9
Examples/test-suite/import_fragments_b.i
Normal file
9
Examples/test-suite/import_fragments_b.i
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
%module import_fragments_b
|
||||
|
||||
%fragment("ImportB", "header") %{
|
||||
ImportB_this_will_not_compile;
|
||||
%}
|
||||
|
||||
%fragment("ImportB");
|
||||
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue