summaryrefslogtreecommitdiff
path: root/test cases
diff options
context:
space:
mode:
authorDylan Baker <dylan@pnwbakers.com>2021-06-30 13:03:54 -0700
committerDylan Baker <dylan@pnwbakers.com>2021-06-30 16:28:14 -0700
commitbc4201a7f1e93d6afb62caa8ce81bb1b0211b70c (patch)
treee630b202d1e35803a87cb1306517f79d91dbe0de /test cases
parent4a0a6a80837af1b75db3b3b57a5b8f41386e5c0b (diff)
downloadmeson-bc4201a7f1e93d6afb62caa8ce81bb1b0211b70c.tar.gz
interpreter: add required and disabled to import
This is useful both from the perspective of optional functionality that requires a module, and also as I continue to progress with Meson++, which will probably not implement all of the modules that Meson itself does.
Diffstat (limited to 'test cases')
-rw-r--r--test cases/common/67 modules/meson.build10
-rw-r--r--test cases/common/67 modules/meson_options.txt6
-rw-r--r--test cases/failing/57 kwarg in module/meson.build5
-rw-r--r--test cases/failing/57 kwarg in module/test.json7
4 files changed, 16 insertions, 12 deletions
diff --git a/test cases/common/67 modules/meson.build b/test cases/common/67 modules/meson.build
index e9750cd97..ad33ed6d4 100644
--- a/test cases/common/67 modules/meson.build
+++ b/test cases/common/67 modules/meson.build
@@ -2,3 +2,13 @@ project('module test', 'c')
modtest = import('modtest')
modtest.print_hello()
+assert(modtest.found())
+
+modtest = import('modtest', required : get_option('disabled'))
+assert(not modtest.found())
+
+notfound = import('not-found', required : false)
+assert(not notfound.found())
+
+disabled = import('not-found', required : false, disabler : true)
+assert(is_disabler(disabled))
diff --git a/test cases/common/67 modules/meson_options.txt b/test cases/common/67 modules/meson_options.txt
new file mode 100644
index 000000000..06711447d
--- /dev/null
+++ b/test cases/common/67 modules/meson_options.txt
@@ -0,0 +1,6 @@
+option(
+ 'disabled',
+ type : 'feature',
+ value : 'disabled',
+ description : 'test disabled'
+)
diff --git a/test cases/failing/57 kwarg in module/meson.build b/test cases/failing/57 kwarg in module/meson.build
deleted file mode 100644
index b105db152..000000000
--- a/test cases/failing/57 kwarg in module/meson.build
+++ /dev/null
@@ -1,5 +0,0 @@
-project('module test', 'c')
-
-modtest = import('modtest', i_cause: 'a_build_failure')
-modtest.print_hello()
-
diff --git a/test cases/failing/57 kwarg in module/test.json b/test cases/failing/57 kwarg in module/test.json
deleted file mode 100644
index cafb3ab64..000000000
--- a/test cases/failing/57 kwarg in module/test.json
+++ /dev/null
@@ -1,7 +0,0 @@
-{
- "stdout": [
- {
- "line": "test cases/failing/57 kwarg in module/meson.build:3:0: ERROR: Function does not take keyword arguments."
- }
- ]
-}