| 1 | |
|---|
| 2 | |
|---|
| 3 | |
|---|
| 4 | |
|---|
| 5 | |
|---|
| 6 | $nmod_calc = 55; |
|---|
| 7 | |
|---|
| 8 | |
|---|
| 9 | |
|---|
| 10 | |
|---|
| 11 | |
|---|
| 12 | |
|---|
| 13 | |
|---|
| 14 | |
|---|
| 15 | |
|---|
| 16 | |
|---|
| 17 | |
|---|
| 18 | use File::Copy; |
|---|
| 19 | |
|---|
| 20 | $TRUE = 1; |
|---|
| 21 | $FALSE = 0; |
|---|
| 22 | |
|---|
| 23 | |
|---|
| 24 | $lgForceCompute = $TRUE; |
|---|
| 25 | |
|---|
| 26 | $lgForceCompute = $FALSE; |
|---|
| 27 | |
|---|
| 28 | |
|---|
| 29 | $lgSTDERR2FILE = $TRUE; |
|---|
| 30 | |
|---|
| 31 | |
|---|
| 32 | $lgWinNT = $FALSE; |
|---|
| 33 | |
|---|
| 34 | |
|---|
| 35 | $lgLOGGING = $TRUE; |
|---|
| 36 | |
|---|
| 37 | |
|---|
| 38 | |
|---|
| 39 | $lgDO_NO_WORK = $FALSE; |
|---|
| 40 | |
|---|
| 41 | |
|---|
| 42 | system "uname -a >machine.txt"; |
|---|
| 43 | |
|---|
| 44 | |
|---|
| 45 | open(MA,"machine.txt"); |
|---|
| 46 | |
|---|
| 47 | |
|---|
| 48 | |
|---|
| 49 | $_ =<MA>; |
|---|
| 50 | |
|---|
| 51 | |
|---|
| 52 | if (/sparc/) |
|---|
| 53 | { |
|---|
| 54 | |
|---|
| 55 | $exe = "/homes/home37/feng/cloudy/trunk/sparc/cloudy_sparc.exe"; |
|---|
| 56 | } |
|---|
| 57 | elsif (/alpha/) |
|---|
| 58 | { |
|---|
| 59 | |
|---|
| 60 | $exe = "/homes/home37/feng/cloudy/trunk/alpha/cloudy_alpha.exe"; |
|---|
| 61 | } |
|---|
| 62 | elsif (/Linux/) |
|---|
| 63 | { |
|---|
| 64 | |
|---|
| 65 | $exe = "/home/feng/Perl/object/cloudy_linux.exe"; |
|---|
| 66 | } |
|---|
| 67 | elsif(/spp/) |
|---|
| 68 | { |
|---|
| 69 | |
|---|
| 70 | $in_dir = "/users/gary/cloudy/tsuite"; |
|---|
| 71 | $exe = "/users2/zfeng1/cloudy/object/cloudy_spp.exe"; |
|---|
| 72 | } |
|---|
| 73 | |
|---|
| 74 | elsif (/Windows_NT/ || /NIMBUS/ || /LENTICULAR/ || /cumulus/) |
|---|
| 75 | { |
|---|
| 76 | |
|---|
| 77 | |
|---|
| 78 | $c = "c"; |
|---|
| 79 | |
|---|
| 80 | |
|---|
| 81 | |
|---|
| 82 | $script_dir = "$c:/projects/cloudy/trunk/scripts/"; |
|---|
| 83 | $in_dir = "$c:/projects/cloudy/trunk/tsuite/auto/"; |
|---|
| 84 | $out_dir = "$c:/projects/cloudy/trunk/tsuite/auto/"; |
|---|
| 85 | |
|---|
| 86 | |
|---|
| 87 | $exe = "$c:/projects/cloudy/trunk/release/trunk.exe"; |
|---|
| 88 | |
|---|
| 89 | $exe = "$c:/projects/Cloudy/trunk_net/Debug/trunk_net.exe"; |
|---|
| 90 | $exe = "$c:\\projects\\Cloudy\\trunk\\current_net\\Debug\\current_net.exe"; |
|---|
| 91 | $exe = "$c:/projects/cloudy/trunk/debug/trunk.exe"; |
|---|
| 92 | |
|---|
| 93 | |
|---|
| 94 | |
|---|
| 95 | $current= "$c:/projects/cloudy/trunk/"; |
|---|
| 96 | |
|---|
| 97 | |
|---|
| 98 | if(/Windows_NT/ || /NIMBUS/ || /LENTICULAR/ || /NUMBUS/ || /cumulus/ ) |
|---|
| 99 | { |
|---|
| 100 | |
|---|
| 101 | $lgWinNT = $TRUE; |
|---|
| 102 | } |
|---|
| 103 | } |
|---|
| 104 | else |
|---|
| 105 | { |
|---|
| 106 | |
|---|
| 107 | print STDERR "This machine is not on the list so EXIT !!!"; |
|---|
| 108 | exit; |
|---|
| 109 | } |
|---|
| 110 | |
|---|
| 111 | |
|---|
| 112 | $errors = "$out_dir"."errors.txt"; |
|---|
| 113 | |
|---|
| 114 | $blockrun = "$out_dir"."blockfile.txt"; |
|---|
| 115 | $log_file = "$out_dir"."autorun.log"; |
|---|
| 116 | |
|---|
| 117 | $problem_file = "$out_dir"."problems.txt"; |
|---|
| 118 | |
|---|
| 119 | |
|---|
| 120 | if( $lgSTDERR2FILE ) |
|---|
| 121 | { |
|---|
| 122 | open( STDERR , ">$out_dir"."stderr.log" ); |
|---|
| 123 | } |
|---|
| 124 | |
|---|
| 125 | if( $lgLOGGING ) |
|---|
| 126 | { |
|---|
| 127 | open( ioLOG , ">$log_file" ); |
|---|
| 128 | printf( ioLOG "logging file opened\n"); |
|---|
| 129 | } |
|---|
| 130 | |
|---|
| 131 | |
|---|
| 132 | if( !open(EXEFILE, "$exe") ) |
|---|
| 133 | { |
|---|
| 134 | if( $lgLOGGING ) |
|---|
| 135 | { |
|---|
| 136 | printf( ioLOG "executable did not exist so exiting without running.\n" ); |
|---|
| 137 | } |
|---|
| 138 | printf( STDERR "executable did not exist so exiting without running.\n" ); |
|---|
| 139 | exit; |
|---|
| 140 | } |
|---|
| 141 | |
|---|
| 142 | if( $lgLOGGING ) |
|---|
| 143 | { |
|---|
| 144 | printf( ioLOG "opened the executable %s\n" , "$exe" ); |
|---|
| 145 | } |
|---|
| 146 | |
|---|
| 147 | |
|---|
| 148 | system("copy c:\\projects\\cloudy\\trunk\\debug\\trunk.exe . "); |
|---|
| 149 | |
|---|
| 150 | |
|---|
| 151 | |
|---|
| 152 | |
|---|
| 153 | if( !$lgForceCompute ) |
|---|
| 154 | { |
|---|
| 155 | if( -e $errors ) |
|---|
| 156 | { |
|---|
| 157 | if( $lgLOGGING ) |
|---|
| 158 | { |
|---|
| 159 | printf( ioLOG "errors file exits so checking timestamp\n" ); |
|---|
| 160 | } |
|---|
| 161 | |
|---|
| 162 | if( (-M $errors) < (-M EXEFILE ) ) |
|---|
| 163 | { |
|---|
| 164 | if( $lgLOGGING ) |
|---|
| 165 | { |
|---|
| 166 | printf( ioLOG "errors file younger than exe so exiting\n" ); |
|---|
| 167 | } |
|---|
| 168 | |
|---|
| 169 | exit; |
|---|
| 170 | } |
|---|
| 171 | |
|---|
| 172 | if( -e $blockrun ) |
|---|
| 173 | { |
|---|
| 174 | if( $lgLOGGING ) |
|---|
| 175 | { |
|---|
| 176 | printf( ioLOG "blocking file exists so exiting\n" ); |
|---|
| 177 | } |
|---|
| 178 | |
|---|
| 179 | exit; |
|---|
| 180 | } |
|---|
| 181 | } |
|---|
| 182 | } |
|---|
| 183 | |
|---|
| 184 | |
|---|
| 185 | backup_old_files(); |
|---|
| 186 | |
|---|
| 187 | |
|---|
| 188 | run_cloudy(); |
|---|
| 189 | |
|---|
| 190 | |
|---|
| 191 | check_output(); |
|---|
| 192 | |
|---|
| 193 | |
|---|
| 194 | |
|---|
| 195 | send_mail(); |
|---|
| 196 | |
|---|
| 197 | |
|---|
| 198 | |
|---|
| 199 | |
|---|
| 200 | |
|---|
| 201 | system("perl \"$script_dir\"ir_extime.pl "); |
|---|
| 202 | |
|---|
| 203 | if( $lgLOGGING ) |
|---|
| 204 | { |
|---|
| 205 | printf( ioLOG "nightly_run_tsuite.pl terminates\n" ); |
|---|
| 206 | } |
|---|
| 207 | |
|---|
| 208 | exit; |
|---|
| 209 | |
|---|
| 210 | |
|---|
| 211 | |
|---|
| 212 | |
|---|
| 213 | |
|---|
| 214 | |
|---|
| 215 | sub backup_old_files |
|---|
| 216 | { |
|---|
| 217 | if( $lgLOGGING ) |
|---|
| 218 | { |
|---|
| 219 | printf( ioLOG "backup_old_files entered\n" ); |
|---|
| 220 | } |
|---|
| 221 | |
|---|
| 222 | if( !$lgWinNT ) |
|---|
| 223 | { |
|---|
| 224 | if( $lgLOGGING ) |
|---|
| 225 | { |
|---|
| 226 | printf(ioLOG "backup_old_files returns since not on cumulus\n" ); |
|---|
| 227 | } |
|---|
| 228 | return; |
|---|
| 229 | } |
|---|
| 230 | |
|---|
| 231 | if( $lgDO_NO_WORK ) |
|---|
| 232 | { |
|---|
| 233 | return; |
|---|
| 234 | } |
|---|
| 235 | |
|---|
| 236 | if( !chdir( $out_dir ) ) |
|---|
| 237 | { |
|---|
| 238 | printf(" invalid directory for output of test suite\n"); |
|---|
| 239 | printf(" was ==%s==\n",$out_dir ); |
|---|
| 240 | if( $lgLOGGING ) |
|---|
| 241 | { |
|---|
| 242 | printf(ioLOG " invalid directory for output of test suite\n"); |
|---|
| 243 | printf(ioLOG " was ==%s==\n",$out_dir ); |
|---|
| 244 | } |
|---|
| 245 | exit(1); |
|---|
| 246 | } |
|---|
| 247 | |
|---|
| 248 | |
|---|
| 249 | if( -e "cloudy_bk6.exe" ) |
|---|
| 250 | { |
|---|
| 251 | rename( "cloudy_bk6.exe" , "cloudy_bk7.exe" ); |
|---|
| 252 | } |
|---|
| 253 | if( -e "cloudy_bk5.exe" ) |
|---|
| 254 | { |
|---|
| 255 | rename( "cloudy_bk5.exe" , "cloudy_bk6.exe" ); |
|---|
| 256 | } |
|---|
| 257 | if( -e "cloudy_bk4.exe" ) |
|---|
| 258 | { |
|---|
| 259 | rename( "cloudy_bk4.exe" , "cloudy_bk5.exe" ); |
|---|
| 260 | } |
|---|
| 261 | if( -e "cloudy_bk3.exe" ) |
|---|
| 262 | { |
|---|
| 263 | rename( "cloudy_bk3.exe" , "cloudy_bk4.exe" ); |
|---|
| 264 | } |
|---|
| 265 | if( -e "cloudy_bk2.exe" ) |
|---|
| 266 | { |
|---|
| 267 | rename( "cloudy_bk2.exe" , "cloudy_bk3.exe" ); |
|---|
| 268 | } |
|---|
| 269 | if( -e "cloudy_bk1.exe" ) |
|---|
| 270 | { |
|---|
| 271 | rename( "cloudy_bk1.exe" , "cloudy_bk2.exe" ); |
|---|
| 272 | } |
|---|
| 273 | if( -e "cloudy_bak.exe" ) |
|---|
| 274 | { |
|---|
| 275 | rename( "cloudy_bak.exe" , "cloudy_bk1.exe" ); |
|---|
| 276 | } |
|---|
| 277 | if( -e "cloudy.exe" ) |
|---|
| 278 | { |
|---|
| 279 | rename( "cloudy.exe" , "cloudy_bak.exe" ); |
|---|
| 280 | } |
|---|
| 281 | |
|---|
| 282 | copy( $exe , "cloudy.exe" ); |
|---|
| 283 | |
|---|
| 284 | |
|---|
| 285 | while(defined($output= glob("*.out")) ) |
|---|
| 286 | { |
|---|
| 287 | |
|---|
| 288 | $output =~ s/.out//gi; |
|---|
| 289 | if( -e "$output".".bk6" ) |
|---|
| 290 | { |
|---|
| 291 | rename( "$output".".bk6" , "$output".".bk7" ); |
|---|
| 292 | } |
|---|
| 293 | if( -e "$output".".bk5" ) |
|---|
| 294 | { |
|---|
| 295 | rename( "$output".".bk5" , "$output".".bk6" ); |
|---|
| 296 | } |
|---|
| 297 | if( -e "$output".".bk4" ) |
|---|
| 298 | { |
|---|
| 299 | rename( "$output".".bk4" , "$output".".bk5" ); |
|---|
| 300 | } |
|---|
| 301 | if( -e "$output".".bk3" ) |
|---|
| 302 | { |
|---|
| 303 | rename( "$output".".bk3" , "$output".".bk4" ); |
|---|
| 304 | } |
|---|
| 305 | if( -e "$output".".bk2" ) |
|---|
| 306 | { |
|---|
| 307 | rename( "$output".".bk2" , "$output".".bk3" ); |
|---|
| 308 | } |
|---|
| 309 | if( -e "$output".".bk1" ) |
|---|
| 310 | { |
|---|
| 311 | rename( "$output".".bk1" , "$output".".bk2" ); |
|---|
| 312 | } |
|---|
| 313 | if( -e "$output".".bak" ) |
|---|
| 314 | { |
|---|
| 315 | rename( "$output".".bak" , "$output".".bk1" ); |
|---|
| 316 | } |
|---|
| 317 | if( -e "$output".".out" ) |
|---|
| 318 | { |
|---|
| 319 | rename( "$output".".out" , "$output".".bak" ); |
|---|
| 320 | } |
|---|
| 321 | } |
|---|
| 322 | |
|---|
| 323 | |
|---|
| 324 | if( -e "source_bk6.tar" ) |
|---|
| 325 | { |
|---|
| 326 | rename( "source_bk6.tar" , "source_bk7.tar" ); |
|---|
| 327 | } |
|---|
| 328 | if( -e "source_bk5.tar" ) |
|---|
| 329 | { |
|---|
| 330 | rename( "source_bk5.tar" , "source_bk6.tar" ); |
|---|
| 331 | } |
|---|
| 332 | if( -e "source_bk4.tar" ) |
|---|
| 333 | { |
|---|
| 334 | rename( "source_bk4.tar" , "source_bk5.tar" ); |
|---|
| 335 | } |
|---|
| 336 | if( -e "source_bk3.tar" ) |
|---|
| 337 | { |
|---|
| 338 | rename( "source_bk3.tar" , "source_bk4.tar" ); |
|---|
| 339 | } |
|---|
| 340 | if( -e "source_bk2.tar" ) |
|---|
| 341 | { |
|---|
| 342 | rename( "source_bk2.tar" , "source_bk3.tar" ); |
|---|
| 343 | } |
|---|
| 344 | if( -e "source_bk1.tar" ) |
|---|
| 345 | { |
|---|
| 346 | rename( "source_bk1.tar" , "source_bk2.tar" ); |
|---|
| 347 | } |
|---|
| 348 | if( -e "source_bak.tar" ) |
|---|
| 349 | { |
|---|
| 350 | rename( "source_bak.tar" , "source_bk1.tar" ); |
|---|
| 351 | } |
|---|
| 352 | if( -e "source.tar" ) |
|---|
| 353 | { |
|---|
| 354 | rename( "source.tar" , "source_bak.tar" ); |
|---|
| 355 | } |
|---|
| 356 | |
|---|
| 357 | |
|---|
| 358 | if( -e "tsuite_bk6.tar" ) |
|---|
| 359 | { |
|---|
| 360 | rename( "tsuite_bk6.tar" , "tsuite_bk7.tar" ); |
|---|
| 361 | } |
|---|
| 362 | if( -e "tsuite_bk5.tar" ) |
|---|
| 363 | { |
|---|
| 364 | rename( "tsuite_bk5.tar" , "tsuite_bk6.tar" ); |
|---|
| 365 | } |
|---|
| 366 | if( -e "tsuite_bk4.tar" ) |
|---|
| 367 | { |
|---|
| 368 | rename( "tsuite_bk4.tar" , "tsuite_bk5.tar" ); |
|---|
| 369 | } |
|---|
| 370 | if( -e "tsuite_bk3.tar" ) |
|---|
| 371 | { |
|---|
| 372 | rename( "tsuite_bk3.tar" , "tsuite_bk4.tar" ); |
|---|
| 373 | } |
|---|
| 374 | if( -e "tsuite_bk2.tar" ) |
|---|
| 375 | { |
|---|
| 376 | rename( "tsuite_bk2.tar" , "tsuite_bk3.tar" ); |
|---|
| 377 | } |
|---|
| 378 | if( -e "tsuite_bk1.tar" ) |
|---|
| 379 | { |
|---|
| 380 | rename( "tsuite_bk1.tar" , "tsuite_bk2.tar" ); |
|---|
| 381 | } |
|---|
| 382 | if( -e "tsuite_bak.tar" ) |
|---|
| 383 | { |
|---|
| 384 | rename( "tsuite_bak.tar" , "tsuite_bk1.tar" ); |
|---|
| 385 | } |
|---|
| 386 | if( -e "tsuite.tar" ) |
|---|
| 387 | { |
|---|
| 388 | rename( "tsuite.tar" , "tsuite_bak.tar" ); |
|---|
| 389 | } |
|---|
| 390 | system( |
|---|
| 391 | "tar_mks -cvf tsuite.tar *.in"); |
|---|
| 392 | |
|---|
| 393 | |
|---|
| 394 | |
|---|
| 395 | if( -e "data_bk6.tar" ) |
|---|
| 396 | { |
|---|
| 397 | rename( "data_bk6.tar" , "data_bk7.tar" ); |
|---|
| 398 | } |
|---|
| 399 | if( -e "data_bk5.tar" ) |
|---|
| 400 | { |
|---|
| 401 | rename( "data_bk5.tar" , "data_bk6.tar" ); |
|---|
| 402 | } |
|---|
| 403 | if( -e "data_bk4.tar" ) |
|---|
| 404 | { |
|---|
| 405 | rename( "data_bk4.tar" , "data_bk5.tar" ); |
|---|
| 406 | } |
|---|
| 407 | if( -e "data_bk3.tar" ) |
|---|
| 408 | { |
|---|
| 409 | rename( "data_bk3.tar" , "data_bk4.tar" ); |
|---|
| 410 | } |
|---|
| 411 | if( -e "data_bk2.tar" ) |
|---|
| 412 | { |
|---|
| 413 | rename( "data_bk2.tar" , "data_bk3.tar" ); |
|---|
| 414 | } |
|---|
| 415 | if( -e "data_bk1.tar" ) |
|---|
| 416 | { |
|---|
| 417 | rename( "data_bk1.tar" , "data_bk2.tar" ); |
|---|
| 418 | } |
|---|
| 419 | if( -e "data_bak.tar" ) |
|---|
| 420 | { |
|---|
| 421 | rename( "data_bak.tar" , "data_bk1.tar" ); |
|---|
| 422 | } |
|---|
| 423 | if( -e "data.tar" ) |
|---|
| 424 | { |
|---|
| 425 | rename( "data.tar" , "data_bak.tar" ); |
|---|
| 426 | } |
|---|
| 427 | |
|---|
| 428 | |
|---|
| 429 | if( !chdir( $current ) ) |
|---|
| 430 | { |
|---|
| 431 | printf(" invalid directory for current project\n"); |
|---|
| 432 | printf(" was ==%s==\n",$out_dir ); |
|---|
| 433 | if( $lgLOGGING ) |
|---|
| 434 | { |
|---|
| 435 | printf(ioLOG " invalid directory for current project\n"); |
|---|
| 436 | printf(ioLOG " was ==%s==\n",$out_dir ); |
|---|
| 437 | } |
|---|
| 438 | exit(1); |
|---|
| 439 | } |
|---|
| 440 | |
|---|
| 441 | system( |
|---|
| 442 | "tar_mks -cvf \"$out_dir\"\"source.tar\" source/*.*"); |
|---|
| 443 | |
|---|
| 444 | |
|---|
| 445 | |
|---|
| 446 | system( |
|---|
| 447 | "tar_mks -cvf \"$out_dir\"\"data.tar\" data/*.dat data/*.ini data/*.in data/*.rfi data/*.szd data/*.opc data/*.txt"); |
|---|
| 448 | |
|---|
| 449 | if( $lgLOGGING ) |
|---|
| 450 | { |
|---|
| 451 | printf( ioLOG "backup_old_files exits\n" ); |
|---|
| 452 | |
|---|
| 453 | } |
|---|
| 454 | |
|---|
| 455 | |
|---|
| 456 | if( !chdir( $out_dir ) ) |
|---|
| 457 | { |
|---|
| 458 | printf(" invalid directory for output of test suite\n"); |
|---|
| 459 | printf(" was ==%s==\n",$out_dir ); |
|---|
| 460 | if( $lgLOGGING ) |
|---|
| 461 | { |
|---|
| 462 | printf(ioLOG " invalid directory for output of test suite\n"); |
|---|
| 463 | printf(ioLOG " was ==%s==\n",$out_dir ); |
|---|
| 464 | } |
|---|
| 465 | exit(1); |
|---|
| 466 | } |
|---|
| 467 | } |
|---|
| 468 | |
|---|
| 469 | sub run_cloudy |
|---|
| 470 | { |
|---|
| 471 | |
|---|
| 472 | $nMod = 0; |
|---|
| 473 | $nskip = $nmod_calc; |
|---|
| 474 | |
|---|
| 475 | if( !chdir( $out_dir ) ) |
|---|
| 476 | { |
|---|
| 477 | printf(" invalid directory for output of test suite\n"); |
|---|
| 478 | printf(" was ==%s==\n",$out_dir ); |
|---|
| 479 | exit(1); |
|---|
| 480 | } |
|---|
| 481 | if( $lgLOGGING ) |
|---|
| 482 | { |
|---|
| 483 | printf( ioLOG "run_cloudy about to glob input files in dir %s\n", $in_dir ); |
|---|
| 484 | } |
|---|
| 485 | |
|---|
| 486 | while( defined( $input = glob("$in_dir*.in") ) ) |
|---|
| 487 | { |
|---|
| 488 | if ( $nMod>=$nskip ) |
|---|
| 489 | { |
|---|
| 490 | |
|---|
| 491 | $output = $input; |
|---|
| 492 | |
|---|
| 493 | $output =~ s/$in_dir/$out_dir/gi; |
|---|
| 494 | |
|---|
| 495 | $output =~ s/\.in/.out/gi; |
|---|
| 496 | |
|---|
| 497 | if( $lgLOGGING ) |
|---|
| 498 | { |
|---|
| 499 | printf( ioLOG "from %s \n to %s \n", $input , $output ); |
|---|
| 500 | } |
|---|
| 501 | |
|---|
| 502 | if( !$lgDO_NO_WORK ) |
|---|
| 503 | { |
|---|
| 504 | |
|---|
| 505 | |
|---|
| 506 | |
|---|
| 507 | system "$exe < $input > $output "; |
|---|
| 508 | } |
|---|
| 509 | } |
|---|
| 510 | ++$nMod; |
|---|
| 511 | } |
|---|
| 512 | |
|---|
| 513 | } |
|---|
| 514 | |
|---|
| 515 | |
|---|
| 516 | |
|---|
| 517 | |
|---|
| 518 | |
|---|
| 519 | sub check_output |
|---|
| 520 | { |
|---|
| 521 | |
|---|
| 522 | |
|---|
| 523 | |
|---|
| 524 | if( $lgLOGGING ) |
|---|
| 525 | { |
|---|
| 526 | printf( ioLOG "check_output entered\n"); |
|---|
| 527 | } |
|---|
| 528 | |
|---|
| 529 | system "grep Botch $out_dir*.out >$errors"; |
|---|
| 530 | system "grep W- $out_dir*.out >> $errors"; |
|---|
| 531 | |
|---|
| 532 | if( !open( ioERRORS , ">>$errors" ) ) |
|---|
| 533 | { |
|---|
| 534 | die( "could not open errors.txt" ); |
|---|
| 535 | } |
|---|
| 536 | |
|---|
| 537 | |
|---|
| 538 | |
|---|
| 539 | |
|---|
| 540 | |
|---|
| 541 | $checkend = "$out_dir"."checkend.txt"; |
|---|
| 542 | while(defined($input= glob("$out_dir*.in")) ) |
|---|
| 543 | { |
|---|
| 544 | |
|---|
| 545 | |
|---|
| 546 | $output = $input; |
|---|
| 547 | $output =~ s/\.in/\.out/gi; |
|---|
| 548 | system "grep 'ChkAssert' $output > $checkend "; |
|---|
| 549 | |
|---|
| 550 | if(-z "$checkend") |
|---|
| 551 | { |
|---|
| 552 | printf( ioERRORS "%s did not end or had no asserts\n", $output); |
|---|
| 553 | } |
|---|
| 554 | } |
|---|
| 555 | |
|---|
| 556 | |
|---|
| 557 | system "ls \"$out_dir*.skip\" > skip.txt" ; |
|---|
| 558 | |
|---|
| 559 | if( -s "skip.txt" ) |
|---|
| 560 | { |
|---|
| 561 | print STDERR "\n\n some files were skipped by renmaing to .skip - list is in skip.txt\n" ; |
|---|
| 562 | system "echo some files were skipped by renmaing to .skip - list is in skip.txt >> checkall.txt "; |
|---|
| 563 | } |
|---|
| 564 | |
|---|
| 565 | if( $lgLOGGING ) |
|---|
| 566 | { |
|---|
| 567 | printf( ioLOG "check_output exits\n"); |
|---|
| 568 | } |
|---|
| 569 | close( ioERRORS); |
|---|
| 570 | |
|---|
| 571 | |
|---|
| 572 | copy( $errors , "u:/pub/gary/bleeding_edge/last/errors.txt" ); |
|---|
| 573 | |
|---|
| 574 | |
|---|
| 575 | if( -e $problem_file ) |
|---|
| 576 | { |
|---|
| 577 | unlink( $problem_file ); |
|---|
| 578 | } |
|---|
| 579 | |
|---|
| 580 | system( "grep \"PROBLEM\" *.out > $problem_file" ); |
|---|
| 581 | |
|---|
| 582 | system( "grep \"DEBUG\" *.out >> $problem_file" ); |
|---|
| 583 | |
|---|
| 584 | copy( $problem_file , "u:/pub/gary/bleeding_edge/last/problems.txt" ); |
|---|
| 585 | |
|---|
| 586 | } |
|---|
| 587 | |
|---|
| 588 | |
|---|
| 589 | |
|---|
| 590 | |
|---|
| 591 | |
|---|
| 592 | sub send_mail |
|---|
| 593 | { |
|---|
| 594 | |
|---|
| 595 | |
|---|
| 596 | |
|---|
| 597 | if( -s "$errors" ) |
|---|
| 598 | { |
|---|
| 599 | |
|---|
| 600 | |
|---|
| 601 | system("c:\\u\\blat\\blat.exe errors.txt -t gary\@pa.uky.edu -s \"Cloudy had problems on the pc\" " ); |
|---|
| 602 | } |
|---|
| 603 | else |
|---|
| 604 | { |
|---|
| 605 | open( ioEMAIL , ">message.txt" ); |
|---|
| 606 | |
|---|
| 607 | printf( ioEMAIL " test suite ran OK on my pc\n"); |
|---|
| 608 | printf( ioEMAIL " no crashes or asserts were found on the pc\r\n" ) ; |
|---|
| 609 | printf( ioEMAIL " contents of last dir being copied to last_good\r\n" ) ; |
|---|
| 610 | close( ioEMAIL ); |
|---|
| 611 | |
|---|
| 612 | |
|---|
| 613 | system("c:\\u\\blat\\blat.exe message.txt -t gary\@pa.uky.edu -s \"test suite successfully run\" " ); |
|---|
| 614 | |
|---|
| 615 | |
|---|
| 616 | system( "perl \"$script_dir\"promote_last_good.pl" ); |
|---|
| 617 | } |
|---|
| 618 | |
|---|
| 619 | |
|---|
| 620 | if( -s "$problem_file" ) |
|---|
| 621 | { |
|---|
| 622 | system("c:\\u\\blat\\blat.exe problems.txt -t gary\@pa.uky.edu -s \"PROBLEM or DEBUG string was printed on PC\" " ); |
|---|
| 623 | } |
|---|
| 624 | } |
|---|