diff --git a/test cases/frameworks/1 boost/linkexe.cc b/test cases/frameworks/1 boost/linkexe.cc new file mode 100644 index 000000000..e9f4047a1 --- /dev/null +++ b/test cases/frameworks/1 boost/linkexe.cc @@ -0,0 +1,12 @@ +#include + +struct callable { + void operator()() {}; +}; + +int main(int argc, char **argv) { + callable x; + boost::thread thr(x); + thr.join(); + return 0; +} diff --git a/test cases/frameworks/1 boost/meson.build b/test cases/frameworks/1 boost/meson.build new file mode 100644 index 000000000..15455c507 --- /dev/null +++ b/test cases/frameworks/1 boost/meson.build @@ -0,0 +1,14 @@ +project('boosttest', 'cxx') + +# One test case for a Boost module that is +# header only and one test case for a module that +# requires linking with a shared library. + +nolinkdep = find_dep('boost', modules : 'utility', required : true) +linkdep = find_dep('boost', modules : 'thread', required : true) + +nolinkexe = executable('nolinkexe', 'nolinkexe.cc', dep : nolinkdep) +linkexe = executable('linkedexe', 'linkexe.cc', dep : linkdep) + +add_test('nolinktest', nolinkexe) +add_test('linktext', linkexe) diff --git a/test cases/frameworks/1 boost/nolinkexe.cc b/test cases/frameworks/1 boost/nolinkexe.cc new file mode 100644 index 000000000..e81f3fb31 --- /dev/null +++ b/test cases/frameworks/1 boost/nolinkexe.cc @@ -0,0 +1,20 @@ +#include + +class MyClass : boost::noncopyable { +private: + int x; + +public: + MyClass() { + x = 44; + } + + int getValue() const { return x; } +}; + +int main(int argc, char **argv) { + MyClass foo; + if(foo.getValue() == 44) + return 0; + return 1; +}