aboutsummaryrefslogtreecommitdiff
path: root/test cases/common/131 override options
diff options
context:
space:
mode:
Diffstat (limited to 'test cases/common/131 override options')
-rw-r--r--test cases/common/131 override options/four.c9
-rw-r--r--test cases/common/131 override options/meson.build6
-rw-r--r--test cases/common/131 override options/one.c3
-rw-r--r--test cases/common/131 override options/three.c7
-rw-r--r--test cases/common/131 override options/two.c6
5 files changed, 31 insertions, 0 deletions
diff --git a/test cases/common/131 override options/four.c b/test cases/common/131 override options/four.c
new file mode 100644
index 0000000..44e344f
--- /dev/null
+++ b/test cases/common/131 override options/four.c
@@ -0,0 +1,9 @@
+int func(void);
+
+static int duplicate_func(void) {
+ return -4;
+}
+
+int main(void) {
+ return duplicate_func() + func();
+}
diff --git a/test cases/common/131 override options/meson.build b/test cases/common/131 override options/meson.build
new file mode 100644
index 0000000..4dd8d79
--- /dev/null
+++ b/test cases/common/131 override options/meson.build
@@ -0,0 +1,6 @@
+project('option override', 'c',
+ default_options : 'unity=on')
+
+executable('mustunity', 'one.c', 'two.c')
+executable('notunity', 'three.c', 'four.c',
+ override_options : ['unity=off'])
diff --git a/test cases/common/131 override options/one.c b/test cases/common/131 override options/one.c
new file mode 100644
index 0000000..6120d48
--- /dev/null
+++ b/test cases/common/131 override options/one.c
@@ -0,0 +1,3 @@
+static int hidden_func(void) {
+ return 0;
+}
diff --git a/test cases/common/131 override options/three.c b/test cases/common/131 override options/three.c
new file mode 100644
index 0000000..094260e
--- /dev/null
+++ b/test cases/common/131 override options/three.c
@@ -0,0 +1,7 @@
+static int duplicate_func(void) {
+ return 4;
+}
+
+int func(void) {
+ return duplicate_func();
+}
diff --git a/test cases/common/131 override options/two.c b/test cases/common/131 override options/two.c
new file mode 100644
index 0000000..0f8048c
--- /dev/null
+++ b/test cases/common/131 override options/two.c
@@ -0,0 +1,6 @@
+/*
+ * Requires a Unity build. Otherwise hidden_func is not specified.
+ */
+int main(void) {
+ return hidden_func();
+}