aboutsummaryrefslogtreecommitdiff
path: root/test cases
diff options
context:
space:
mode:
authorDaniel Mensinger <daniel@mensinger-ka.de>2020-02-08 18:09:04 +0100
committerDaniel Mensinger <daniel@mensinger-ka.de>2020-02-20 13:38:45 +0100
commit96f5d4e455af3eb0c296b190727b0d76014c7534 (patch)
treed7bfbb9609b2577d896898c5871df3787a9330cc /test cases
parent08224dafcba1b694fb624553e7d84deb565aae22 (diff)
downloadmeson-96f5d4e455af3eb0c296b190727b0d76014c7534.zip
meson-96f5d4e455af3eb0c296b190727b0d76014c7534.tar.gz
meson-96f5d4e455af3eb0c296b190727b0d76014c7534.tar.bz2
boost: Updated tests
Diffstat (limited to 'test cases')
-rw-r--r--test cases/frameworks/1 boost/meson.build42
-rw-r--r--test cases/frameworks/1 boost/meson_options.txt1
-rw-r--r--test cases/frameworks/1 boost/test_matrix.json19
-rw-r--r--test cases/frameworks/1 boost/unit_test.cpp1
4 files changed, 37 insertions, 26 deletions
diff --git a/test cases/frameworks/1 boost/meson.build b/test cases/frameworks/1 boost/meson.build
index eec8728..ccfaa66 100644
--- a/test cases/frameworks/1 boost/meson.build
+++ b/test cases/frameworks/1 boost/meson.build
@@ -1,31 +1,25 @@
# this test requires the following on Ubuntu: libboost-{system,python,log,thread,test}-dev
project('boosttest', 'cpp',
- default_options : ['cpp_std=c++11'])
+ default_options : ['cpp_std=c++14'])
-add_project_arguments(['-DBOOST_LOG_DYN_LINK'],
- language : 'cpp'
-)
+s = get_option('static')
-dep = dependency('boost', required: false)
+dep = dependency('boost', static: s, required: false)
if not dep.found()
error('MESON_SKIP_TEST boost not found.')
endif
-compiler = meson.get_compiler('cpp')
-if compiler.has_argument('-permissive')
- # boost 1.64, the version we test against, doesn't work with -permissive
- add_project_arguments('-permissive', language: 'cpp')
-endif
-
# We want to have multiple separate configurations of Boost
# within one project. The need to be independent of each other.
# Use one without a library dependency and one with it.
-linkdep = dependency('boost', modules : ['thread', 'system', 'test'])
-staticdep = dependency('boost', modules : ['thread', 'system'], static : true)
-testdep = dependency('boost', modules : ['unit_test_framework'])
-nomoddep = dependency('boost')
-extralibdep = dependency('boost', modules : ['thread', 'system', 'log_setup', 'log'])
+linkdep = dependency('boost', static: s, modules : ['thread', 'system'])
+testdep = dependency('boost', static: s, modules : ['unit_test_framework'])
+nomoddep = dependency('boost', static: s)
+extralibdep = dependency('boost', static: s, modules : ['thread', 'system', 'date_time', 'log_setup', 'log', 'filesystem', 'regex'])
+notfound = dependency('boost', static: s, modules : ['this_should_not_exist_on_any_systen'], required: false)
+
+assert(not notfound.found())
pymod = import('python')
python2 = pymod.find_installation('python2', required: host_machine.system() == 'linux', disabler: true)
@@ -34,28 +28,28 @@ python2dep = python2.dependency(required: host_machine.system() == 'linux', embe
python3dep = python3.dependency(required: host_machine.system() == 'linux', embed: true, disabler: true)
# compile python 2/3 modules only if we found a corresponding python version
-if(python2dep.found() and host_machine.system() == 'linux')
+if(python2dep.found() and host_machine.system() == 'linux' and not s)
if(dep.version().version_compare('>=1.67'))
# if we have a new version of boost, we need to construct the module name based
# on the installed version of python (and hope that they match the version boost
# was compiled against)
py2version_string = ''.join(python2dep.version().split('.'))
- bpython2dep = dependency('boost', modules : ['python' + py2version_string], required: false, disabler: true)
+ bpython2dep = dependency('boost', static: s, modules : ['python' + py2version_string], required: false, disabler: true)
else
# if we have an older version of boost, we need to use the old module names
- bpython2dep = dependency('boost', modules : ['python'], required: false, disabler: true)
+ bpython2dep = dependency('boost', static: s, modules : ['python'], required: false, disabler: true)
endif
else
python2dep = disabler()
bpython2dep = disabler()
endif
-if(python3dep.found() and host_machine.system() == 'linux')
+if(python3dep.found() and host_machine.system() == 'linux' and not s)
if(dep.version().version_compare('>=1.67'))
py3version_string = ''.join(python3dep.version().split('.'))
- bpython3dep = dependency('boost', modules : ['python' + py3version_string], required: false, disabler: true)
+ bpython3dep = dependency('boost', static: s, modules : ['python' + py3version_string], required: false, disabler: true)
else
- bpython3dep = dependency('boost', modules : ['python3'], required: false, disabler: true)
+ bpython3dep = dependency('boost', static: s, modules : ['python3'], required: false, disabler: true)
endif
else
python3dep = disabler()
@@ -63,7 +57,6 @@ else
endif
linkexe = executable('linkedexe', 'linkexe.cc', dependencies : linkdep)
-staticexe = executable('staticlinkedexe', 'linkexe.cc', dependencies : staticdep)
unitexe = executable('utf', 'unit_test.cpp', dependencies: testdep)
nomodexe = executable('nomod', 'nomod.cpp', dependencies : nomoddep)
extralibexe = executable('extralibexe', 'extralib.cpp', dependencies : extralibdep)
@@ -73,7 +66,6 @@ python2module = shared_library('python2_module', ['python_module.cpp'], dependen
python3module = shared_library('python3_module', ['python_module.cpp'], dependencies: [python3dep, bpython3dep], name_prefix: '', cpp_args: ['-DMOD_NAME=python3_module'])
test('Boost linktest', linkexe)
-test('Boost statictest', staticexe)
test('Boost UTF test', unitexe)
test('Boost nomod', nomodexe)
test('Boost extralib test', extralibexe)
@@ -87,4 +79,4 @@ test('Boost Python3', python3interpreter, args: ['./test_python_module.py', meso
subdir('partial_dep')
# check we can apply a version constraint
-dependency('boost', version: '>=@0@'.format(dep.version()))
+dependency('boost', static: s, version: '>=@0@'.format(dep.version()))
diff --git a/test cases/frameworks/1 boost/meson_options.txt b/test cases/frameworks/1 boost/meson_options.txt
new file mode 100644
index 0000000..019feaf
--- /dev/null
+++ b/test cases/frameworks/1 boost/meson_options.txt
@@ -0,0 +1 @@
+option('static', type: 'boolean', value: false)
diff --git a/test cases/frameworks/1 boost/test_matrix.json b/test cases/frameworks/1 boost/test_matrix.json
new file mode 100644
index 0000000..730610e
--- /dev/null
+++ b/test cases/frameworks/1 boost/test_matrix.json
@@ -0,0 +1,19 @@
+{
+ "options": {
+ "static": [
+ { "val": "true", "skip_on_env": [ "SKIP_STATIC_BOOST" ] },
+ { "val": "false" }
+ ],
+ "b_vscrt": [
+ { "val": null },
+ { "val": "md", "compilers": { "cpp": [ "msvc" ] } },
+ { "val": "mdd", "compilers": { "cpp": [ "msvc" ] } },
+ { "val": "mt", "compilers": { "cpp": [ "msvc" ] } },
+ { "val": "mtd", "compilers": { "cpp": [ "msvc" ] } }
+ ]
+ },
+ "exclude": [
+ { "static": "false", "b_vscrt": "mt" },
+ { "static": "false", "b_vscrt": "mtd" }
+ ]
+}
diff --git a/test cases/frameworks/1 boost/unit_test.cpp b/test cases/frameworks/1 boost/unit_test.cpp
index 3505999..fa1fbaa 100644
--- a/test cases/frameworks/1 boost/unit_test.cpp
+++ b/test cases/frameworks/1 boost/unit_test.cpp
@@ -1,4 +1,3 @@
-#define BOOST_TEST_DYN_LINK
#define BOOST_TEST_MODULE "MesonTest"
#define BOOST_TEST_MAIN
#include <boost/test/unit_test.hpp>