diff options
author | Justus Winter <[email protected]> | 2017-03-22 11:40:42 +0000 |
---|---|---|
committer | Justus Winter <[email protected]> | 2017-04-24 12:14:05 +0000 |
commit | ed4d23d75e8ba89e998b88a4f862661c81f665a3 (patch) | |
tree | 7e956da634802ab2d802f5e5d9e208932d606926 /tests/gpgsm | |
parent | gpgscm: Move 'trace' and 'stringify'. (diff) | |
download | gnupg-ed4d23d75e8ba89e998b88a4f862661c81f665a3.tar.gz gnupg-ed4d23d75e8ba89e998b88a4f862661c81f665a3.zip |
tests: Locate resources and scripts relative to top source dir.
--
Locate every resource and every script used in the tests using a path
relative to the top of the source tree.
This is a purely mechanical change, mostly done using regular
expressions, with a few manual fixups here and there.
Signed-off-by: Justus Winter <[email protected]>
Diffstat (limited to 'tests/gpgsm')
-rw-r--r-- | tests/gpgsm/Makefile.am | 4 | ||||
-rw-r--r-- | tests/gpgsm/decrypt.scm | 4 | ||||
-rw-r--r-- | tests/gpgsm/encrypt.scm | 2 | ||||
-rw-r--r-- | tests/gpgsm/export.scm | 2 | ||||
-rw-r--r-- | tests/gpgsm/gpgsm-defs.scm | 6 | ||||
-rw-r--r-- | tests/gpgsm/import.scm | 4 | ||||
-rw-r--r-- | tests/gpgsm/run-tests.scm | 14 | ||||
-rw-r--r-- | tests/gpgsm/setup.scm | 2 | ||||
-rw-r--r-- | tests/gpgsm/shell.scm | 2 | ||||
-rw-r--r-- | tests/gpgsm/sign.scm | 2 | ||||
-rw-r--r-- | tests/gpgsm/verify.scm | 2 |
11 files changed, 25 insertions, 19 deletions
diff --git a/tests/gpgsm/Makefile.am b/tests/gpgsm/Makefile.am index 28db50133..214c3b246 100644 --- a/tests/gpgsm/Makefile.am +++ b/tests/gpgsm/Makefile.am @@ -31,9 +31,9 @@ AM_CFLAGS = TESTS_ENVIRONMENT = LC_ALL=C \ EXEEXT=$(EXEEXT) \ PATH=../gpgscm:$(PATH) \ - srcdir=$(abs_srcdir) \ + abs_top_srcdir=$(abs_top_srcdir) \ objdir=$(abs_top_builddir) \ - GPGSCM_PATH=$(abs_top_srcdir)/tests/gpgscm:$(abs_top_srcdir)/tests/openpgp:$(abs_top_srcdir)/tests/gpgsm + GPGSCM_PATH=$(abs_top_srcdir)/tests/gpgscm XTESTS = \ import.scm \ diff --git a/tests/gpgsm/decrypt.scm b/tests/gpgsm/decrypt.scm index e7f3baa29..c328ba89d 100644 --- a/tests/gpgsm/decrypt.scm +++ b/tests/gpgsm/decrypt.scm @@ -17,14 +17,14 @@ ;; You should have received a copy of the GNU General Public License ;; along with this program; if not, see <http://www.gnu.org/licenses/>. -(load (with-path "gpgsm-defs.scm")) +(load (in-srcdir "tests" "gpgsm" "gpgsm-defs.scm")) (setup-gpgsm-environment) (for-each-p "Checking decryption of supplied files." (lambda (name) (tr:do - (tr:open (in-srcdir (string-append name ".cms.asc"))) + (tr:open (in-srcdir "tests" "gpgsm" (string-append name ".cms.asc"))) (tr:gpgsm "" '(--decrypt)) (tr:assert-identity name))) plain-files) diff --git a/tests/gpgsm/encrypt.scm b/tests/gpgsm/encrypt.scm index fd23ac5c5..bb90c8e73 100644 --- a/tests/gpgsm/encrypt.scm +++ b/tests/gpgsm/encrypt.scm @@ -17,7 +17,7 @@ ;; You should have received a copy of the GNU General Public License ;; along with this program; if not, see <http://www.gnu.org/licenses/>. -(load (with-path "gpgsm-defs.scm")) +(load (in-srcdir "tests" "gpgsm" "gpgsm-defs.scm")) (setup-gpgsm-environment) (for-each-p diff --git a/tests/gpgsm/export.scm b/tests/gpgsm/export.scm index 47fb06e20..d29b6cc48 100644 --- a/tests/gpgsm/export.scm +++ b/tests/gpgsm/export.scm @@ -17,7 +17,7 @@ ;; You should have received a copy of the GNU General Public License ;; along with this program; if not, see <http://www.gnu.org/licenses/>. -(load (with-path "gpgsm-defs.scm")) +(load (in-srcdir "tests" "gpgsm" "gpgsm-defs.scm")) (setup-gpgsm-environment) (for-each-p' diff --git a/tests/gpgsm/gpgsm-defs.scm b/tests/gpgsm/gpgsm-defs.scm index 5f9be7f0f..c978c32b3 100644 --- a/tests/gpgsm/gpgsm-defs.scm +++ b/tests/gpgsm/gpgsm-defs.scm @@ -17,7 +17,7 @@ ;; You should have received a copy of the GNU General Public License ;; along with this program; if not, see <http://www.gnu.org/licenses/>. -(load (with-path "defs.scm")) +(load (in-srcdir "tests" "openpgp" "defs.scm")) ;; This is the list of certificates that we install in the test ;; environment. @@ -83,13 +83,13 @@ (log "Storing private keys") (for-each (lambda (name) - (file-copy (in-srcdir name) + (file-copy (in-srcdir "tests" "gpgsm" name) (path-join "private-keys-v1.d" (string-append name ".key")))) '("32100C27173EF6E9C4E9A25D3D69F86D37A4F939")) (log "Importing public demo and test keys") - (call-check `(,@gpgsm --import ,(in-srcdir "cert_g10code_test1.der"))) + (call-check `(,@gpgsm --import ,(in-srcdir "tests" "gpgsm" "cert_g10code_test1.der"))) (create-sample-files) (stop-agent)) diff --git a/tests/gpgsm/import.scm b/tests/gpgsm/import.scm index 85e5107ad..be555da8a 100644 --- a/tests/gpgsm/import.scm +++ b/tests/gpgsm/import.scm @@ -17,7 +17,7 @@ ;; You should have received a copy of the GNU General Public License ;; along with this program; if not, see <http://www.gnu.org/licenses/>. -(load (with-path "gpgsm-defs.scm")) +(load (in-srcdir "tests" "gpgsm" "gpgsm-defs.scm")) (setup-gpgsm-environment) (define certs-for-import @@ -47,7 +47,7 @@ "Checking certificate import." (lambda (test) (assert (not (sm-have-public-key? (:cert test)))) - (call-check `(,@gpgsm --import ,(in-srcdir (:name test)))) + (call-check `(,@gpgsm --import ,(in-srcdir "tests" "gpgsm" (:name test)))) (assert (sm-have-public-key? (:cert test)))) (lambda (test) (:name test)) certs-for-import) diff --git a/tests/gpgsm/run-tests.scm b/tests/gpgsm/run-tests.scm index e44424513..bf129a1cb 100644 --- a/tests/gpgsm/run-tests.scm +++ b/tests/gpgsm/run-tests.scm @@ -17,16 +17,22 @@ ;; You should have received a copy of the GNU General Public License ;; along with this program; if not, see <http://www.gnu.org/licenses/>. -(if (string=? "" (getenv "srcdir")) +(if (string=? "" (getenv "abs_top_srcdir")) (begin - (echo "Environment variable 'srcdir' not set. Please point it to" + (echo "Environment variable 'abs_top_srcdir' not set. Please point it to" "tests/gpgsm.") (exit 2))) (let* ((tests (filter (lambda (arg) (not (string-prefix? arg "--"))) *args*)) - (setup (make-environment-cache (test::scm #f "setup.scm" "setup.scm"))) + (setup (make-environment-cache (test::scm + #f + (path-join "tests" "gpgsm" "setup.scm") + (in-srcdir "tests" "gpgsm" "setup.scm")))) (runner (if (and (member "--parallel" *args*) (> (length tests) 1)) run-tests-parallel run-tests-sequential))) - (runner (map (lambda (t) (test::scm setup t t)) tests))) + (runner (map (lambda (name) + (test::scm setup + (path-join "tests" "gpgsm" name) + (in-srcdir "tests" "gpgsm" name))) tests))) diff --git a/tests/gpgsm/setup.scm b/tests/gpgsm/setup.scm index aa1ab4132..c241b38fe 100644 --- a/tests/gpgsm/setup.scm +++ b/tests/gpgsm/setup.scm @@ -17,7 +17,7 @@ ;; You should have received a copy of the GNU General Public License ;; along with this program; if not, see <http://www.gnu.org/licenses/>. -(load (with-path "gpgsm-defs.scm")) +(load (in-srcdir "tests" "gpgsm" "gpgsm-defs.scm")) (define tarball (flag "--create-tarball" *args*)) (unless (and tarball (not (null? tarball))) diff --git a/tests/gpgsm/shell.scm b/tests/gpgsm/shell.scm index fe39fec33..606e3880b 100644 --- a/tests/gpgsm/shell.scm +++ b/tests/gpgsm/shell.scm @@ -17,7 +17,7 @@ ;; You should have received a copy of the GNU General Public License ;; along with this program; if not, see <http://www.gnu.org/licenses/>. -(load (with-path "gpgsm-defs.scm")) +(load (in-srcdir "tests" "gpgsm" "gpgsm-defs.scm")) (setup-gpgsm-environment) ;; This is not a test, but can be used to inspect the test diff --git a/tests/gpgsm/sign.scm b/tests/gpgsm/sign.scm index 9b4f7fe90..48b7b0669 100644 --- a/tests/gpgsm/sign.scm +++ b/tests/gpgsm/sign.scm @@ -17,7 +17,7 @@ ;; You should have received a copy of the GNU General Public License ;; along with this program; if not, see <http://www.gnu.org/licenses/>. -(load (with-path "gpgsm-defs.scm")) +(load (in-srcdir "tests" "gpgsm" "gpgsm-defs.scm")) (setup-gpgsm-environment) (for-each-p diff --git a/tests/gpgsm/verify.scm b/tests/gpgsm/verify.scm index 28210a9a3..40dbd4898 100644 --- a/tests/gpgsm/verify.scm +++ b/tests/gpgsm/verify.scm @@ -17,7 +17,7 @@ ;; You should have received a copy of the GNU General Public License ;; along with this program; if not, see <http://www.gnu.org/licenses/>. -(load (with-path "gpgsm-defs.scm")) +(load (in-srcdir "tests" "gpgsm" "gpgsm-defs.scm")) (setup-gpgsm-environment) ;; |