Using tortoiseSVN client side hook script for pre-commit, we are trying to run some unit test cases using Test::Harness’s runtests sub.
In TortoiseSVN’s Setting->Hook Scripts->Configure Hook Scripts (for pre-commit), I provide a batch file name against the “Command Line to Execute:” heading.
This batch file contains, the following line
run.pl unittest.t
run.pl contents
#!/usr/bin/perl -w
use strict;
use warnings;
use Test::Harness;
# Run a single test suite
my @files = @ARGV;
runtests(@files);
So, when I try to commit any code, this script get invoked and failed with the following error message:
Could not execute (D:\Perl589\bin\perl.exe -w D:\t\unittest.t): open3: Can't call method "close" on an undefined value at D:/Perl589/lib/IPC/Open3.pm line 368.
Any idea how can we resolve this issue.
Does your Windows computer know what to do with scripts that ends in
*.pl? That is, if you double click on a.plfile, does it run Perl? This is set in the registry. You set this up under the File Types tab in theFolder Options. In older version of Windows, this could be done via the Tools->Folder Options… menu. I’m not sure where this can be done in Vista and Windows 7.Once you have the relationship between Perl and the
*.plfiles setup, you also have to edit your%PATHEXT%environment variable to include.PLin the list of suffixes that are considered executables.Otherwise, you simply have to put the name of the Perl interpreter in your Batch file’s hook script:
One more possibility is to use the pl2bat script that came with your Perl installation that turns Perl scripts into Batch files.