aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--mesonbuild/mintro.py2
-rw-r--r--unittests/allplatformstests.py7
2 files changed, 7 insertions, 2 deletions
diff --git a/mesonbuild/mintro.py b/mesonbuild/mintro.py
index 8408720..130cf93 100644
--- a/mesonbuild/mintro.py
+++ b/mesonbuild/mintro.py
@@ -287,6 +287,8 @@ def list_buildoptions(coredata: cdata.CoreData, subprojects: T.Optional[T.List[s
typestr = 'integer'
elif isinstance(opt, cdata.UserArrayOption):
typestr = 'array'
+ if opt.choices:
+ optdict['choices'] = opt.choices
else:
raise RuntimeError("Unknown option type")
optdict['type'] = typestr
diff --git a/unittests/allplatformstests.py b/unittests/allplatformstests.py
index 7af5956..da461e4 100644
--- a/unittests/allplatformstests.py
+++ b/unittests/allplatformstests.py
@@ -1595,6 +1595,7 @@ class AllPlatformTests(BasePlatformTests):
'section': 'user',
'type': 'array',
'value': ['foo', 'bar'],
+ 'choices': ['foo', 'bar', 'oink', 'boink'],
'machine': 'any',
}
tdir = os.path.join(self.unit_test_dir, '19 array option')
@@ -1621,6 +1622,7 @@ class AllPlatformTests(BasePlatformTests):
'section': 'user',
'type': 'array',
'value': ['foo', 'bar'],
+ 'choices': ['foo', 'bar', 'oink', 'boink'],
'machine': 'any',
}
tdir = os.path.join(self.unit_test_dir, '19 array option')
@@ -1647,6 +1649,7 @@ class AllPlatformTests(BasePlatformTests):
'section': 'user',
'type': 'array',
'value': [],
+ 'choices': ['foo', 'bar', 'oink', 'boink'],
'machine': 'any',
}
tdir = os.path.join(self.unit_test_dir, '19 array option')
@@ -1703,7 +1706,7 @@ class AllPlatformTests(BasePlatformTests):
if item['name'] == 'combo':
self.assertEqual(item['value'], 'b')
self.assertEqual(item['choices'], ['b', 'c', 'd'])
- elif item['name'] == 'arr':
+ elif item['name'] == 'array':
self.assertEqual(item['value'], ['b'])
self.assertEqual(item['choices'], ['b', 'c', 'd'])
@@ -1721,7 +1724,7 @@ class AllPlatformTests(BasePlatformTests):
if item['name'] == 'combo':
self.assertEqual(item['value'], 'c')
self.assertEqual(item['choices'], ['b', 'c', 'd'])
- elif item['name'] == 'arr':
+ elif item['name'] == 'array':
self.assertEqual(item['value'], ['b', 'c'])
self.assertEqual(item['choices'], ['b', 'c', 'd'])