Skip to content
Snippets Groups Projects
runtests.pl 28.1 KiB
Newer Older
  • Learn to ignore specific revisions
  • #######################################################################
    # Output curl version and host info being tested
    #
    
    
    if(!$listonly) {
        displaydata();
    }
    
    
    #######################################################################
    
    # clear and create logging directory:
    
    cleardir($LOGDIR);
    mkdir($LOGDIR, 0777);
    
    
    #######################################################################
    
    # If 'all' tests are requested, find out all test numbers
    
    #
    
    if ( $TESTCASES eq "all") {
    
        # Get all commands and find out their test numbers
        opendir(DIR, $TESTDIR) || die "can't opendir $TESTDIR: $!";
    
        my @cmds = grep { /^test([0-9]+)$/ && -f "$TESTDIR/$_" } readdir(DIR);
    
        $TESTCASES=""; # start with no test cases
    
        # cut off everything but the digits 
    
        }
        # the the numbers from low to high
        for(sort { $a <=> $b } @cmds) {
    
    #######################################################################
    # Start the command line log
    #
    open(CMDLOG, ">$CURLLOG") ||
        print "can't log command lines to $CURLLOG\n";
    
    
    #######################################################################
    # The main test-loop
    #
    
    
    Daniel Stenberg's avatar
    Daniel Stenberg committed
    my $testnum;
    
    foreach $testnum (split(" ", $TESTCASES)) {
    
    
        my $error = singletest($testnum);
        if(-1 == $error) {
            # not a test we can run
    
            $failed.= "$testnum ";
    
            if(!$anyway) {
                # a test failed, abort
                print "\n - abort tests\n";
                last;
            }
    
    #######################################################################
    # Close command log
    #
    close(CMDLOG);
    
    
    #######################################################################
    
    # Tests done, stop the servers
    
    for(keys %run) {
        stopserver($run{$_}); # the pid file is in the hash table
    }
    
        printf("TESTDONE: $ok tests out of $total reported OK: %d%%\n",
    
            print "TESTFAIL: These test cases failed: $failed\n";
    
        print "TESTFAIL: No tests were performed!\n";
    
    if($skipped) {
    
        print "TESTINFO: $skipped tests were skipped due to restraints\n";
    
    if($total && ($ok != $total)) {
        exit 1;
    }