run_test.pl

来自「最新的版本ACE-5.6.8,刚从外文网上搬下,与大家分享.」· PL 代码 · 共 71 行

PL
71
字号
eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}'
    & eval 'exec perl -S $0 $argv:q'
    if 0;

# $Id: run_test.pl 83697 2008-11-12 18:40:55Z johnnyw $
# -*- perl -*-

use lib "$ENV{ACE_ROOT}/bin";
use PerlACE::TestTarget;

#
# These tests only run on Win32
#
if ($^O ne "MSWin32")
{
    exit;
}


@tests =
    (
     "Abandoned",
     "APC",
#    "Console_Input",            # This test is interactive
     "Directory_Changes",
     "Exceptions",
     "Handle_Close",
     "Multithreading",
#    "Network_Events",           # This test is interactive
     "Prerun_State_Changes",
     "Registration",
     "Registry_Changes",
     "Removals",
     "Suspended_Removals",
#    "Talker",                   # This test is interactive
     "Timeouts",
     "Window_Messages",
     );

my $target = PerlACE::TestTarget::create_target (1) || die "Create target 1 failed\n";;
$test_timeout = 60 + $target->ProcessStartWaitInterval();

for $test (@tests)
{
    print STDOUT "\n________________________________________\n";
    print STDOUT "\nStarting test \"$test\"";
    print STDOUT "\n________________________________________\n\n";

    my $test_process = $target->CreateProcess($test);

    if (! -e $test_process->Executable ()) {
        print STDERR "Error: " . $test_process->Executable () .
                     " does not exist or is not runnable\n";
    }
    else
    {
       $test_process->Spawn ();
       $test_result = $test_process->WaitKill ($test_timeout);

       if ($test_result != 0)
       {
           print STDERR "\n________________________________________\n";
           print STDERR "\nERROR: \"$test\" returned $test_result";
           print STDERR "\n________________________________________\n";
       }
    }
    print STDOUT "\n________________________________________\n";
    print STDOUT "\n\"$test\" completed";
    print STDOUT "\n________________________________________\n";
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?