in reply to make test hangs
Ignore "make test" for right now. Tests will run with
perl or prove, so let's use them. I tried not to make it too complex but simple, the way you wrote it. Here's my version that I ran:
You'll notice that I used environmental variables. It sure makes things easier. I also used binmode. If I'm going to open a file, then I usually binmode it. Don't forget to close the file or filehandle.#!/usr/bin/perl BEGIN { $ENV{'HARNESS_ACTIVE'} = 1; $ENV{'HARNESS_VERBOSE'} = 1; } use strict; use warnings; use Test::More tests => 1; my $log_file = './test_log'; my ( $sec, $min, $hour, $mday, $mon, $year, $wday, $yday, $isdst ) = localtime(time); my $timestamp = sprintf( "%4d-%02d-%02d %02d:%02d:%02d", $year + 1900, $mon + 1, $mday, $hour, $min, $sec ); open( OUT, '>', $log_file ) or die "Could not open OUT! $!\n"; binmode OUT, ":encoding(UTF-8)"; print OUT "### START################################################## +##\n"; print OUT "\t $timestamp \n"; ok 1, "running the test $0..."; print OUT "ok 1 - running the test $0"; close(OUT);
Here's the result, using perl:
Here's the result, using prove###START#################################################### 2015-02-13 11:44:06 ok 1 - running the test /root/Desktop/test_hangs.t.tdy
One last thing: Most of the tests that fail can be unhung by using your keyboard. You can use Esc, or Pause/Break. Give it try. It'll take some experimentation and some time. Be patient:). I usually use Num/Lock--Pause/Break--back arrow.###START#################################################### 2015-02-13 11:22:31 ok 1 - running the test /root/Desktop/test_hangs.t
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: make test hangs
by WolliK (Acolyte) on Feb 14, 2015 at 21:19 UTC | |
by hotpelmen (Scribe) on Feb 16, 2015 at 03:13 UTC | |
by WolliK (Acolyte) on Feb 16, 2015 at 17:00 UTC | |
by WolliK (Acolyte) on Feb 14, 2015 at 21:25 UTC | |
by Khen1950fx (Canon) on Feb 16, 2015 at 01:54 UTC |
In Section
Seekers of Perl Wisdom