Changeset 28172 for other-projects/nightly-tasks/diffcol/trunk/task.pl
- Timestamp:
- 2013-08-27T21:03:55+12:00 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
other-projects/nightly-tasks/diffcol/trunk/task.pl
r28114 r28172 47 47 } 48 48 49 my $test_os = $isWin ? "windows" : ($isMac ? "darwin" : "linux"); 50 my $model_os = "linux"; # default 49 51 50 52 # TASK_HOME should be the toplevel diffcol folder … … 98 100 my @collections = (); 99 101 102 # run_test can take any number of args 100 103 if(scalar(@ARGV) > 1 && $ARGV[0] ne "run_test") { 104 print STDERR "**** Wrong number of arguments\n"; 101 105 &printusage(); 102 106 exit -1; … … 111 115 case qr/^(setup_greenstone|run_test|summarise|upload|all)$/ { $action=$ARGV[0]; } 112 116 else { 113 print STDERR " Bad subcommand.\n";117 print STDERR "**** Bad subcommand.\n"; 114 118 &printusage; 115 119 exit -1; … … 117 121 } 118 122 119 # run_test action can take a subaction: nosvn|justdiff. 123 # run_test action can take a subaction: nosvn|justdiff. It can also take --modelOS (windows|linux|darwin) 120 124 # nosvn: uses the model-collect as static and copies it over to collect, rebuilding what's currently in model-collect instead of copying 121 125 # it out from the svn model-collect again. … … 125 129 shift @collections; # remove action from array 126 130 127 if($ARGV[1] =~ m@^--@) { 128 shift @collections; # remove subaction from array 131 for (my $i=0; $i < scalar(@ARGV); $i++) { 132 if($ARGV[$i] =~ m@^--@) { 133 shift @collections; # remove subaction/flag from array 129 134 130 $subaction = $ARGV[ 1];135 $subaction = $ARGV[$i]; 131 136 if($subaction eq "--justdiff") { 132 137 $use_local_rebuild = $use_static_model = 1; 133 138 } elsif ($subaction eq "--nosvn") { 134 $use_static_model = 1; 139 $use_static_model = 1; 140 #} elsif ($subaction =~ m/\-\-testOS/i && defined $ARGV[$i+1]) { 141 # $test_os = $ARGV[$i+1]; 142 # $i++; 143 # shift @collections; # remove test_os value from array 144 } elsif ($subaction =~ m/\-\-modelOS/i && defined $ARGV[$i+1] && $ARGV[$i+1] =~ m/windows|linux|darwin/i) { 145 $model_os = $ARGV[$i+1]; 146 $i++; 147 shift @collections; # remove model_os value from array 148 #print STDERR "Model_os specified: $model_os\n"; 135 149 } else { 136 print STDERR "Bad subaction.\n"; 137 &printusage; 138 exit -1; 139 } 150 print STDERR "**** Bad subaction/value: ".$ARGV[$i]."\n"; 151 &printusage; 152 exit -1; 153 } 154 } 140 155 } 141 156 … … 238 253 sub printusage 239 254 { 240 print STDERR "Run as: $0 (help|setup_greenstone|run_test <--justdiff|--nosvn> <col1 col2 ...> |summarise|upload|all)\n"; 255 # print STDERR "Run as: $0 (help|setup_greenstone|run_test <--modelOS windows|darwin|linux> <--justdiff|--nosvn> <col1 col2 ...> |summarise|upload|all)\n"; 256 print STDERR "Run as: $0 (help|setup_greenstone|run_test|summarise|upload|all)\n"; 257 print STDERR "where run_test can further take the following optional parameters:\n"; 258 print STDERR "\t--modelOS (windows|darwin|linux)\n"; 259 print STDERR "\t--justdiff|--nosvn\n"; 260 print STDERR "\t<col1 col2 ...>\n"; 241 261 } 242 262 … … 510 530 if(-d "collect") { 511 531 for my $col (@collections) { 512 &File::Path::remove_tree("collect$col") || die "Error could not delete collect: $!"; 532 if(-d "collect$col") { 533 &File::Path::remove_tree("collect$col") || die "Error could not delete collect: $!"; 534 } 513 535 } 514 536 } … … 604 626 print STDERR "$collection - Diffing:\n"; 605 627 my $diffcol_dir = &filename_concat($ENV{'TASK_HOME'},"diffcol"); 606 $cmd = "diffcol.pl -output xml -verbosity 10 $collection"; # need to run with ./diffcol.pl if bash script 628 629 # help diffcol to know on what os the model cols were generated 630 # and what os this test machine is (on which the test cols will be generated) 631 $cmd = "diffcol.pl -testos $test_os -modelos $model_os -output xml -verbosity 10 $collection"; # need to run with ./diffcol.pl if bash script 607 632 &run_diff_script($cmd, $xml_fh, $diffcol_dir); 608 633
Note:
See TracChangeset
for help on using the changeset viewer.