aboutsummaryrefslogtreecommitdiff
path: root/test cases/failing
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2022-05-23 16:21:39 +0200
committerDylan Baker <dylan@pnwbakers.com>2022-06-14 10:11:22 -0700
commitdae986073d5ab3a6241cecaf3362065256400772 (patch)
tree3b842cc17520a2c723e16238a3ddeedf2d9250e3 /test cases/failing
parentf3ba24f2892fa4ccf1c6c198190f43d4da44a761 (diff)
downloadmeson-dae986073d5ab3a6241cecaf3362065256400772.zip
meson-dae986073d5ab3a6241cecaf3362065256400772.tar.gz
meson-dae986073d5ab3a6241cecaf3362065256400772.tar.bz2
take override_option('unity=...') into account when allowing extract_objects()
A single target could be picked for unity build, and in that case extract_objects() should not be allowed. Likewise for the opposite case, where extract_objects() should be allowed if unity build is disabled for a single target. A test that covers that case is added later.
Diffstat (limited to 'test cases/failing')
-rw-r--r--test cases/failing/126 extract from unity/meson.build4
-rw-r--r--test cases/failing/126 extract from unity/src1.c3
-rw-r--r--test cases/failing/126 extract from unity/src2.c3
-rw-r--r--test cases/failing/126 extract from unity/test.json7
4 files changed, 17 insertions, 0 deletions
diff --git a/test cases/failing/126 extract from unity/meson.build b/test cases/failing/126 extract from unity/meson.build
new file mode 100644
index 0000000..9e3e65f
--- /dev/null
+++ b/test cases/failing/126 extract from unity/meson.build
@@ -0,0 +1,4 @@
+project('extract nonexisting gen', 'c')
+
+lib1 = library('lib1', 'src1.c', 'src2.c', override_options: ['unity=on'])
+lib2 = library('lib2', objects: lib1.extract_objects('src1.c'))
diff --git a/test cases/failing/126 extract from unity/src1.c b/test cases/failing/126 extract from unity/src1.c
new file mode 100644
index 0000000..da971bb
--- /dev/null
+++ b/test cases/failing/126 extract from unity/src1.c
@@ -0,0 +1,3 @@
+int sub_lib_method1() {
+ return 1337;
+}
diff --git a/test cases/failing/126 extract from unity/src2.c b/test cases/failing/126 extract from unity/src2.c
new file mode 100644
index 0000000..a461669
--- /dev/null
+++ b/test cases/failing/126 extract from unity/src2.c
@@ -0,0 +1,3 @@
+int sub_lib_method2() {
+ return 1337;
+}
diff --git a/test cases/failing/126 extract from unity/test.json b/test cases/failing/126 extract from unity/test.json
new file mode 100644
index 0000000..9f3a8d8
--- /dev/null
+++ b/test cases/failing/126 extract from unity/test.json
@@ -0,0 +1,7 @@
+{
+ "stdout": [
+ {
+ "line": "test cases/failing/126 extract from unity/meson.build:4:0: ERROR: Single object files can not be extracted in Unity builds. You can only extract all the object files for each compiler at once."
+ }
+ ]
+}