summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJussi Pakkanen <jpakkane@gmail.com>2024-10-11 17:15:43 +0300
committerJussi Pakkanen <jpakkane@gmail.com>2024-10-11 22:44:30 +0300
commitadeb844b40ea338fefdbae0270f8152a2afe9c44 (patch)
treed05bf69f7ef0f3489bc17d51eccb67b75261d707
parent4d1623078fa4c217c8c4e779839121988e0b7be4 (diff)
downloadmeson-adeb844b40ea338fefdbae0270f8152a2afe9c44.tar.gz
Recreate Boost symlink at runtime to survive sdist. Closes: #13763.
-rwxr-xr-xrun_format_tests.py5
-rwxr-xr-xrun_project_tests.py24
l---------test cases/frameworks/35 boost symlinks/boost/include/boost1
-rw-r--r--test cases/frameworks/35 boost symlinks/meson.build6
-rw-r--r--test cases/frameworks/35 boost symlinks/test.json3
5 files changed, 31 insertions, 8 deletions
diff --git a/run_format_tests.py b/run_format_tests.py
index 719b76b5a..30c975882 100755
--- a/run_format_tests.py
+++ b/run_format_tests.py
@@ -65,9 +65,12 @@ def check_format() -> None:
check_file(root / file)
def check_symlinks():
+ # Test data must NOT contain symlinks. setup.py
+ # butchers them. If you need symlinks, they need
+ # to be created on the fly.
for f in Path('test cases').glob('**/*'):
if f.is_symlink():
- if 'boost symlinks' in str(f):
+ if 'boost symlinks/boost/lib' in str(f):
continue
raise SystemExit(f'Test data dir contains symlink: {f}.')
diff --git a/run_project_tests.py b/run_project_tests.py
index 831b947cc..a8d9a5b37 100755
--- a/run_project_tests.py
+++ b/run_project_tests.py
@@ -1563,12 +1563,17 @@ def detect_tools(report: bool = True) -> None:
print('{0:<{2}}: {1}'.format(tool.tool, get_version(tool), max_width))
print()
-tmpdir = list(Path('.').glob('test cases/**/*install functions and follow symlinks'))
-assert len(tmpdir) == 1
-symlink_test_dir = tmpdir[0]
-symlink_file1 = symlink_test_dir / 'foo/link1'
-symlink_file2 = symlink_test_dir / 'foo/link2.h'
-del tmpdir
+tmpdir1 = list(Path('.').glob('test cases/**/*install functions and follow symlinks'))
+tmpdir2 = list(Path('.').glob('test cases/frameworks/*boost symlinks'))
+assert len(tmpdir1) == 1
+assert len(tmpdir2) == 1
+symlink_test_dir1 = tmpdir1[0]
+symlink_test_dir2 = tmpdir2[0] / 'boost/include'
+symlink_file1 = symlink_test_dir1 / 'foo/link1'
+symlink_file2 = symlink_test_dir1 / 'foo/link2.h'
+symlink_file3 = symlink_test_dir2 / 'boost'
+del tmpdir1
+del tmpdir2
def clear_transitive_files() -> None:
a = Path('test cases/common')
@@ -1585,11 +1590,18 @@ def clear_transitive_files() -> None:
symlink_file2.unlink()
except FileNotFoundError:
pass
+ try:
+ symlink_file3.unlink()
+ symlink_test_dir2.rmdir()
+ except FileNotFoundError:
+ pass
def setup_symlinks() -> None:
try:
symlink_file1.symlink_to('file1')
symlink_file2.symlink_to('file1')
+ symlink_test_dir2.mkdir(parents=True, exist_ok=True)
+ symlink_file3.symlink_to('../Cellar/boost/0.3.0/include/boost')
except OSError:
print('symlinks are not supported on this system')
diff --git a/test cases/frameworks/35 boost symlinks/boost/include/boost b/test cases/frameworks/35 boost symlinks/boost/include/boost
deleted file mode 120000
index 8acd7e291..000000000
--- a/test cases/frameworks/35 boost symlinks/boost/include/boost
+++ /dev/null
@@ -1 +0,0 @@
-../Cellar/boost/0.3.0/include/boost \ No newline at end of file
diff --git a/test cases/frameworks/35 boost symlinks/meson.build b/test cases/frameworks/35 boost symlinks/meson.build
index b49a143ef..b3767f1bd 100644
--- a/test cases/frameworks/35 boost symlinks/meson.build
+++ b/test cases/frameworks/35 boost symlinks/meson.build
@@ -1,5 +1,11 @@
project('boosttestsymlinks', 'cpp')
+bm = build_machine.system()
+
+if bm == 'windows' or bm == 'cygwin'
+ error('MESON_SKIP_TEST: Windows and symlinks do not mix.')
+endif
+
dep = dependency('boost', modules : ['regex', 'python'], required: false)
assert(dep.found(), 'expected to find a fake version of boost')
diff --git a/test cases/frameworks/35 boost symlinks/test.json b/test cases/frameworks/35 boost symlinks/test.json
new file mode 100644
index 000000000..23af7d931
--- /dev/null
+++ b/test cases/frameworks/35 boost symlinks/test.json
@@ -0,0 +1,3 @@
+{
+ "expect_skip_on_jobname": ["azure", "cygwin", "msys2"]
+}