IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 3885


Ignore:
Timestamp:
May 11, 2005, 1:46:07 PM (21 years ago)
Author:
desonia
Message:

added --makeonly and --help options.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psLib/test/FullUnitTest

    r3690 r3885  
    55#  the script
    66#
    7 #  SYNOSIS :  FullUnitTest options arguements
    8 #
    9 #       where  options =
    10 #             --verbose     Display extra information to user
    11 #             --noverbose   Don't display extra information to user
    12 #             --recursiv e  Recursively run tests in directory tree
    13 #             --norecursive Test only the specified or current directory
    14 #             --silent      Don't display any information to user
    15 #             --nosilent    Display progress of script to user
    16 #
    17 #              arguements = directory(ies) to perform tests
    18 #
    19 #  RETURN : integer number of tests which failed
    20 #
    21 #  $Revision: 1.22 $  $Name: not supported by cvs2svn $
    22 #  $Date: 2005-04-09 00:04:57 $
     7#  $Revision: 1.23 $  $Name: not supported by cvs2svn $
     8#  $Date: 2005-05-11 23:46:07 $
    239#
    2410#  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    3622use Getopt::Long;
    3723
     24$recursive=1;
    3825# Assign variables based on the presence of command line options to the script
    3926# The ! option allows for --nooption to be set to zero
     
    4330    "recursive!" => \$recursive,
    4431    "silent!"    => \$silent,
    45     "clean!"     => \$clean
     32    "clean!"     => \$clean,
     33    "makeonly!"  => \$makeonly,
     34    "help!"      => \$help
    4635);
     36
     37if ($help) {
     38    printf <<'HELPTEXT';
     39SYNPOSIS :  FullUnitTest [options] [arguments]
     40
     41    where:
     42        options =
     43            --help        Print this help text
     44            --verbose     Display extra information to user
     45            --norecursive Test only the specified or current directory
     46            --silent      Don't display any information to user
     47            --clean       Perform a 'make clean' before making tests
     48            --makeonly    Only make the test drivers, don't execute them
     49
     50        arguments = directory(ies) to perform tests [if not specified, assumes ',']
     51
     52    RETURN : integer number of tests which failed
     53
     54HELPTEXT
     55    exit;
     56}
    4757
    4858# Check if both silent and verbose options are set and if so stop the script
    4959die "Can't specify both verbose and silent options." if ( $verbose && $silent );
    50 
    51 # Set up the PSLIB_ROOT environment variable if the user doesn't have
    52 if ( !$ENV{'PSLIB_ROOT'} ) {
    53 
    54     # Use the directory directly above where FullUnitTest script resides
    55     $PSLIB_ROOT = `cd ..;pwd`;
    56 
    57     # Remove newline for the end of path returned
    58     chomp($PSLIB_ROOT);
    59 
    60     # Set the environment variable
    61     $ENV{'PSLIB_ROOT'} = $PSLIB_ROOT;
    62     print("PSLIB_ROOT not found: set to $PSLIB_ROOT.\n") if $verbose;
    63 }
    6460
    6561# add PSLIB_ROOT/lib to LD_LIBRARY_PATH and DYLD_LIBRARY_PATH environment
     
    8076$args = 0;
    8177
     78# check if no arguments -- if so, we should process current directory
     79if ($args == 0) {
     80    push(@ARGV,$ENV{"PWD"});
     81}
     82
    8283# Loop through all the arguements passed to the script
    8384foreach (@ARGV) {
     
    106107        # Invoke subroutines to run the test at the specified directory
    107108        &makeTestDrivers($_);
    108         &executeTestDrivers($_);
     109        if (! $makeonly) {
     110            &executeTestDrivers($_);
     111        }
    109112    }
    110113
    111114    # Change directory back to the directory where FullUnitTest was invoked
    112115    chdir($cwd);
    113 }
    114 
    115 # Check if there were no arguements specified
    116 if ( $args == 0 ) {
    117 
    118     # Display message to user that all directories under the current will be
    119     # tested
    120     print("Recursively testing current directory tree.\n") if $verbose;
    121 
    122     # Invoke subroutine to go to recursively test each directory in tree
    123     &worm( $ENV{"PWD"} );
    124116}
    125117
     
    174166    &makeTestDrivers($base_dir);
    175167
    176     # Invoke subroutine to execute tests in the base directory
    177     &executeTestDrivers($base_dir);
     168    if (! $makeonly) {
     169        # Invoke subroutine to execute tests in the base directory
     170        &executeTestDrivers($base_dir);
     171    }
    178172
    179173    # Create array of entries found in directory
Note: See TracChangeset for help on using the changeset viewer.