diff options
author | Jussi Pakkanen <jpakkane@gmail.com> | 2023-11-06 18:30:00 +0200 |
---|---|---|
committer | Jussi Pakkanen <jpakkane@gmail.com> | 2023-11-06 18:49:59 +0200 |
commit | 712101c1a3c366714d07bb8942437252fa6db01c (patch) | |
tree | bfdf1ca6de24ee521f3ec57e80df4dc76021117a | |
parent | 61a760a39cd774cca9593cf531bd783e55ed36ee (diff) | |
download | meson-nosymlinks.zip meson-nosymlinks.tar.gz meson-nosymlinks.tar.bz2 |
Prohibit symlinks in test data dir because they get mangled by setup.py.nosymlinks
-rwxr-xr-x[-rw-r--r--] | run_format_tests.py | 8 | ||||
-rwxr-xr-x | run_project_tests.py | 17 | ||||
-rw-r--r-- | test cases/common/268 install functions and follow symlinks/foo/file1 (renamed from test cases/common/268 install functions and follow_symlinks/foo/file1) | 0 | ||||
-rw-r--r-- | test cases/common/268 install functions and follow symlinks/meson.build (renamed from test cases/common/268 install functions and follow_symlinks/meson.build) | 0 | ||||
-rw-r--r-- | test cases/common/268 install functions and follow symlinks/test.json (renamed from test cases/common/268 install functions and follow_symlinks/test.json) | 0 | ||||
l--------- | test cases/common/268 install functions and follow_symlinks/foo/link1 | 1 | ||||
l--------- | test cases/common/268 install functions and follow_symlinks/foo/link2.h | 1 | ||||
-rw-r--r--[l---------] | test cases/warning/9 meson.options/subprojects/no-warn/meson_options.txt | 2 |
8 files changed, 26 insertions, 3 deletions
diff --git a/run_format_tests.py b/run_format_tests.py index 70fa121..ca3e715 100644..100755 --- a/run_format_tests.py +++ b/run_format_tests.py @@ -75,9 +75,17 @@ def check_format() -> None: continue check_file(root / file) +def check_symlinks(): + for f in Path('test cases').glob('**/*'): + if f.is_symlink(): + if 'boost symlinks' in str(f): + continue + raise SystemExit(f'Test data dir contains symlink: {f}.') + if __name__ == '__main__': script_dir = os.path.split(__file__)[0] if script_dir != '': os.chdir(script_dir) check_format() + check_symlinks() diff --git a/run_project_tests.py b/run_project_tests.py index 7ff1640..7df64fd 100755 --- a/run_project_tests.py +++ b/run_project_tests.py @@ -1561,6 +1561,14 @@ def print_tool_versions() -> None: print('{0:<{2}}: {1}'.format(tool.tool, get_version(tool), max_width)) print() +tmpdir = list(Path('.').glob('**/*install functions and follow symlinks')) +print(tmpdir) +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 + def clear_transitive_files() -> None: a = Path('test cases/common') for d in a.glob('*subproject subdir/subprojects/subsubsub*'): @@ -1568,6 +1576,14 @@ def clear_transitive_files() -> None: mesonlib.windows_proof_rmtree(str(d)) else: mesonlib.windows_proof_rm(str(d)) + symlink_file1.unlink(missing_ok=True) + symlink_file2.unlink(missing_ok=True) + +def setup_symlinks() -> None: + if mesonlib.is_windows(): + return + symlink_file1.symlink_to('file1') + symlink_file2.symlink_to('file1') if __name__ == '__main__': if under_ci and not raw_ci_jobname: @@ -1611,6 +1627,7 @@ if __name__ == '__main__': options.extra_args += ['--native-file', options.native_file] clear_transitive_files() + setup_symlinks() print('Meson build system', meson_version, 'Project Tests') print('Using python', sys.version.split('\n')[0], f'({sys.executable!r})') diff --git a/test cases/common/268 install functions and follow_symlinks/foo/file1 b/test cases/common/268 install functions and follow symlinks/foo/file1 index 9daeafb..9daeafb 100644 --- a/test cases/common/268 install functions and follow_symlinks/foo/file1 +++ b/test cases/common/268 install functions and follow symlinks/foo/file1 diff --git a/test cases/common/268 install functions and follow_symlinks/meson.build b/test cases/common/268 install functions and follow symlinks/meson.build index 327c021..327c021 100644 --- a/test cases/common/268 install functions and follow_symlinks/meson.build +++ b/test cases/common/268 install functions and follow symlinks/meson.build diff --git a/test cases/common/268 install functions and follow_symlinks/test.json b/test cases/common/268 install functions and follow symlinks/test.json index 6a39517..6a39517 100644 --- a/test cases/common/268 install functions and follow_symlinks/test.json +++ b/test cases/common/268 install functions and follow symlinks/test.json diff --git a/test cases/common/268 install functions and follow_symlinks/foo/link1 b/test cases/common/268 install functions and follow_symlinks/foo/link1 deleted file mode 120000 index 08219db..0000000 --- a/test cases/common/268 install functions and follow_symlinks/foo/link1 +++ /dev/null @@ -1 +0,0 @@ -file1
\ No newline at end of file diff --git a/test cases/common/268 install functions and follow_symlinks/foo/link2.h b/test cases/common/268 install functions and follow_symlinks/foo/link2.h deleted file mode 120000 index 08219db..0000000 --- a/test cases/common/268 install functions and follow_symlinks/foo/link2.h +++ /dev/null @@ -1 +0,0 @@ -file1
\ No newline at end of file diff --git a/test cases/warning/9 meson.options/subprojects/no-warn/meson_options.txt b/test cases/warning/9 meson.options/subprojects/no-warn/meson_options.txt index 7b28df2..b84ee83 120000..100644 --- a/test cases/warning/9 meson.options/subprojects/no-warn/meson_options.txt +++ b/test cases/warning/9 meson.options/subprojects/no-warn/meson_options.txt @@ -1 +1 @@ -meson.options
\ No newline at end of file +option('foo', type : 'string') |