Changeset 28172 for other-projects/nightly-tasks/diffcol/trunk
- Timestamp:
- 2013-08-27T21:03:55+12:00 (11 years ago)
- Location:
- other-projects/nightly-tasks/diffcol/trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
other-projects/nightly-tasks/diffcol/trunk/diffcol/diffcol.pl
r28107 r28172 48 48 49 49 #--Global Variables Declaration----------- 50 my ($gv_test_os, $gv_model_os); # still just file globals 51 50 52 $gv_strModelColRoot = &FileUtils::filenameConcatenate($ENV{'GSDLHOME'},"/model-collect"); 51 53 $gv_strTestColRoot = &FileUtils::filenameConcatenate($ENV{'GSDLHOME'},"/collect"); … … 327 329 { 328 330 #my $strGdbError = gdbdiff::test_gdb($strModelGdb, $strTestGdb); 329 $strGdbError = gdbdiff::test_gdb($strModelGdb, $strTestGdb, $strColName);331 $strGdbError = gdbdiff::test_gdb($strModelGdb, $strTestGdb, $strColName,$gv_test_os, $gv_model_os); 330 332 if($strGdbError ne "") 331 333 { … … 656 658 # equalise/normalise the two doc.xml/docmets.xml files for OS differences, if there are any 657 659 # before comparing a windows test with a linux model or vice-versa 658 my $testIsWin = &isDocOrMETSXMLFileWindows($test_contents);659 my $modelIsWin = &isDocOrMETSXMLFileWindows($model_contents);660 my $testIsWin = ($gv_test_os ne "compute") ? ($gv_test_os eq "windows") : &isDocOrMETSXMLFileWindows($test_contents); 661 my $modelIsWin = ($gv_model_os ne "compute") ? ($gv_model_os eq "windows") : &isDocOrMETSXMLFileWindows($model_contents); 660 662 661 663 if($testIsWin != $modelIsWin) { # one of the 2 collections is built on windows, the other on linux, so need to make newlines constant … … 943 945 sub main 944 946 { 945 my ($intVerbosity,$strErrorStop,$strErrorShow,$strMode );947 my ($intVerbosity,$strErrorStop,$strErrorShow,$strMode,$test_os,$model_os); 946 948 my $strProgName = $0; 947 949 my $intArgc = scalar(@ARGV); … … 953 955 'verbosity/\d+/1', \$intVerbosity, 954 956 'mode/[\w\-]+/all', \$strMode, 955 'output/[\w\-]+/text', \$strOutputFormat 957 'output/[\w\-]+/text', \$strOutputFormat, 958 'testos/(windows|linux|darwin|compute)/compute', \$test_os, # param-name,regex,default 959 'modelos/(windows|linux|darwin|compute)/compute', \$model_os # actually defaults to linux in task.pl 956 960 )) { 957 961 PrintUsage($strProgName); … … 963 967 die "\n"; 964 968 } 969 970 $gv_test_os = $test_os; # if not specified, defaults to "compute" 971 $gv_model_os = $model_os; # tends to be linux 965 972 966 973 $gv_blnErrorStop = $strErrorStop; -
other-projects/nightly-tasks/diffcol/trunk/diffcol/gdbdiff.pm
r28086 r28172 46 46 sub test_gdb 47 47 { 48 my ($full_modeldb, $full_testdb, $strColName) = @_;48 my ($full_modeldb, $full_testdb, $strColName, $test_os, $model_os) = @_; 49 49 50 50 # print "Now is testing database\n"; … … 78 78 # in test and model collection to an even base for comparison 79 79 80 my $testIsWin = &isDBWindowsSensitive($dbname, $test_text);81 my $modelIsWin = &isDBWindowsSensitive($dbname, $model_text);80 my $testIsWin = ($test_os ne "compute") ? ($test_os eq "windows") : &isDBWindowsSensitive($dbname, $test_text); 81 my $modelIsWin = ($model_os ne "compute") ? ($model_os eq "windows") : &isDBWindowsSensitive($dbname, $model_text); 82 82 83 83 if($testIsWin == $modelIsWin) { -
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.