From edc7737cb3d8b21f65e8517aa74d04fdbb2a5815 Mon Sep 17 00:00:00 2001 From: Axel Beckert Date: Thu, 25 Sep 2014 19:40:26 +0200 Subject: [PATCH] Make test suite work with perl in $PATH instead of hardcoded /usr/bin/perl --- t/argument-check.t | 2 +- t/getopt.t | 2 +- t/gitignore.t | 2 +- t/hook-daemons.t | 2 +- t/hook-hostname.t | 2 +- t/hook-inittab.t | 2 +- t/hook-tls.t | 2 +- t/hooks.t | 2 +- t/no-tabs.t | 2 +- t/perl-syntax.t | 2 +- t/plugin-checks.t | 2 +- t/pod-check.t | 2 +- t/pod-coverage.t | 2 ++ t/pod.t | 2 +- t/portable-shell.t | 2 +- t/programs.t | 2 +- t/quoted-strings.t | 2 +- t/shell-syntax.t | 2 +- t/test-trailing-whitespace.t | 2 +- t/xen-delete-image.t | 2 +- t/xen-lists-images.t | 2 +- t/xt-create-xen-config.t | 4 ++-- 22 files changed, 24 insertions(+), 22 deletions(-) diff --git a/t/argument-check.t b/t/argument-check.t index 5f81921..d39370b 100755 --- a/t/argument-check.t +++ b/t/argument-check.t @@ -1,4 +1,4 @@ -#!/usr/bin/perl -w +#!perl -w # # Test that the arguments in etc/xen-tools.conf match those used in # xen-create-image. diff --git a/t/getopt.t b/t/getopt.t index 812ae86..280990a 100755 --- a/t/getopt.t +++ b/t/getopt.t @@ -1,4 +1,4 @@ -#!/usr/bin/perl -w +#!perl -w # # Test that every perl script accepts and processes each of the options # documented in its POD. diff --git a/t/gitignore.t b/t/gitignore.t index 0a97999..a130a1b 100755 --- a/t/gitignore.t +++ b/t/gitignore.t @@ -1,4 +1,4 @@ -#!/usr/bin/perl -w +#!perl -w # # Test that .gitignore is coherent # diff --git a/t/hook-daemons.t b/t/hook-daemons.t index 8bd7343..67d7791 100755 --- a/t/hook-daemons.t +++ b/t/hook-daemons.t @@ -1,4 +1,4 @@ -#!/usr/bin/perl -w +#!perl -w # # Test that our policy-rc.d file is created and removed as we expect in our hooks. # diff --git a/t/hook-hostname.t b/t/hook-hostname.t index 4457678..473c337 100755 --- a/t/hook-hostname.t +++ b/t/hook-hostname.t @@ -1,4 +1,4 @@ -#!/usr/bin/perl -w +#!perl -w # # Test that we get an /etc/hosts etc file created when DHCP is used. # diff --git a/t/hook-inittab.t b/t/hook-inittab.t index b39fd11..78dd306 100755 --- a/t/hook-inittab.t +++ b/t/hook-inittab.t @@ -1,4 +1,4 @@ -#!/usr/bin/perl -w +#!perl -w # # Test that the /etc/inittab file is modified as we expect. # diff --git a/t/hook-tls.t b/t/hook-tls.t index d9cb3b8..69e8a9c 100755 --- a/t/hook-tls.t +++ b/t/hook-tls.t @@ -1,4 +1,4 @@ -#!/usr/bin/perl +#!perl # # Test that the tls-disabling hook works. # diff --git a/t/hooks.t b/t/hooks.t index 0634788..80284b7 100755 --- a/t/hooks.t +++ b/t/hooks.t @@ -1,4 +1,4 @@ -#!/usr/bin/perl -w +#!perl -w # # Test that all the hook files we install are executable. # diff --git a/t/no-tabs.t b/t/no-tabs.t index d5efbe4..3df9ad3 100755 --- a/t/no-tabs.t +++ b/t/no-tabs.t @@ -1,4 +1,4 @@ -#!/usr/bin/perl -w +#!perl -w # # Test that every perl + shell script we have contains no tabs. # diff --git a/t/perl-syntax.t b/t/perl-syntax.t index e56a279..bc34fce 100755 --- a/t/perl-syntax.t +++ b/t/perl-syntax.t @@ -1,4 +1,4 @@ -#!/usr/bin/perl -w +#!perl -w # # Test that every perl file we have passes the syntax check. This of # course needs not only build dependencies but also run-time diff --git a/t/plugin-checks.t b/t/plugin-checks.t index 93e2896..c36c57f 100755 --- a/t/plugin-checks.t +++ b/t/plugin-checks.t @@ -1,4 +1,4 @@ -#!/usr/bin/perl -w +#!perl -w # # Test that the plugins each refer to environmental variables, # not the perl config hash. diff --git a/t/pod-check.t b/t/pod-check.t index e55d409..4a088ac 100755 --- a/t/pod-check.t +++ b/t/pod-check.t @@ -1,4 +1,4 @@ -#!/usr/bin/perl -w +#!perl -w # # Test that the POD we include in our scripts is valid, via the external # podchecker command. diff --git a/t/pod-coverage.t b/t/pod-coverage.t index 341ce0d..b7343b6 100755 --- a/t/pod-coverage.t +++ b/t/pod-coverage.t @@ -1,3 +1,5 @@ +#!perl + use strict; use warnings; use Test::More; diff --git a/t/pod.t b/t/pod.t index 3cb8f9c..07de69b 100755 --- a/t/pod.t +++ b/t/pod.t @@ -1,4 +1,4 @@ -#!/usr/bin/perl +#!perl # # Test that the POD we use in our modules is valid. # diff --git a/t/portable-shell.t b/t/portable-shell.t index 5ecf60b..f83e8cf 100755 --- a/t/portable-shell.t +++ b/t/portable-shell.t @@ -1,4 +1,4 @@ -#!/usr/bin/perl -w +#!perl -w # # Test that we don't use non-portable shell syntax in our hooks. # diff --git a/t/programs.t b/t/programs.t index da5d891..88b0be9 100755 --- a/t/programs.t +++ b/t/programs.t @@ -1,4 +1,4 @@ -#!/usr/bin/perl -w -I.. +#!perl -w -I.. # # Test that we have several required programs present. # diff --git a/t/quoted-strings.t b/t/quoted-strings.t index bf356a2..8bc07fd 100755 --- a/t/quoted-strings.t +++ b/t/quoted-strings.t @@ -1,4 +1,4 @@ -#!/usr/bin/perl -w +#!perl -w # # Test that every bash script using variables uses " not ' around the # variable. diff --git a/t/shell-syntax.t b/t/shell-syntax.t index 3e07557..93fc65f 100755 --- a/t/shell-syntax.t +++ b/t/shell-syntax.t @@ -1,4 +1,4 @@ -#!/usr/bin/perl -w +#!perl -w # # Test that every shell script we have passes a syntax check. # diff --git a/t/test-trailing-whitespace.t b/t/test-trailing-whitespace.t index 108107f..0f0b81f 100755 --- a/t/test-trailing-whitespace.t +++ b/t/test-trailing-whitespace.t @@ -1,4 +1,4 @@ -#!/usr/bin/perl -w +#!perl -w # # Test that every script in ./bin/ has no trailing whitespace. # diff --git a/t/xen-delete-image.t b/t/xen-delete-image.t index e234687..c544bd2 100755 --- a/t/xen-delete-image.t +++ b/t/xen-delete-image.t @@ -1,4 +1,4 @@ -#!/usr/bin/perl -w +#!perl -w # # Test that the xen-delete-image script will delete an images # contents correctly. diff --git a/t/xen-lists-images.t b/t/xen-lists-images.t index 69c4f4c..3a20380 100755 --- a/t/xen-lists-images.t +++ b/t/xen-lists-images.t @@ -1,4 +1,4 @@ -#!/usr/bin/perl -w +#!perl -w # # Test that the xen-list-images script can process two "fake" # installations which we construct manually. diff --git a/t/xt-create-xen-config.t b/t/xt-create-xen-config.t index 662e4de..f38b9d6 100755 --- a/t/xt-create-xen-config.t +++ b/t/xt-create-xen-config.t @@ -1,4 +1,4 @@ -#!/usr/bin/perl -w +#!perl -w # # Test that calling xt-create-xen-config with the appropriate parameters # results in output we expect. @@ -159,7 +159,7 @@ sub runCreateCommand # # Run the command # - system( "./bin/xt-create-xen-config --output=$dir --template=./etc/xm.tmpl" ); + system( "perl ./bin/xt-create-xen-config --output=$dir --template=./etc/xm.tmpl" ); # # Reset the environment