aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJussi Pakkanen <jpakkane@gmail.com>2013-03-24 13:21:35 +0200
committerJussi Pakkanen <jpakkane@gmail.com>2013-03-24 13:21:35 +0200
commit92084b6d9e71fc32a2e33658e2623003b14d4b0d (patch)
tree2913d0d31ba35a8382ac56aff403507a7c641b76
parent39002095c9ebf2138ed73228dc696ffcaee58790 (diff)
downloadmeson-92084b6d9e71fc32a2e33658e2623003b14d4b0d.zip
meson-92084b6d9e71fc32a2e33658e2623003b14d4b0d.tar.gz
meson-92084b6d9e71fc32a2e33658e2623003b14d4b0d.tar.bz2
Added test case for Boost.
-rw-r--r--test cases/frameworks/1 boost/linkexe.cc12
-rw-r--r--test cases/frameworks/1 boost/meson.build14
-rw-r--r--test cases/frameworks/1 boost/nolinkexe.cc20
3 files changed, 46 insertions, 0 deletions
diff --git a/test cases/frameworks/1 boost/linkexe.cc b/test cases/frameworks/1 boost/linkexe.cc
new file mode 100644
index 0000000..e9f4047
--- /dev/null
+++ b/test cases/frameworks/1 boost/linkexe.cc
@@ -0,0 +1,12 @@
+#include<boost/thread.hpp>
+
+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 0000000..15455c5
--- /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 0000000..e81f3fb
--- /dev/null
+++ b/test cases/frameworks/1 boost/nolinkexe.cc
@@ -0,0 +1,20 @@
+#include<boost/utility.hpp>
+
+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;
+}