From: Philipp Stephani Date: Fri, 7 May 2021 16:36:57 +0000 (+0200) Subject: Don't use symbolic links in the test resource directory. X-Git-Tag: emacs-28.0.90~2558 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=a2842a11728336fc8110eedb5176ecfbe71bbc79;p=emacs.git Don't use symbolic links in the test resource directory. This doesn't work on Windows. Instead, use the EMACS_TEST_DIRECTORY environment variable to find the BPF files. * test/src/emacs-tests.el (emacs-tests--lib-src): New constant. (emacs-tests/seccomp/allows-stdout) (emacs-tests/seccomp/forbids-subprocess) (emacs-tests/bwrap/allows-stdout): Use it. --- diff --git a/test/src/emacs-resources/seccomp-filter-exec.bpf b/test/src/emacs-resources/seccomp-filter-exec.bpf deleted file mode 120000 index 5b0e9978221..00000000000 --- a/test/src/emacs-resources/seccomp-filter-exec.bpf +++ /dev/null @@ -1 +0,0 @@ -../../../lib-src/seccomp-filter-exec.bpf \ No newline at end of file diff --git a/test/src/emacs-resources/seccomp-filter.bpf b/test/src/emacs-resources/seccomp-filter.bpf deleted file mode 120000 index b3d603d0aeb..00000000000 --- a/test/src/emacs-resources/seccomp-filter.bpf +++ /dev/null @@ -1 +0,0 @@ -../../../lib-src/seccomp-filter.bpf \ No newline at end of file diff --git a/test/src/emacs-tests.el b/test/src/emacs-tests.el index ee5586fbaf4..ac08e055b55 100644 --- a/test/src/emacs-tests.el +++ b/test/src/emacs-tests.el @@ -25,10 +25,13 @@ (require 'cl-lib) (require 'ert) -(require 'ert-x) (require 'rx) (require 'subr-x) +(defconst emacs-tests--lib-src + (substitute-in-file-name "$EMACS_TEST_DIRECTORY/../lib-src/") + "Location of the lib-src directory.") + (ert-deftest emacs-tests/seccomp/absent-file () (skip-unless (string-match-p (rx bow "SECCOMP" eow) system-configuration-features)) @@ -135,7 +138,8 @@ to `make-temp-file', which see." system-configuration-features)) (let ((emacs (expand-file-name invocation-name invocation-directory)) - (filter (ert-resource-file "seccomp-filter.bpf")) + (filter (expand-file-name "seccomp-filter.bpf" + emacs-tests--lib-src)) (process-environment nil)) (skip-unless (file-executable-p emacs)) (skip-unless (file-readable-p filter)) @@ -160,7 +164,8 @@ to `make-temp-file', which see." system-configuration-features)) (let ((emacs (expand-file-name invocation-name invocation-directory)) - (filter (ert-resource-file "seccomp-filter.bpf")) + (filter (expand-file-name "seccomp-filter.bpf" + emacs-tests--lib-src)) (process-environment nil)) (skip-unless (file-executable-p emacs)) (skip-unless (file-readable-p filter)) @@ -186,7 +191,8 @@ to `make-temp-file', which see." (bwrap (executable-find "bwrap")) (emacs (expand-file-name invocation-name invocation-directory)) - (filter (ert-resource-file "seccomp-filter-exec.bpf")) + (filter (expand-file-name "seccomp-filter-exec.bpf" + emacs-tests--lib-src)) (process-environment nil)) (skip-unless bash) (skip-unless bwrap)