summaryrefslogtreecommitdiffstats
path: root/test cases/failing/124 subproject sandbox violation
diff options
context:
space:
mode:
Diffstat (limited to 'test cases/failing/124 subproject sandbox violation')
-rw-r--r--test cases/failing/124 subproject sandbox violation/meson.build34
-rw-r--r--test cases/failing/124 subproject sandbox violation/meson_options.txt1
-rw-r--r--test cases/failing/124 subproject sandbox violation/subprojects/subproj1/file.txt0
-rw-r--r--test cases/failing/124 subproject sandbox violation/subprojects/subproj1/meson.build4
-rw-r--r--test cases/failing/124 subproject sandbox violation/subprojects/subproj1/nested/meson.build5
-rw-r--r--test cases/failing/124 subproject sandbox violation/subprojects/subproj2/file.txt0
-rw-r--r--test cases/failing/124 subproject sandbox violation/subprojects/subproj2/meson.build7
-rw-r--r--test cases/failing/124 subproject sandbox violation/subprojects/subproj2/nested/meson.build0
-rw-r--r--test cases/failing/124 subproject sandbox violation/subprojects/subproj3/file.txt0
-rw-r--r--test cases/failing/124 subproject sandbox violation/subprojects/subproj3/meson.build3
-rw-r--r--test cases/failing/124 subproject sandbox violation/test.json16
11 files changed, 70 insertions, 0 deletions
diff --git a/test cases/failing/124 subproject sandbox violation/meson.build b/test cases/failing/124 subproject sandbox violation/meson.build
new file mode 100644
index 0000000..d41994c
--- /dev/null
+++ b/test cases/failing/124 subproject sandbox violation/meson.build
@@ -0,0 +1,34 @@
+project('subproject-sandbox-violation')
+
+sub1_d = subproject('subproj1').get_variable('d')
+sub1_mustfail = sub1_d.get_variable('dir') / '..' / 'file.txt'
+
+sub2_d = subproject('subproj2').get_variable('d')
+sub2_mustfail = sub2_d.get_variable('dir') / 'file.txt'
+
+main_d = declare_dependency(
+ variables: [
+ 'dir=@0@'.format(meson.current_source_dir()),
+ ]
+)
+main_mustfail = main_d.get_variable('dir') / 'subprojects/subproj3/file.txt'
+
+if get_option('failmode') == 'parent-dir'
+ mustfail = sub1_mustfail
+elif get_option('failmode') == 'not-installed'
+ mustfail = sub2_mustfail
+elif get_option('failmode') == 'root-subdir'
+ mustfail = main_mustfail
+endif
+
+custom_target(
+ 'mustfail',
+ input: mustfail,
+ output: 'file.txt',
+ command: [
+ 'python3', '-c',
+ 'import os; shutil.copy(sys.argv[1], sys.argv[2])',
+ '@INPUT@',
+ '@OUTPUT@'
+ ],
+)
diff --git a/test cases/failing/124 subproject sandbox violation/meson_options.txt b/test cases/failing/124 subproject sandbox violation/meson_options.txt
new file mode 100644
index 0000000..e7b782d
--- /dev/null
+++ b/test cases/failing/124 subproject sandbox violation/meson_options.txt
@@ -0,0 +1 @@
+option('failmode', type: 'combo', choices: ['parent-dir', 'not-installed', 'root-subdir'])
diff --git a/test cases/failing/124 subproject sandbox violation/subprojects/subproj1/file.txt b/test cases/failing/124 subproject sandbox violation/subprojects/subproj1/file.txt
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/test cases/failing/124 subproject sandbox violation/subprojects/subproj1/file.txt
diff --git a/test cases/failing/124 subproject sandbox violation/subprojects/subproj1/meson.build b/test cases/failing/124 subproject sandbox violation/subprojects/subproj1/meson.build
new file mode 100644
index 0000000..bd33bf3
--- /dev/null
+++ b/test cases/failing/124 subproject sandbox violation/subprojects/subproj1/meson.build
@@ -0,0 +1,4 @@
+project('subproj1')
+
+install_data('file.txt')
+subdir('nested')
diff --git a/test cases/failing/124 subproject sandbox violation/subprojects/subproj1/nested/meson.build b/test cases/failing/124 subproject sandbox violation/subprojects/subproj1/nested/meson.build
new file mode 100644
index 0000000..038c139
--- /dev/null
+++ b/test cases/failing/124 subproject sandbox violation/subprojects/subproj1/nested/meson.build
@@ -0,0 +1,5 @@
+d = declare_dependency(
+ variables: [
+ 'dir=@0@'.format(meson.current_source_dir()),
+ ]
+)
diff --git a/test cases/failing/124 subproject sandbox violation/subprojects/subproj2/file.txt b/test cases/failing/124 subproject sandbox violation/subprojects/subproj2/file.txt
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/test cases/failing/124 subproject sandbox violation/subprojects/subproj2/file.txt
diff --git a/test cases/failing/124 subproject sandbox violation/subprojects/subproj2/meson.build b/test cases/failing/124 subproject sandbox violation/subprojects/subproj2/meson.build
new file mode 100644
index 0000000..a6032aa
--- /dev/null
+++ b/test cases/failing/124 subproject sandbox violation/subprojects/subproj2/meson.build
@@ -0,0 +1,7 @@
+project('subproj1')
+
+d = declare_dependency(
+ variables: [
+ 'dir=@0@'.format(meson.current_source_dir()),
+ ]
+)
diff --git a/test cases/failing/124 subproject sandbox violation/subprojects/subproj2/nested/meson.build b/test cases/failing/124 subproject sandbox violation/subprojects/subproj2/nested/meson.build
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/test cases/failing/124 subproject sandbox violation/subprojects/subproj2/nested/meson.build
diff --git a/test cases/failing/124 subproject sandbox violation/subprojects/subproj3/file.txt b/test cases/failing/124 subproject sandbox violation/subprojects/subproj3/file.txt
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/test cases/failing/124 subproject sandbox violation/subprojects/subproj3/file.txt
diff --git a/test cases/failing/124 subproject sandbox violation/subprojects/subproj3/meson.build b/test cases/failing/124 subproject sandbox violation/subprojects/subproj3/meson.build
new file mode 100644
index 0000000..c4fa64c
--- /dev/null
+++ b/test cases/failing/124 subproject sandbox violation/subprojects/subproj3/meson.build
@@ -0,0 +1,3 @@
+project('subproj2')
+
+install_data('file.txt')
diff --git a/test cases/failing/124 subproject sandbox violation/test.json b/test cases/failing/124 subproject sandbox violation/test.json
new file mode 100644
index 0000000..ca3d142
--- /dev/null
+++ b/test cases/failing/124 subproject sandbox violation/test.json
@@ -0,0 +1,16 @@
+{
+ "matrix": {
+ "options": {
+ "failmode": [
+ { "val": "not-installed" },
+ { "val": "parent-dir" },
+ { "val": "root-subdir" }
+ ]
+ }
+ },
+ "stdout": [
+ {
+ "line": "test cases/failing/124 subproject sandbox violation/meson.build:24:0: ERROR: Sandbox violation: Tried to grab file file.txt from a nested subproject."
+ }
+ ]
+}