aboutsummaryrefslogtreecommitdiff
path: root/test cases
diff options
context:
space:
mode:
authorDylan Baker <dylan@pnwbakers.com>2020-09-14 11:36:38 -0700
committerJussi Pakkanen <jpakkane@gmail.com>2020-10-05 23:10:35 +0300
commit94ac51fdda0408c6d1f61e7e5e89cebaa9182842 (patch)
tree58fd6d3b44c2cb2b57fb9c8f6dbfb17fe4c36cae /test cases
parentc4fa87692547a25f772b3da336147b4eb9114f64 (diff)
downloadmeson-94ac51fdda0408c6d1f61e7e5e89cebaa9182842.zip
meson-94ac51fdda0408c6d1f61e7e5e89cebaa9182842.tar.gz
meson-94ac51fdda0408c6d1f61e7e5e89cebaa9182842.tar.bz2
options: Handle updates to choices in options
Currently if you change the `choices` field in the meson_options.txt file, no update will be done until `meson setup --wipe` is called. Now if the choices change then the options will be properly merged. If the currently select value is still valid it is guaranteed to be kept, if it is now invalid the new default value will be used and a warning will be printed. Fixes #7386
Diffstat (limited to 'test cases')
-rw-r--r--test cases/unit/84 change option choices/meson.build1
-rw-r--r--test cases/unit/84 change option choices/meson_options.1.txt13
-rw-r--r--test cases/unit/84 change option choices/meson_options.2.txt13
3 files changed, 27 insertions, 0 deletions
diff --git a/test cases/unit/84 change option choices/meson.build b/test cases/unit/84 change option choices/meson.build
new file mode 100644
index 0000000..d056d65
--- /dev/null
+++ b/test cases/unit/84 change option choices/meson.build
@@ -0,0 +1 @@
+project('change option choices')
diff --git a/test cases/unit/84 change option choices/meson_options.1.txt b/test cases/unit/84 change option choices/meson_options.1.txt
new file mode 100644
index 0000000..d0326a5
--- /dev/null
+++ b/test cases/unit/84 change option choices/meson_options.1.txt
@@ -0,0 +1,13 @@
+option(
+ 'combo',
+ type : 'combo',
+ choices : ['a', 'b', 'c'],
+ value : 'a',
+)
+
+option(
+ 'array',
+ type : 'array',
+ choices : ['a', 'b', 'c'],
+ value : ['a'],
+)
diff --git a/test cases/unit/84 change option choices/meson_options.2.txt b/test cases/unit/84 change option choices/meson_options.2.txt
new file mode 100644
index 0000000..4684673
--- /dev/null
+++ b/test cases/unit/84 change option choices/meson_options.2.txt
@@ -0,0 +1,13 @@
+option(
+ 'combo',
+ type : 'combo',
+ choices : ['b', 'c', 'd'],
+ value : 'b',
+)
+
+option(
+ 'array',
+ type : 'array',
+ choices : ['b', 'c', 'd'],
+ value : ['b'],
+)