aboutsummaryrefslogtreecommitdiff
path: root/test cases
diff options
context:
space:
mode:
authorcmcneish <46431947+cmcneish@users.noreply.github.com>2020-07-21 07:40:29 -0700
committerGitHub <noreply@github.com>2020-07-21 16:40:29 +0200
commita7a6a4833f5eb2d6c2270945ec762fdae0bb0786 (patch)
tree716120fdf4c795cfdee08137742fa76007bdbfbb /test cases
parent7f1e9b7492862d5a99064abc6d1a4ce903ba6fd9 (diff)
downloadmeson-a7a6a4833f5eb2d6c2270945ec762fdae0bb0786.zip
meson-a7a6a4833f5eb2d6c2270945ec762fdae0bb0786.tar.gz
meson-a7a6a4833f5eb2d6c2270945ec762fdae0bb0786.tar.bz2
Add boost_root support to properties files (#7210)
* Add boost_root support to properties files This commit implements `boost_root`, `boost_includedir`, and `boost_librarydir` variable support to native and cross properties files. The search order is currently environment variables, then these variables, and finally a platform-dependent search. * Add preliminary boost_root / boost_includedir tests Each test contains a fake "version.hpp", as that's how boost detection is currently being done. We look for this file relative to the root directory, which probably shouldn't be allowed (it previously was for BOOST_LIBRARYDIR but not for BOOST_ROOT). It also cannot help with breakage detection in libraries, however it looks like this wasn't getting tested beforehand. I've given the two unique version numbers that shouldn't be present in any stock version of boost (001 and 002). * Add return type to detect_split_root * Return empty list when nothing found in BOOST_ROOT, rather than None * Update boost_root tests * Create nativefile.ini based on location of run_project_tests.py * Add fake libraries to ensure boost_librarydir is being used * Require all search paths for boost to be absolute * Redo boost search ordering To better match things like pkg-config, we now look through native/cross files, then environment variables, then system locations for boost installations. Path detection does not fall back from one method to the next for properties or environment variables--if boost_root, boost_librarydir, or boost_includedir is specified, they must be sufficient to find boost. Likewise for BOOST_ROOT and friends. pkg-config detection is still optional falling back to system-wide detection, for Conan. (Also, fix a typo in test 33's nativefile) * Correct return type for detect_roots * Correct boost dependency search order in documentation * Print debug information for boost library finding, to resolve CI issues * Handle native/cross file templates in a more consistent way All tests can now create a `nativefile.ini.in` if they need to use some parameter that the testing framework knows about but they can't. * Pass str--rather than PosixPath--to os.path.exists, for Python35 * Look for boost minor versions, rather than boost patch versions in test cases * Drop fake dylib versions of boost_regex * Prefer get_env_var to use of os.environ * Correct error reporting for relative BOOST_ROOT paths * Bump version this appears in. Also, change "properties file" to "machine file" as that appears to be the more common language.
Diffstat (limited to 'test cases')
-rw-r--r--test cases/frameworks/32 boost root/boost/include/boost/version.hpp3
-rw-r--r--test cases/frameworks/32 boost root/boost/lib/boost_regex-vc142-mt-gd-x32-0_1.lib0
-rw-r--r--test cases/frameworks/32 boost root/boost/lib/boost_regex-vc142-mt-gd-x64-0_1.lib0
-rw-r--r--test cases/frameworks/32 boost root/boost/lib/libboost_regex.so.0.1.00
-rw-r--r--test cases/frameworks/32 boost root/meson.build6
-rw-r--r--test cases/frameworks/32 boost root/nativefile.ini.in2
-rw-r--r--test cases/frameworks/33 boost split root/boost/extra-dir/include/boost/version.hpp3
-rw-r--r--test cases/frameworks/33 boost split root/boost/lib/boost_regex-vc142-mt-gd-x32-0_2.lib0
-rw-r--r--test cases/frameworks/33 boost split root/boost/lib/boost_regex-vc142-mt-gd-x64-0_2.lib0
-rw-r--r--test cases/frameworks/33 boost split root/boost/lib/libboost_regex.so.0.2.00
-rw-r--r--test cases/frameworks/33 boost split root/meson.build6
-rw-r--r--test cases/frameworks/33 boost split root/nativefile.ini.in3
12 files changed, 23 insertions, 0 deletions
diff --git a/test cases/frameworks/32 boost root/boost/include/boost/version.hpp b/test cases/frameworks/32 boost root/boost/include/boost/version.hpp
new file mode 100644
index 0000000..65e4fab
--- /dev/null
+++ b/test cases/frameworks/32 boost root/boost/include/boost/version.hpp
@@ -0,0 +1,3 @@
+#define BOOST_VERSION 100
+
+#error This is not a real version of boost
diff --git a/test cases/frameworks/32 boost root/boost/lib/boost_regex-vc142-mt-gd-x32-0_1.lib b/test cases/frameworks/32 boost root/boost/lib/boost_regex-vc142-mt-gd-x32-0_1.lib
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/test cases/frameworks/32 boost root/boost/lib/boost_regex-vc142-mt-gd-x32-0_1.lib
diff --git a/test cases/frameworks/32 boost root/boost/lib/boost_regex-vc142-mt-gd-x64-0_1.lib b/test cases/frameworks/32 boost root/boost/lib/boost_regex-vc142-mt-gd-x64-0_1.lib
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/test cases/frameworks/32 boost root/boost/lib/boost_regex-vc142-mt-gd-x64-0_1.lib
diff --git a/test cases/frameworks/32 boost root/boost/lib/libboost_regex.so.0.1.0 b/test cases/frameworks/32 boost root/boost/lib/libboost_regex.so.0.1.0
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/test cases/frameworks/32 boost root/boost/lib/libboost_regex.so.0.1.0
diff --git a/test cases/frameworks/32 boost root/meson.build b/test cases/frameworks/32 boost root/meson.build
new file mode 100644
index 0000000..50d2f0d
--- /dev/null
+++ b/test cases/frameworks/32 boost root/meson.build
@@ -0,0 +1,6 @@
+project('boosttest', 'cpp')
+
+dep = dependency('boost', modules : 'regex', required: false)
+
+assert(dep.found(), 'expected to find a fake version of boost')
+assert(dep.version() == '0.1.0', 'expected to find version 0.1.0')
diff --git a/test cases/frameworks/32 boost root/nativefile.ini.in b/test cases/frameworks/32 boost root/nativefile.ini.in
new file mode 100644
index 0000000..54510d7
--- /dev/null
+++ b/test cases/frameworks/32 boost root/nativefile.ini.in
@@ -0,0 +1,2 @@
+[properties]
+boost_root = '@MESON_TEST_ROOT@/boost'
diff --git a/test cases/frameworks/33 boost split root/boost/extra-dir/include/boost/version.hpp b/test cases/frameworks/33 boost split root/boost/extra-dir/include/boost/version.hpp
new file mode 100644
index 0000000..3ba19ee
--- /dev/null
+++ b/test cases/frameworks/33 boost split root/boost/extra-dir/include/boost/version.hpp
@@ -0,0 +1,3 @@
+#define BOOST_VERSION 200
+
+#error This is not a real version of boost
diff --git a/test cases/frameworks/33 boost split root/boost/lib/boost_regex-vc142-mt-gd-x32-0_2.lib b/test cases/frameworks/33 boost split root/boost/lib/boost_regex-vc142-mt-gd-x32-0_2.lib
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/test cases/frameworks/33 boost split root/boost/lib/boost_regex-vc142-mt-gd-x32-0_2.lib
diff --git a/test cases/frameworks/33 boost split root/boost/lib/boost_regex-vc142-mt-gd-x64-0_2.lib b/test cases/frameworks/33 boost split root/boost/lib/boost_regex-vc142-mt-gd-x64-0_2.lib
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/test cases/frameworks/33 boost split root/boost/lib/boost_regex-vc142-mt-gd-x64-0_2.lib
diff --git a/test cases/frameworks/33 boost split root/boost/lib/libboost_regex.so.0.2.0 b/test cases/frameworks/33 boost split root/boost/lib/libboost_regex.so.0.2.0
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/test cases/frameworks/33 boost split root/boost/lib/libboost_regex.so.0.2.0
diff --git a/test cases/frameworks/33 boost split root/meson.build b/test cases/frameworks/33 boost split root/meson.build
new file mode 100644
index 0000000..a2353bb
--- /dev/null
+++ b/test cases/frameworks/33 boost split root/meson.build
@@ -0,0 +1,6 @@
+project('boosttest', 'cpp')
+
+dep = dependency('boost', modules : 'regex', required: false)
+
+assert(dep.found(), 'expected to find a fake version of boost')
+assert(dep.version() == '0.2.0', 'expected to find version 0.2.0')
diff --git a/test cases/frameworks/33 boost split root/nativefile.ini.in b/test cases/frameworks/33 boost split root/nativefile.ini.in
new file mode 100644
index 0000000..7bd5ac2
--- /dev/null
+++ b/test cases/frameworks/33 boost split root/nativefile.ini.in
@@ -0,0 +1,3 @@
+[properties]
+boost_includedir = '@MESON_TEST_ROOT@/boost/extra-dir/include'
+boost_librarydir = '@MESON_TEST_ROOT@/boost/lib'