File: run_test.pl

package info (click to toggle)
ace 6.0.3%2Bdfsg-0.1
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 49,368 kB
  • sloc: cpp: 341,826; perl: 30,850; ansic: 20,952; makefile: 10,144; sh: 4,744; python: 828; exp: 787; yacc: 511; xml: 330; lex: 158; lisp: 116; csh: 48; tcl: 5
file content (65 lines) | stat: -rwxr-xr-x 1,901 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}'
    & eval 'exec perl -S $0 $argv:q'
    if 0;

# $Id: run_test.pl 88351 2009-12-29 10:21:52Z 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";
}