From f8a419b27d3605c4b4d1af42debb10124a51b908 Mon Sep 17 00:00:00 2001 From: Jussi Pakkanen Date: Mon, 27 Nov 2017 22:16:32 +0200 Subject: String arguments can permit arbitrary string values by leaving out the choices keyword. --- run_unittests.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'run_unittests.py') diff --git a/run_unittests.py b/run_unittests.py index 9bf712c..9434107 100755 --- a/run_unittests.py +++ b/run_unittests.py @@ -1611,6 +1611,25 @@ int main(int argc, char **argv) { changed = get_opt() self.assertDictEqual(changed, expected) + def opt_has(self, name, value): + res = self.introspect('--buildoptions') + found = False + for i in res: + if i['name'] == name: + self.assertEqual(i['value'], value) + found = True + break + self.assertTrue(found, "Array option not found in introspect data.") + + def test_free_stringarray_setting(self): + testdir = os.path.join(self.common_test_dir, '47 options') + self.init(testdir) + self.opt_has('free_array_opt', []) + self.setconf('-Dfree_array_opt=foo,bar', will_build=False) + self.opt_has('free_array_opt', ['foo', 'bar']) + self.setconf("-Dfree_array_opt=['a,b', 'c,d']", will_build=False) + self.opt_has('free_array_opt', ['a,b', 'c,d']) + class FailureTests(BasePlatformTests): ''' -- cgit v1.1