summaryrefslogtreecommitdiff
path: root/test cases
diff options
context:
space:
mode:
authorFlorian "sp1rit"​ <sp1rit@disroot.org>2025-07-31 10:10:44 +0200
committerJussi Pakkanen <jussi.pakkanen@mailbox.org>2025-08-10 22:38:30 +0300
commit651aede977179c5fe382744e3dd91ca8e01d050c (patch)
tree5ca295a29b89a2baa1a76f1a2af6d74cb5167737 /test cases
parentf49bdd473ca063c9e928c2e96bdb30582d2129bf (diff)
downloadmeson-651aede977179c5fe382744e3dd91ca8e01d050c.tar.gz
build: Throw an error instead of warning for sourceless targets
We might run into an assertion failure down the road, if we don't fail here. Specifically project('proj') executable('bin', 'header.h') will throw during the ninja generation.
Diffstat (limited to 'test cases')
-rw-r--r--test cases/common/44 pkgconfig-gen/meson.build2
-rw-r--r--test cases/common/44 pkgconfig-gen/simple7.c0
-rw-r--r--test cases/failing/136 target with no sources/meson.build (renamed from test cases/warning/8 target with no sources/meson.build)0
-rw-r--r--test cases/failing/136 target with no sources/test.json7
-rw-r--r--test cases/warning/8 target with no sources/test.json7
5 files changed, 8 insertions, 8 deletions
diff --git a/test cases/common/44 pkgconfig-gen/meson.build b/test cases/common/44 pkgconfig-gen/meson.build
index fd6371ef4..624126cb1 100644
--- a/test cases/common/44 pkgconfig-gen/meson.build
+++ b/test cases/common/44 pkgconfig-gen/meson.build
@@ -189,7 +189,7 @@ endtestcase
# Make sure the -uninstalled.pc file contains both include directories.
# See dependencies/test2.c that gets built against both simple7.pc and
# simple7-uninstalled.pc.
-simple7 = library('simple7', include_directories: 'inc1')
+simple7 = library('simple7', 'simple7.c', include_directories: 'inc1')
dep = declare_dependency(include_directories: 'inc2')
install_headers('inc1/inc1.h', 'inc2/inc2.h')
pkgg.generate(simple7, libraries: dep)
diff --git a/test cases/common/44 pkgconfig-gen/simple7.c b/test cases/common/44 pkgconfig-gen/simple7.c
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/test cases/common/44 pkgconfig-gen/simple7.c
diff --git a/test cases/warning/8 target with no sources/meson.build b/test cases/failing/136 target with no sources/meson.build
index 2a8ee110b..2a8ee110b 100644
--- a/test cases/warning/8 target with no sources/meson.build
+++ b/test cases/failing/136 target with no sources/meson.build
diff --git a/test cases/failing/136 target with no sources/test.json b/test cases/failing/136 target with no sources/test.json
new file mode 100644
index 000000000..9cef75524
--- /dev/null
+++ b/test cases/failing/136 target with no sources/test.json
@@ -0,0 +1,7 @@
+{
+ "stdout": [
+ {
+ "line": "test cases/failing/136 target with no sources/meson.build:3:0: ERROR: Build target no sources has no sources."
+ }
+ ]
+}
diff --git a/test cases/warning/8 target with no sources/test.json b/test cases/warning/8 target with no sources/test.json
deleted file mode 100644
index 30e5b05f1..000000000
--- a/test cases/warning/8 target with no sources/test.json
+++ /dev/null
@@ -1,7 +0,0 @@
-{
- "stdout": [
- {
- "line": "WARNING: Build target no sources has no sources. This was never supposed to be allowed but did because of a bug, support will be removed in a future release of Meson"
- }
- ]
-}