[Bps-public-commit] r15654 - in Prophet/trunk: . lib/Prophet/CLI
sartak at bestpractical.com
sartak at bestpractical.com
Fri Aug 29 18:43:21 EDT 2008
Author: sartak
Date: Fri Aug 29 18:43:21 2008
New Revision: 15654
Modified:
Prophet/trunk/ (props changed)
Prophet/trunk/lib/Prophet/CLI/Command.pm
Prophet/trunk/lib/Prophet/Test.pm
Log:
r70712 at onn: sartak | 2008-08-29 18:43:13 -0400
If a test subscript tries to invoke an editor, then throw an error instead of silently hanging forever
Modified: Prophet/trunk/lib/Prophet/CLI/Command.pm
==============================================================================
--- Prophet/trunk/lib/Prophet/CLI/Command.pm (original)
+++ Prophet/trunk/lib/Prophet/CLI/Command.pm Fri Aug 29 18:43:21 2008
@@ -62,6 +62,10 @@
my $self = shift;
my $text = shift;
+ # don't invoke the editor in a script, the test will appear to hang
+ die "Tried to invoke an editor in a test script!";
+ if $ENV{IN_PROPHET_TEST_COMMAND};
+
require Proc::InvokeEditor;
return scalar Proc::InvokeEditor->edit($text);
}
Modified: Prophet/trunk/lib/Prophet/Test.pm
==============================================================================
--- Prophet/trunk/lib/Prophet/Test.pm (original)
+++ Prophet/trunk/lib/Prophet/Test.pm Fri Aug 29 18:43:21 2008
@@ -92,6 +92,8 @@
my ( $stdout, $stderr );
my @cmd = _get_perl_cmd($script);
+ local $ENV{IN_PROPHET_TEST_COMMAND} = 1;
+
# diag(join(' ', @cmd, @$args));
my $ret = run3 [ @cmd, @$args ], undef, \$stdout, \$stderr;
Carp::croak $stderr if $?;
More information about the Bps-public-commit
mailing list