Create unit test for C++ modules and accept ixx as C++ source extension.

pull/8013/head
Jussi Pakkanen 4 years ago
parent b8cb53791e
commit 5bd1276d20
  1. 2
      mesonbuild/compilers/compilers.py
  2. 7
      test cases/unit/87 cpp modules/main.cpp
  3. 17
      test cases/unit/87 cpp modules/meson.build
  4. 7
      test cases/unit/87 cpp modules/src0.ixx
  5. 7
      test cases/unit/87 cpp modules/src1.ixx
  6. 7
      test cases/unit/87 cpp modules/src2.ixx
  7. 7
      test cases/unit/87 cpp modules/src3.ixx
  8. 7
      test cases/unit/87 cpp modules/src4.ixx
  9. 7
      test cases/unit/87 cpp modules/src5.ixx
  10. 7
      test cases/unit/87 cpp modules/src6.ixx
  11. 7
      test cases/unit/87 cpp modules/src7.ixx
  12. 7
      test cases/unit/87 cpp modules/src8.ixx
  13. 5
      test cases/unit/87 cpp modules/src9.ixx

@ -55,7 +55,7 @@ lib_suffixes = ('a', 'lib', 'dll', 'dll.a', 'dylib', 'so') # type: T.Tuple[str,
# This means we can't include .h headers here since they could be C, C++, ObjC, etc.
lang_suffixes = {
'c': ('c',),
'cpp': ('cpp', 'cc', 'cxx', 'c++', 'hh', 'hpp', 'ipp', 'hxx', 'ino'),
'cpp': ('cpp', 'cc', 'cxx', 'c++', 'hh', 'hpp', 'ipp', 'hxx', 'ino', 'ixx'),
'cuda': ('cu',),
# f90, f95, f03, f08 are for free-form fortran ('f90' recommended)
# f, for, ftn, fpp are for fixed-form fortran ('f' or 'for' recommended)

@ -0,0 +1,7 @@
import M0;
#include<cstdio>
int main() {
printf("The value is %d", func0());
return 0;
}

@ -0,0 +1,17 @@
project('cppmodules', 'cpp', default_options: ['cpp_std=c++latest'])
e = executable('modtest',
'main.cpp',
'src0.ixx',
'src1.ixx',
'src2.ixx',
'src3.ixx',
'src4.ixx',
'src5.ixx',
'src6.ixx',
'src7.ixx',
'src8.ixx',
'src9.ixx',
)
test('modtest', e)

@ -0,0 +1,7 @@
export module M0;
import M1;
export int func0() {
return func1();
}

@ -0,0 +1,7 @@
export module M1;
import M2;
export int func1() {
return func2();
}

@ -0,0 +1,7 @@
export module M2;
import M3;
export int func2() {
return func3();
}

@ -0,0 +1,7 @@
export module M3;
import M4;
export int func3() {
return func4();
}

@ -0,0 +1,7 @@
export module M4;
import M5;
export int func4() {
return func5();
}

@ -0,0 +1,7 @@
export module M5;
import M6;
export int func5() {
return func6();
}

@ -0,0 +1,7 @@
export module M6;
import M7;
export int func6() {
return func7();
}

@ -0,0 +1,7 @@
export module M7;
import M8;
export int func7() {
return func8();
}

@ -0,0 +1,7 @@
export module M8;
import M9;
export int func8() {
return func9();
}

@ -0,0 +1,5 @@
export module M9;
export int func9() {
return 42;
}
Loading…
Cancel
Save