aboutsummaryrefslogtreecommitdiffstats
path: root/meson/test cases/unit/3 subproject defaults/subprojects/foob
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/unit/3 subproject defaults/subprojects/foob
parente02cda008591317b1625707ff8e115a4841aa889 (diff)
Add submodule dependency filesHEADmaster
Change-Id: Iaf8d18082d3991dec7c0ebbea540f092188eb4ec
Diffstat (limited to 'meson/test cases/unit/3 subproject defaults/subprojects/foob')
-rw-r--r--meson/test cases/unit/3 subproject defaults/subprojects/foob/meson.build12
-rw-r--r--meson/test cases/unit/3 subproject defaults/subprojects/foob/meson_options.txt5
2 files changed, 17 insertions, 0 deletions
diff --git a/meson/test cases/unit/3 subproject defaults/subprojects/foob/meson.build b/meson/test cases/unit/3 subproject defaults/subprojects/foob/meson.build
new file mode 100644
index 000000000..69f01d1ba
--- /dev/null
+++ b/meson/test cases/unit/3 subproject defaults/subprojects/foob/meson.build
@@ -0,0 +1,12 @@
+project('foob', 'c',
+ default_options : ['defopoverride=s_defopt', # This should be overridden.
+ 'fromspfunc=s_defopt', # This is specified with a default_options kwarg to subproject()
+ 'fromcmdline=s_defopt'] # This should get the value set in command line.
+ )
+
+assert(get_option('fromcmdline') == 's_cmdline', 'Default option defined in cmd line is incorrect: ' + get_option('fromcmdline'))
+assert(get_option('fromspfunc') == 'spfunc', 'Default option set with subproject() incorrect: ' + get_option('fromspfunc'))
+assert(get_option('fromspfunconly') == 'spfunc', 'Default option set with subproject() incorrect: ' + get_option('fromspfunc'))
+assert(get_option('defopoverride') == 's_defopt', 'Default option without cmd line override is incorrect: ' + get_option('defopoverride'))
+assert(get_option('fromoptfile') == 's_optfile', 'Default value from option file is incorrect: ' + get_option('fromoptfile'))
+
diff --git a/meson/test cases/unit/3 subproject defaults/subprojects/foob/meson_options.txt b/meson/test cases/unit/3 subproject defaults/subprojects/foob/meson_options.txt
new file mode 100644
index 000000000..a9a615e5e
--- /dev/null
+++ b/meson/test cases/unit/3 subproject defaults/subprojects/foob/meson_options.txt
@@ -0,0 +1,5 @@
+option('defopoverride', type : 'string', value : 's_optfile', description : 'A value for overriding.')
+option('fromcmdline', type : 'string', value : 's_optfile', description : 'A value for overriding.')
+option('fromspfunc', type : 'string', value : 's_optfile', description : 'A value for overriding.')
+option('fromspfunconly', type : 'string', value : 's_optfile', description : 'A value for overriding.')
+option('fromoptfile', type : 'string', value : 's_optfile', description : 'A value for not overriding.')