Changeset 3885
- Timestamp:
- May 11, 2005, 1:46:07 PM (21 years ago)
- File:
-
- 1 edited
-
trunk/psLib/test/FullUnitTest (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/test/FullUnitTest
r3690 r3885 5 5 # the script 6 6 # 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 $ 23 9 # 24 10 # Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 36 22 use Getopt::Long; 37 23 24 $recursive=1; 38 25 # Assign variables based on the presence of command line options to the script 39 26 # The ! option allows for --nooption to be set to zero … … 43 30 "recursive!" => \$recursive, 44 31 "silent!" => \$silent, 45 "clean!" => \$clean 32 "clean!" => \$clean, 33 "makeonly!" => \$makeonly, 34 "help!" => \$help 46 35 ); 36 37 if ($help) { 38 printf <<'HELPTEXT'; 39 SYNPOSIS : 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 54 HELPTEXT 55 exit; 56 } 47 57 48 58 # Check if both silent and verbose options are set and if so stop the script 49 59 die "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 have52 if ( !$ENV{'PSLIB_ROOT'} ) {53 54 # Use the directory directly above where FullUnitTest script resides55 $PSLIB_ROOT = `cd ..;pwd`;56 57 # Remove newline for the end of path returned58 chomp($PSLIB_ROOT);59 60 # Set the environment variable61 $ENV{'PSLIB_ROOT'} = $PSLIB_ROOT;62 print("PSLIB_ROOT not found: set to $PSLIB_ROOT.\n") if $verbose;63 }64 60 65 61 # add PSLIB_ROOT/lib to LD_LIBRARY_PATH and DYLD_LIBRARY_PATH environment … … 80 76 $args = 0; 81 77 78 # check if no arguments -- if so, we should process current directory 79 if ($args == 0) { 80 push(@ARGV,$ENV{"PWD"}); 81 } 82 82 83 # Loop through all the arguements passed to the script 83 84 foreach (@ARGV) { … … 106 107 # Invoke subroutines to run the test at the specified directory 107 108 &makeTestDrivers($_); 108 &executeTestDrivers($_); 109 if (! $makeonly) { 110 &executeTestDrivers($_); 111 } 109 112 } 110 113 111 114 # Change directory back to the directory where FullUnitTest was invoked 112 115 chdir($cwd); 113 }114 115 # Check if there were no arguements specified116 if ( $args == 0 ) {117 118 # Display message to user that all directories under the current will be119 # tested120 print("Recursively testing current directory tree.\n") if $verbose;121 122 # Invoke subroutine to go to recursively test each directory in tree123 &worm( $ENV{"PWD"} );124 116 } 125 117 … … 174 166 &makeTestDrivers($base_dir); 175 167 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 } 178 172 179 173 # Create array of entries found in directory
Note:
See TracChangeset
for help on using the changeset viewer.
