prevent startup scripts in cmd/powershell
[p5sagit/local-lib.git] / t / shell.t
index 5c8e12a..5e05699 100644 (file)
--- a/t/shell.t
+++ b/t/shell.t
@@ -38,16 +38,17 @@ for my $shell (
   },
   {
     name => 'csh',
+    opt => '-f',
   },
   {
     name => 'cmd',
-    opt => '/c',
+    opt => '/D /C',
     ext => 'bat',
     perl => qq{@"$^X"},
   },
   {
     name => 'powershell',
-    opt => '-ExecutionPolicy Unrestricted',
+    opt => '-NoProfile -ExecutionPolicy Unrestricted',
     ext => 'ps1',
     perl => qq{& '$^X'},
   },
@@ -93,9 +94,10 @@ sub call_ll {
 
   local $ENV{SHELL} = $info->{shell};
 
-  my $file = File::Temp->new('ll-test-script-XXXXX',
-    TMPDIR => 1,
-    SUFFIX => '.'.$info->{ext},
+  my $file = File::Temp->new(
+    TEMPLATE => 'll-test-script-XXXXX',
+    TMPDIR   => 1,
+    SUFFIX   => '.'.$info->{ext},
   );
 
   $file->print(scalar `"$^X" $extra_lib -Mlocal::lib$option` . "\n");