aboutsummaryrefslogtreecommitdiffstats
path: root/meson/test cases/common/193 feature option disabled
diff options
context:
space:
mode:
authorAngelos Mouzakitis <a.mouzakitis@virtualopensystems.com>2023-10-10 14:33:42 +0000
committerAngelos Mouzakitis <a.mouzakitis@virtualopensystems.com>2023-10-10 14:33:42 +0000
commitaf1a266670d040d2f4083ff309d732d648afba2a (patch)
tree2fc46203448ddcc6f81546d379abfaeb323575e9 /meson/test cases/common/193 feature option disabled
parente02cda008591317b1625707ff8e115a4841aa889 (diff)
Add submodule dependency filesHEADmaster
Change-Id: Iaf8d18082d3991dec7c0ebbea540f092188eb4ec
Diffstat (limited to 'meson/test cases/common/193 feature option disabled')
-rw-r--r--meson/test cases/common/193 feature option disabled/meson.build23
-rw-r--r--meson/test cases/common/193 feature option disabled/meson_options.txt3
2 files changed, 26 insertions, 0 deletions
diff --git a/meson/test cases/common/193 feature option disabled/meson.build b/meson/test cases/common/193 feature option disabled/meson.build
new file mode 100644
index 000000000..1a831872a
--- /dev/null
+++ b/meson/test cases/common/193 feature option disabled/meson.build
@@ -0,0 +1,23 @@
+project('feature user option', 'c',
+ default_options : ['auto_features=disabled'])
+
+feature_opts = get_option('auto_features')
+required_opt = get_option('required')
+optional_opt = get_option('optional')
+disabled_opt = get_option('disabled')
+
+assert(not feature_opts.enabled(), 'Should be disabled option')
+assert(feature_opts.disabled(), 'Should be disabled option')
+assert(not feature_opts.auto(), 'Should be disabled option')
+
+assert(required_opt.enabled(), 'Should be enabled option')
+assert(not required_opt.disabled(), 'Should be enabled option')
+assert(not required_opt.auto(), 'Should be enabled option')
+
+assert(not optional_opt.enabled(), 'Auto feature should be disabled')
+assert(optional_opt.disabled(), 'Auto feature should be disabled')
+assert(not optional_opt.auto(), 'Auto feature should be disabled')
+
+assert(not disabled_opt.enabled(), 'Should be disabled option')
+assert(disabled_opt.disabled(), 'Should be disabled option')
+assert(not disabled_opt.auto(), 'Should be disabled option')
diff --git a/meson/test cases/common/193 feature option disabled/meson_options.txt b/meson/test cases/common/193 feature option disabled/meson_options.txt
new file mode 100644
index 000000000..063a35f39
--- /dev/null
+++ b/meson/test cases/common/193 feature option disabled/meson_options.txt
@@ -0,0 +1,3 @@
+option('required', type : 'feature', value : 'enabled', description : 'An required feature')
+option('optional', type : 'feature', value : 'auto', description : 'An optional feature')
+option('disabled', type : 'feature', value : 'disabled', description : 'A disabled feature')