aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEli Schwartz <eschwartz@archlinux.org>2021-06-15 22:45:31 -0400
committerEli Schwartz <eschwartz@archlinux.org>2021-06-17 13:22:25 -0400
commitad206037e321237bc664227764a5b3fe6243c554 (patch)
tree70d89e5f1923011c6984ed3091fc68f677c14ddb
parentbbcc91c1e5a904639633a5797d635852a0f77971 (diff)
downloadmeson-ad206037e321237bc664227764a5b3fe6243c554.zip
meson-ad206037e321237bc664227764a5b3fe6243c554.tar.gz
meson-ad206037e321237bc664227764a5b3fe6243c554.tar.bz2
tests: update dependency factory tests to check type_name is sane
Since we pass a method: 'foo' to every one of these config-tool/pkg-config dependencies, we do not ever need to check which type_name it has; change these to asserts instead. In the process, we discover a bug! We kept checking for type 'configtool' instead of 'config-tool', so these tests all short-circuited and checked nothing. Once moved to an assert, the asserts failed. Add a new lookup for a known system dependency and make it assert that too.
-rw-r--r--test cases/common/164 dependency factory/meson.build37
1 files changed, 26 insertions, 11 deletions
diff --git a/test cases/common/164 dependency factory/meson.build b/test cases/common/164 dependency factory/meson.build
index 2de0f0e..9488cd4 100644
--- a/test cases/common/164 dependency factory/meson.build
+++ b/test cases/common/164 dependency factory/meson.build
@@ -1,51 +1,66 @@
-project('dependency factory', 'c', meson_version : '>=0.40')
+project('dependency factory', 'c', meson_version : '>=0.53')
dep = dependency('gl', method: 'pkg-config', required: false)
-if dep.found() and dep.type_name() == 'pkgconfig'
+if dep.found()
+ assert(dep.type_name() == 'pkgconfig')
dep.get_pkgconfig_variable('prefix')
endif
dep = dependency('SDL2', method: 'pkg-config', required: false)
-if dep.found() and dep.type_name() == 'pkgconfig'
+if dep.found()
+ assert(dep.type_name() == 'pkgconfig')
dep.get_pkgconfig_variable('prefix')
endif
dep = dependency('SDL2', method: 'config-tool', required: false)
-if dep.found() and dep.type_name() == 'configtool'
+if dep.found()
+ assert(dep.type_name() == 'config-tool')
dep.get_configtool_variable('prefix')
endif
dep = dependency('Vulkan', method: 'pkg-config', required: false)
-if dep.found() and dep.type_name() == 'pkgconfig'
+if dep.found()
+ assert(dep.type_name() == 'pkgconfig')
dep.get_pkgconfig_variable('prefix')
endif
dep = dependency('pcap', method: 'pkg-config', required: false)
-if dep.found() and dep.type_name() == 'pkgconfig'
+if dep.found()
+ assert(dep.type_name() == 'pkgconfig')
dep.get_pkgconfig_variable('prefix')
endif
dep = dependency('pcap', method: 'config-tool', required: false)
-if dep.found() and dep.type_name() == 'configtool'
+if dep.found()
+ assert(dep.type_name() == 'config-tool')
dep.get_configtool_variable('prefix')
endif
dep = dependency('cups', method: 'pkg-config', required: false)
-if dep.found() and dep.type_name() == 'pkgconfig'
+if dep.found()
+ assert(dep.type_name() == 'pkgconfig')
dep.get_pkgconfig_variable('prefix')
endif
dep = dependency('cups', method: 'config-tool', required: false)
-if dep.found() and dep.type_name() == 'configtool'
+if dep.found()
+ assert(dep.type_name() == 'config-tool')
dep.get_configtool_variable('prefix')
endif
dep = dependency('libwmf', method: 'pkg-config', required: false)
-if dep.found() and dep.type_name() == 'pkgconfig'
+if dep.found()
+ assert(dep.type_name() == 'pkgconfig')
dep.get_pkgconfig_variable('prefix')
endif
dep = dependency('libwmf', method: 'config-tool', required: false)
-if dep.found() and dep.type_name() == 'configtool'
+if dep.found()
+ assert(dep.type_name() == 'config-tool')
dep.get_configtool_variable('prefix')
endif
+
+dep = dependency('boost', method: 'system', required: false)
+if dep.found()
+ assert(dep.type_name() == 'system')
+endif