Changeset 3690
- Timestamp:
- Apr 8, 2005, 2:04:58 PM (21 years ago)
- Location:
- trunk/psLib
- Files:
-
- 20 added
- 18 deleted
- 23 edited
-
src/astronomy/Makefile.am (modified) (2 diffs)
-
src/collections/Makefile.am (modified) (3 diffs)
-
src/dataIO/Makefile.am (modified) (2 diffs)
-
src/fileUtils/Makefile.am (modified) (2 diffs)
-
test/FullUnitTest (modified) (5 diffs)
-
test/astronomy (modified) (1 prop)
-
test/astronomy/.cvsignore (modified) (2 diffs)
-
test/astronomy/Makefile.am (modified) (6 diffs)
-
test/astronomy/data/header_1.fits (deleted)
-
test/astronomy/data/header_2.fits (deleted)
-
test/astronomy/data/test.config (deleted)
-
test/astronomy/tst_psAstrometry01.c (modified) (3 diffs)
-
test/astronomy/verified/tst_psDB.stderr (deleted)
-
test/astronomy/verified/tst_psMetadataIO.stderr (deleted)
-
test/astronomy/verified/tst_psMetadataIO.stdout (deleted)
-
test/astronomy/verified/tst_psMetadata_01.stderr (deleted)
-
test/astronomy/verified/tst_psMetadata_01.stdout (deleted)
-
test/astronomy/verified/tst_psMetadata_02.stderr (deleted)
-
test/astronomy/verified/tst_psMetadata_02.stdout (deleted)
-
test/astronomy/verified/tst_psMetadata_03.stderr (deleted)
-
test/astronomy/verified/tst_psMetadata_03.stdout (deleted)
-
test/astronomy/verified/tst_psMetadata_04.stderr (deleted)
-
test/astronomy/verified/tst_psMetadata_04.stdout (deleted)
-
test/astronomy/verified/tst_psMetadata_05.stderr (deleted)
-
test/astronomy/verified/tst_psMetadata_05.stdout (deleted)
-
test/astronomy/verified/tst_psMetadata_06.stdout (deleted)
-
test/astronomy/verified/tst_psMetadata_07.stdout (deleted)
-
test/collections (modified) (1 prop)
-
test/collections/.cvsignore (modified) (1 diff)
-
test/collections/Makefile.am (modified) (4 diffs)
-
test/collections/data (added)
-
test/collections/data/header_1.fits (added)
-
test/collections/data/header_2.fits (added)
-
test/collections/data/test.config (added)
-
test/collections/tst_psHash01.c (modified) (1 diff)
-
test/collections/tst_psHash02.c (modified) (1 diff)
-
test/collections/tst_psHash03.c (modified) (1 diff)
-
test/collections/tst_psHash04.c (modified) (1 diff)
-
test/collections/verified/tst_psMetadataIO.stderr (added)
-
test/collections/verified/tst_psMetadataIO.stdout (added)
-
test/collections/verified/tst_psMetadata_01.stderr (added)
-
test/collections/verified/tst_psMetadata_01.stdout (added)
-
test/collections/verified/tst_psMetadata_02.stderr (added)
-
test/collections/verified/tst_psMetadata_02.stdout (added)
-
test/collections/verified/tst_psMetadata_03.stderr (added)
-
test/collections/verified/tst_psMetadata_03.stdout (added)
-
test/collections/verified/tst_psMetadata_04.stderr (added)
-
test/collections/verified/tst_psMetadata_04.stdout (added)
-
test/collections/verified/tst_psMetadata_05.stderr (added)
-
test/collections/verified/tst_psMetadata_05.stdout (added)
-
test/collections/verified/tst_psMetadata_06.stdout (added)
-
test/collections/verified/tst_psMetadata_07.stdout (added)
-
test/dataIO (modified) (1 prop)
-
test/dataIO/.cvsignore (modified) (1 diff)
-
test/dataIO/Makefile.am (modified) (3 diffs)
-
test/dataIO/verified/tst_psDB.stderr (added)
-
test/fileUtils (modified) (1 prop)
-
test/fileUtils/.cvsignore (modified) (1 diff)
-
test/fileUtils/Makefile.am (modified) (3 diffs)
-
test/fileUtils/verified/tst_psDB.stderr (added)
-
test/runTest (modified) (16 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/src/astronomy/Makefile.am
r3684 r3690 14 14 libpslibastronomy_la_SOURCES = \ 15 15 psTime.c \ 16 psMetadata.c \17 psMetadataIO.c \18 16 psCoord.c \ 19 17 psAstrometry.c \ 20 psDB.c \21 18 aoppa.f aopqk.f oapqk.f airmas.f eqeqx.f geoc.f refco.f aoppat.f \ 22 19 dranrm.f dcs2c.f refz.f refro.f dcc2s.f gmst.f atms.f atmt.f nutc.f drange.f … … 32 29 pslibinclude_HEADERS = \ 33 30 psTime.h \ 34 psMetadata.h \35 psMetadataIO.h \36 31 psCoord.h \ 37 32 psAstrometry.h \ 38 33 psPhotometry.h \ 39 psDB.h \40 34 slalib.h 41 35 -
trunk/psLib/src/collections/Makefile.am
r3684 r3690 1 1 #Makefile for collections functions of psLib 2 2 # 3 3 4 INCLUDES = \ 4 5 -I$(top_srcdir)/src/astronomy \ … … 18 19 psCompare.c \ 19 20 psArray.c \ 20 psHash.c 21 psHash.c \ 22 psMetadata.c \ 23 psMetadataIO.c 21 24 22 25 BUILT_SOURCES = psCollectionsErrors.h … … 34 37 psCompare.h \ 35 38 psArray.h \ 36 psHash.h 39 psHash.h \ 40 psMetadata.h \ 41 psMetadataIO.h 37 42 -
trunk/psLib/src/dataIO/Makefile.am
r3684 r3690 13 13 libpslibdataIO_la_SOURCES = \ 14 14 psLookupTable.c \ 15 psFits.c 15 psFits.c \ 16 psDB.c 17 16 18 17 19 BUILT_SOURCES = psFileUtilsErrors.h … … 24 26 pslibinclude_HEADERS = \ 25 27 psLookupTable.h \ 26 psFits.h 28 psFits.h \ 29 psDB.h 27 30 -
trunk/psLib/src/fileUtils/Makefile.am
r3684 r3690 13 13 libpslibdataIO_la_SOURCES = \ 14 14 psLookupTable.c \ 15 psFits.c 15 psFits.c \ 16 psDB.c 17 16 18 17 19 BUILT_SOURCES = psFileUtilsErrors.h … … 24 26 pslibinclude_HEADERS = \ 25 27 psLookupTable.h \ 26 psFits.h 28 psFits.h \ 29 psDB.h 27 30 -
trunk/psLib/test/FullUnitTest
r3599 r3690 19 19 # RETURN : integer number of tests which failed 20 20 # 21 # $Revision: 1.2 1$ $Name: not supported by cvs2svn $22 # $Date: 2005-0 3-31 23:37:09$21 # $Revision: 1.22 $ $Name: not supported by cvs2svn $ 22 # $Date: 2005-04-09 00:04:57 $ 23 23 # 24 24 # Copyright 2004 Maui High Performance Computing Center, University of Hawaii 25 25 # 26 26 ############################################################################## 27 28 use FindBin qw($Bin); 29 30 $runTest = "$Bin/runTest"; 27 31 28 32 # Provide functions for determining the pathname of current working directory … … 311 315 $totalTestDrivers++; 312 316 313 # Perform subdirectory checks only the first time a test314 # file is found with the list of enteries315 if ( $initialTest == 0 ) {316 $initialTest++;317 318 # Check for a temp subdirectory already exists and if not319 # then create one320 &checkForTempDirectory();321 322 # Check for the presence of verified directory323 if ( &checkForVerifiedDirectory() ) {324 325 # Display message to user that verified directories do not326 # exist eventhough TST files have been found327 # print("Unable to execute test drivers in $base_dir\n");328 print("No verified subdirectory present.\n") if ($verbose);329 330 # Increment test fail count331 # $testDriverFailCount++;332 # Save the file failed333 # push(@testsFailed, $pwd . "/" . $files[$j]);334 # return;335 }336 }337 338 317 # Display message to user of which test driver is being executed 339 318 print("--- Executing test driver $files[$j]\n") if ( !$silent ); 340 319 341 320 # Execute the test driver 342 system( 343 "./$files[$j] 1> temp/$files[$j].stdout 2> temp/$files[$j].stderr" 344 ); 321 if ($silent) { 322 system("$runTest --quiet ./$files[$j]"); 323 } elsif ($verbose) { 324 system("$runTest --printpassfail ./$files[$j]"); 325 } else { 326 system("$runTest ./$files[$j]"); 327 } 345 328 $retVal = $?; 346 329 … … 357 340 358 341 # Check result of test driver 359 if ( ( ( $retVal != 0 ) && ( $files[$j] =~ /^TST/i ) ) 360 || ( ( $retVal == 0 ) && ( $files[$j] =~ /^ATST/i ) ) ) 342 if ( $retVal != 0 ) 361 343 { 362 344 … … 372 354 push( @testsFailed, $pwd . "/" . $files[$j] ); 373 355 } 374 else {375 376 # Create filter versions of STDOUT and STDERR to replace variable377 # items such as date, time and host378 &filterStdFiles( $files[$j] );379 380 # Perform difference on STDOUT file collected381 # with verified files382 $exitValue = &compareStream("verified/$files[$j].stdout");383 if ( $exitValue & 2 ) {384 385 # STDOUT verified doesn't exist. Search STDOUT capture386 # for strings indicating error or failure387 $exitValue |= &errorStrSearch("$files[$j].stdout");388 }389 if ( ( $exitValue & 8 ) || ( $exitValue & 64 ) ) {390 391 # Increment the total number of test failed392 $testDriverFailCount++;393 394 # Push test on failed list395 print(396 "Test failed ($failPoints out of $totalPoints testpoints failed)\n"397 )398 if ( !$silent );399 push( @testsFailed, $pwd . "/" . $files[$j] );400 }401 else {402 403 # Perform difference on STDERR file collection with verified404 $exitValue = &compareStream("verified/$files[$j].stderr");405 if ( $exitValue & 4 ) {406 407 # STDERR verified doesn't exist. Search STDERR capture408 # for strings indicating error or failure409 $exitValue |= &errorStrSearch("$files[$j].stderr");410 }411 if ( ( $exitValue & 16 ) || ( $exitValue & 128 ) ) {412 413 # Increment the total number of tests failed414 $testDriverFailCount++;415 416 # Push test on failed list417 print(418 "Test failed ($failPoints out of $totalPoints testpoints failed)\n"419 )420 if ( !$silent );421 push( @testsFailed, $pwd . "/" . $files[$j] );422 }423 else {424 print("Test successful ($totalPoints testpoints)\n")425 if ( !$silent );426 }427 }428 }429 356 } 430 357 $j++; … … 432 359 } 433 360 434 ################################################################################435 #436 # SUBROUTINE: errorStrSearch437 #438 # Description: This subroutine will search the file specified in its439 # parameter for error strings and if they do exists440 # the appropriate value will be returned.441 #442 # Parameter(s): fileName - input file to search for strings443 #444 # Return: 0 - No error strings found445 # 64 - Error strings found in STDOUT446 # 128 - Error strings found in STDERR447 #448 ###############################################################################449 450 sub errorStrSearch {451 local ($fileName) = @_;452 local ($returnVal) = 0;453 454 # Open the captured file455 open( CAPT_FILE, "<temp/$fileName" );456 457 # Scan through all the lines of the file searching for error strings458 while (<CAPT_FILE>) {459 if ( m/FAIL/i460 || m/FAULT/i461 || m/ERROR/i462 || m/Not Found/i463 || m/SIGNAL/i464 || m/NO SUCH FILE/i465 || m/\|E\|/i466 || m/\|A\|/i )467 {468 print;469 if ( $fileName =~ m/out/ ) {470 print(471 " Failed - File $fileName contains error strings.\n"472 );473 $returnVal = 64;474 }475 elsif ( $fileName =~ m/err/ ) {476 print(477 " Failed - File $fileName contains error strings.\n"478 );479 $returnVal = 128;480 }481 last;482 }483 }484 485 # Close the capture file486 close(CAPT_FILE);487 488 # Return the return value489 return ($returnVal);490 }491 492 ################################################################################493 #494 # SUBROUTINE: compareStream495 #496 # Description: This subroutine will compare the captured stream file with497 # a file in the verified directory if one exists.498 #499 # Parameter(s): streamFile - input file to compare500 #501 # Return: 0 - Compare successful502 # 2 - STDOUT verified file doesn't exist503 # 4 - STDERR verified file doesn't exist504 # 8 - STDOUT verified file doesn't compare505 # 16 - STDERR verified file doesn't compare506 #507 ###############################################################################508 509 sub compareStream {510 local ($streamFile) = @_;511 local ($returnVal) = 0;512 local ($tempFile) = "";513 514 # Check for existence of verified STD stream files515 if ( !( -e $streamFile ) ) {516 517 # Display message to user that verified STDOUT file doesn't exist518 print(" File $streamFile doesn't exist.\n") if ($verbose);519 520 # Set exit value bit 1 to indicate proper failure521 if ( $streamFile =~ /out$/ ) {522 $returnVal |= 2;523 }524 elsif ( $streamFile =~ /err$/ ) {525 $returnVal |= 4;526 }527 }528 else {529 530 # Verified STD stream file exists531 532 # Create name of the temp file to compare533 $tempFile = $streamFile;534 $tempFile =~ s/verified/temp/;535 $tempFile = $tempFile . ".mod";536 537 # Perform difference on the STD stream files538 $diffstdout = `diff $streamFile $tempFile`;539 540 # Check the return value of the difference541 if ( $? != 0 ) {542 543 # Difference of STD stream files failed544 545 # Check for STDOUT in file name to convey appropirate return value546 if ( $streamFile =~ /out$/ ) {547 548 # Display message of the failure of difference to user549 print(" Failed - STDOUT difference\n$diffstdout\n");550 551 # Exit value to indicate STDOUT did not compare552 $returnVal |= 8;553 }554 elsif ( $streamFile =~ /err$/ ) {555 556 # Display message of the failure of difference to user557 print(" Failed - STDERR difference\n$diffstdout\n");558 559 # Exit value to indicate STDERR did not compare560 $returnVal |= 16;561 }562 }563 }564 565 # Return the result of the compare566 return ($returnVal);567 }568 569 ################################################################################570 #571 # SUBROUTINE: checkForTempDirectory572 #573 # Description: This subroutine will check for the existence of a temp574 # directory to store STDOUT, STDERR files during test. If575 # the subdirectory doesn't exist, it will be created.576 #577 # Parameter(s): None578 #579 # Return: None580 #581 ################################################################################582 583 sub checkForTempDirectory {584 585 # Check if a temp directory already exists in the current work directory586 if ( !( -e "temp" ) ) {587 588 # Create temp directory to store STDOUT, STDERR files during test589 `mkdir temp`;590 591 # Display message of new directory created592 print("Creating temp directory\n") if ($verbose);593 }594 }595 596 ################################################################################597 #598 # SUBROUTINE: checkForVerifiedDirectory599 #600 # Description: This subroutine will check for the existence of a verified601 # directory which stores verified STDOUT, STDERR files for602 # comparison during the test.603 #604 # Parameter(s): None605 #606 # Return: 0 - subdirectory present607 # 1 - subdirectory not present608 #609 ################################################################################610 611 sub checkForVerifiedDirectory {612 $returnValue = 0;613 614 # Check if verified subdirectory exists in the current working directory615 if ( !( -e "verified" ) ) {616 617 # Set return value to 1618 $returnValue = 1;619 }620 return ($returnValue);621 }622 623 ################################################################################624 #625 # SUBROUTINE: filterStdFiles626 #627 # Description: This subroutine will filter variable items in the STDOUT628 # and STDERR files captured. Date, time and host names629 # are variable items in the log messages captured.630 #631 # Parameter(s): test file name632 #633 # Return: None634 #635 ################################################################################636 637 sub filterStdFiles {638 639 local ($fileName) = @_;640 641 # Open the STDOUT file for reading642 open( OUTFILE, "< temp/$fileName.stdout" );643 644 # Open mod file to place filtered STDOUT645 open( MODFILE, "> temp/$fileName.stdout.mod" );646 647 # Replace the variable data, time and host information with constants648 $hostname = `hostname`;649 chop $hostname;650 while (<OUTFILE>) {651 s/\s+\d+:\d+:\d+\w/<TIME>/g;652 s/\d+:\d+:\d+/<DATE>/g;653 s/$hostname\s*/<HOST>/g;654 s/: Line \d+/: Line <LINENO>/g;655 s/\(.*\:\d+\)/\(FILE\:LINENO\)/g;656 s/\s+[\_\-\/\.\w]+\:\d+/ FILE\:LINENO/g;657 s/allocate \d+ bytes at/allocate <N> bytes at/g;658 s/v\d+.\d+.\d+/vX.X.X/g;659 660 # Filter lines with *** malloc. This is an artifact of Mac testing of661 # memory functions662 if ( !m/\*\*\*\smalloc/ ) {663 print MODFILE ($_);664 }665 }666 667 # Close mod file668 close(MODFILE);669 670 # Close STDERR file671 close(OUTFILE);672 673 # Open the STDERR file for reading674 open( OUTFILE, "< temp/$fileName.stderr" );675 676 # Open mod file to place filtered STDERR677 open( MODFILE, "> temp/$fileName.stderr.mod" );678 679 # Replace the variable date, time and host information with constants680 while (<OUTFILE>) {681 s/\s+\d+:\d+:\d+\w/<TIME>/g;682 s/\d+:\d+:\d+/<DATE>/g;683 s/$hostname\s*/<HOST>/g;684 s/: Line \d+/: Line <LINENO>/g;685 s/\(.*\:\d+\)/\(FILE\:LINENO\)/g;686 s/\s+[\_\-\/\.\w]+\:\d+/ FILE\:LINENO/g;687 s/allocate \d+ bytes at/allocate <N> bytes at/g;688 s/v\d+.\d+.\d+/vX.X.X/g;689 690 # Filter lines with *** malloc. This is an artifact of Mac testing of691 # memory functions692 if ( !m/\*\*\*\smalloc/ ) {693 print MODFILE ($_);694 }695 }696 697 # Close mod file698 close(MODFILE);699 700 # Close STDERR file701 close(OUTFILE);702 }703 -
trunk/psLib/test/astronomy
- Property svn:ignore
-
old new 7 7 tst_psTime_01 8 8 tst_psTime_02 9 tst_psMetadata05_OUT10 tst_psMetadata_0111 tst_psMetadata_0212 tst_psMetadata_0313 tst_psMetadata_0414 tst_psMetadata_0515 tst_psMetadata_0616 9 tst_psAstrometry 17 10 tst_psAstrometry01 18 11 tst_psCoord 19 tst_psMetadataIO20 tst_psMetadata_0721 12 tst_psTime_03 22 13 tst_psTime_04 … … 26 17 .deps 27 18 .libs 28 header_1.fits29 header_2.fits30 test.config31 19 test.ser7.dat 32 20 tst_psCoord01 33 tst_psDB
-
- Property svn:ignore
-
trunk/psLib/test/astronomy/.cvsignore
r3590 r3690 7 7 tst_psTime_01 8 8 tst_psTime_02 9 tst_psMetadata05_OUT10 tst_psMetadata_0111 tst_psMetadata_0212 tst_psMetadata_0313 tst_psMetadata_0414 tst_psMetadata_0515 tst_psMetadata_0616 9 tst_psAstrometry 17 10 tst_psAstrometry01 18 11 tst_psCoord 19 tst_psMetadataIO20 tst_psMetadata_0721 12 tst_psTime_03 22 13 tst_psTime_04 … … 26 17 .deps 27 18 .libs 28 header_1.fits29 header_2.fits30 test.config31 19 test.ser7.dat 32 20 tst_psCoord01 33 tst_psDB34 21 -
trunk/psLib/test/astronomy/Makefile.am
r3684 r3690 12 12 13 13 AM_LDFLAGS = -L$(top_builddir)/src -lpslib $(PSLIB_LIBS) 14 AM_CFLAGS = -DXML_CONFIG_FILE="\"$(top_srcdir)/etc/pslib/psTime.xml\""15 14 16 15 TESTS = tst_psTime_01 \ … … 18 17 tst_psTime_03 \ 19 18 tst_psTime_04 \ 20 tst_psMetadataIO \21 tst_psMetadata_01 \22 tst_psMetadata_02 \23 tst_psMetadata_03 \24 tst_psMetadata_04 \25 tst_psMetadata_05 \26 tst_psMetadata_06 \27 tst_psMetadata_07 \28 19 tst_psCoord \ 29 20 tst_psCoord01 \ 30 @TST_PSDB@ \31 21 tst_psAstrometry \ 32 22 tst_psAstrometry01 … … 34 24 check_PROGRAMS = $(TESTS) 35 25 36 check_DATA = test.config \ 37 psTime.config \ 26 check_DATA = psTime.config \ 38 27 test.psTime.config1 \ 39 28 test.psTime.config2 \ 40 29 test.psTime.config3 \ 41 30 test.psTime.config4 \ 42 header_1.fits \43 header_2.fits \44 31 test.ser7.dat 45 32 46 33 TESTS_ENVIRONMENT = export PS_CONFIG_FILE="psTime.config" && perl $(top_srcdir)/test/runTest --verified=$(srcdir)/verified 47 48 EXTRA_PROGRAMS = tst_psDB49 34 50 35 tests: $(check_DATA) $(TESTS) … … 54 39 tst_psTime_03_SOURCES = tst_psTime_03.c 55 40 tst_psTime_04_SOURCES = tst_psTime_04.c 56 tst_psDB_SOURCES = tst_psDB.c57 tst_psMetadataIO_SOURCES = tst_psMetadataIO.c58 tst_psMetadata_01_SOURCES = tst_psMetadata_01.c59 tst_psMetadata_02_SOURCES = tst_psMetadata_02.c60 tst_psMetadata_03_SOURCES = tst_psMetadata_03.c61 tst_psMetadata_04_SOURCES = tst_psMetadata_04.c62 tst_psMetadata_05_SOURCES = tst_psMetadata_05.c63 tst_psMetadata_06_SOURCES = tst_psMetadata_06.c64 tst_psMetadata_07_SOURCES = tst_psMetadata_07.c65 41 tst_psAstrometry_SOURCES = tst_psAstrometry.c 66 42 tst_psCoord_SOURCES = tst_psCoord.c … … 72 48 data/test.psTime.config3.template \ 73 49 data/test.psTime.config4.template \ 74 data/header_1.fits \75 data/header_2.fits \76 data/test.config \77 50 data/test.ser7.dat \ 78 51 verified … … 95 68 cp $? $@ 96 69 97 test.config: data/test.config98 cp $? $@99 100 header_1.fits: data/header_1.fits101 cp $? $@102 103 header_2.fits: data/header_2.fits104 cp $? $@105 106 70 test.ser7.dat: data/test.ser7.dat 107 71 cp $? $@ -
trunk/psLib/test/astronomy/tst_psAstrometry01.c
r3682 r3690 5 5 * @author GLG, MHPCC 6 6 * 7 * @version $Revision: 1.1 8$ $Name: not supported by cvs2svn $8 * @date $Date: 2005-04-0 7 20:27:41$7 * @version $Revision: 1.19 $ $Name: not supported by cvs2svn $ 8 * @date $Date: 2005-04-09 00:04:57 $ 9 9 * 10 10 * XXX: Must test … … 106 106 {\ 107 107 NAME = (psPlaneTransform *) psAlloc(sizeof(psPlaneTransform)); \ 108 p _psMemSetDeallocator(NAME, (psFreeFcn) psPlaneTransformFree); \108 psMemSetDeallocator(NAME, (psFreeFcn) psPlaneTransformFree); \ 109 109 NAME->x = psDPolynomial2DAlloc(2, 2, PS_POLYNOMIAL_ORD); \ 110 110 NAME->y = psDPolynomial2DAlloc(2, 2, PS_POLYNOMIAL_ORD); \ … … 116 116 {\ 117 117 NAME = (psPlaneDistort *) psAlloc(sizeof(psPlaneDistort)); \ 118 p _psMemSetDeallocator(NAME, (psFreeFcn) psPlaneDistortFree); \118 psMemSetDeallocator(NAME, (psFreeFcn) psPlaneDistortFree); \ 119 119 NAME->x = psDPolynomial4DAlloc(2, 2, 2, 2, PS_POLYNOMIAL_ORD); \ 120 120 NAME->y = psDPolynomial4DAlloc(2, 2, 2, 2, PS_POLYNOMIAL_ORD); \ -
trunk/psLib/test/collections
- Property svn:ignore
-
old new 37 37 tst_psArray01 38 38 tst_psScalar 39 tst_psMetadata05_OUT 40 tst_psMetadata_01 41 tst_psMetadata_02 42 tst_psMetadata_03 43 tst_psMetadata_04 44 tst_psMetadata_05 45 tst_psMetadata_06 46 tst_psMetadata_07 47 tst_psMetadataIO 48 header_1.fits 49 header_2.fits 50 test.config
-
- Property svn:ignore
-
trunk/psLib/test/collections/.cvsignore
r3125 r3690 37 37 tst_psArray01 38 38 tst_psScalar 39 tst_psMetadata05_OUT 40 tst_psMetadata_01 41 tst_psMetadata_02 42 tst_psMetadata_03 43 tst_psMetadata_04 44 tst_psMetadata_05 45 tst_psMetadata_06 46 tst_psMetadata_07 47 tst_psMetadataIO 48 header_1.fits 49 header_2.fits 50 test.config -
trunk/psLib/test/collections/Makefile.am
r3684 r3690 1 1 #Makefile for collections functions of psLib 2 2 # 3 EXTRA_DIST = verified 3 EXTRA_DIST = verified \ 4 data/header_1.fits \ 5 data/header_2.fits \ 6 data/test.config 4 7 5 8 INCLUDES = \ … … 14 17 15 18 AM_LDFLAGS = -L$(top_builddir)/src -lpslib $(PSLIB_LIBS) 19 AM_CFLAGS = -DXML_CONFIG_FILE="\"$(top_srcdir)/etc/pslib/psTime.xml\"" 16 20 17 21 TESTS = \ … … 30 34 tst_psHash04 \ 31 35 tst_psHash05 \ 32 tst_psScalar 36 tst_psScalar \ 37 tst_psMetadataIO \ 38 tst_psMetadata_01 \ 39 tst_psMetadata_02 \ 40 tst_psMetadata_03 \ 41 tst_psMetadata_04 \ 42 tst_psMetadata_05 \ 43 tst_psMetadata_06 \ 44 tst_psMetadata_07 33 45 34 46 check_PROGRAMS =$(TESTS) 35 47 36 check_DATA = 48 check_DATA = test.config \ 49 header_1.fits \ 50 header_2.fits 51 37 52 38 53 TESTS_ENVIRONMENT = perl $(top_srcdir)/test/runTest -verified=$(srcdir)/verified … … 57 72 tst_psHash05_SOURCES = tst_psHash05.c 58 73 tst_psScalar_SOURCES = tst_psScalar.c 74 tst_psMetadataIO_SOURCES = tst_psMetadataIO.c 75 tst_psMetadata_01_SOURCES = tst_psMetadata_01.c 76 tst_psMetadata_02_SOURCES = tst_psMetadata_02.c 77 tst_psMetadata_03_SOURCES = tst_psMetadata_03.c 78 tst_psMetadata_04_SOURCES = tst_psMetadata_04.c 79 tst_psMetadata_05_SOURCES = tst_psMetadata_05.c 80 tst_psMetadata_06_SOURCES = tst_psMetadata_06.c 81 tst_psMetadata_07_SOURCES = tst_psMetadata_07.c 82 83 test.config: data/test.config 84 cp $? $@ 85 86 header_1.fits: data/header_1.fits 87 cp $? $@ 88 89 header_2.fits: data/header_2.fits 90 cp $? $@ 59 91 60 92 test: check -
trunk/psLib/test/collections/tst_psHash01.c
r3682 r3690 21 21 { 22 22 ID *id = psAlloc(sizeof(ID)); 23 p _psMemSetDeallocator(id,(psFreeFcn)IdFree);23 psMemSetDeallocator(id,(psFreeFcn)IdFree); 24 24 id->name = psStringCopy(name); 25 25 -
trunk/psLib/test/collections/tst_psHash02.c
r3682 r3690 24 24 { 25 25 ID *id = psAlloc(sizeof(ID)); 26 p _psMemSetDeallocator(id,(psFreeFcn)IdFree);26 psMemSetDeallocator(id,(psFreeFcn)IdFree); 27 27 id->name = psStringCopy(name); 28 28 -
trunk/psLib/test/collections/tst_psHash03.c
r3682 r3690 26 26 27 27 id = psAlloc(sizeof(ID)); 28 p _psMemSetDeallocator(id,(psFreeFcn)IdFree);28 psMemSetDeallocator(id,(psFreeFcn)IdFree); 29 29 30 30 id->name = psStringCopy(name); -
trunk/psLib/test/collections/tst_psHash04.c
r3682 r3690 19 19 { 20 20 ID *id = psAlloc(sizeof(ID)); 21 p _psMemSetDeallocator(id,(psFreeFcn)IdFree);21 psMemSetDeallocator(id,(psFreeFcn)IdFree); 22 22 23 23 id->name = psStringCopy(name); -
trunk/psLib/test/dataIO
- Property svn:ignore
-
old new 6 6 temp 7 7 tst_psLookupTable_01 8 tst_psDB 8 9 tst_psFits 9 10 multi.fits
-
- Property svn:ignore
-
trunk/psLib/test/dataIO/.cvsignore
r3443 r3690 6 6 temp 7 7 tst_psLookupTable_01 8 tst_psDB 8 9 tst_psFits 9 10 multi.fits -
trunk/psLib/test/dataIO/Makefile.am
r3684 r3690 2 2 # 3 3 EXTRA_DIST = verified 4 5 EXTRA_PROGRAMS = tst_psDB 4 6 5 7 INCLUDES = \ … … 18 20 TESTS = \ 19 21 tst_psLookupTable_01 \ 20 tst_psFits 22 tst_psFits \ 23 @TST_PSDB@ 21 24 22 25 check_PROGRAMS = $(TESTS) … … 32 35 tst_psLookupTable_01_SOURCES = tst_psLookupTable_01.c 33 36 tst_psFits_SOURCES = tst_psFits.c 37 tst_psDB_SOURCES = tst_psDB.c 34 38 35 39 %.dat: verified/%.dat -
trunk/psLib/test/fileUtils
- Property svn:ignore
-
old new 6 6 temp 7 7 tst_psLookupTable_01 8 tst_psDB 8 9 tst_psFits 9 10 multi.fits
-
- Property svn:ignore
-
trunk/psLib/test/fileUtils/.cvsignore
r3443 r3690 6 6 temp 7 7 tst_psLookupTable_01 8 tst_psDB 8 9 tst_psFits 9 10 multi.fits -
trunk/psLib/test/fileUtils/Makefile.am
r3684 r3690 2 2 # 3 3 EXTRA_DIST = verified 4 5 EXTRA_PROGRAMS = tst_psDB 4 6 5 7 INCLUDES = \ … … 18 20 TESTS = \ 19 21 tst_psLookupTable_01 \ 20 tst_psFits 22 tst_psFits \ 23 @TST_PSDB@ 21 24 22 25 check_PROGRAMS = $(TESTS) … … 32 35 tst_psLookupTable_01_SOURCES = tst_psLookupTable_01.c 33 36 tst_psFits_SOURCES = tst_psFits.c 37 tst_psDB_SOURCES = tst_psDB.c 34 38 35 39 %.dat: verified/%.dat -
trunk/psLib/test/runTest
r3682 r3690 26 26 # 27 27 # $Revison: $ $Name: not supported by cvs2svn $ 28 # $Date: 2005-04-0 7 20:27:41$28 # $Date: 2005-04-09 00:04:57 $ 29 29 # 30 30 # Copyright 2004 Maui High Performance Computering Center, University of Hawaii … … 43 43 "resetStdout!" => \$resetStdout, 44 44 "verified=s" => \$verifiedDir, 45 "help!" => \$help 45 "help!" => \$help, 46 "quiet!" => \$quiet, 47 "printpassfail!" => \$verbose 46 48 ); 47 49 48 50 if ($help || $#ARGV < 0) { 49 print 50 "Usage: runTest[--reset] [--resetStderr] [--resetStdout] testfile(s)\n\n";51 print "Usage: runTest [--help] [--verified=DIR] [--quiet] [--printpassfail] \\\n", 52 " [--reset] [--resetStderr] [--resetStdout] testfile(s)\n\n"; 51 53 exit(0); 52 54 } … … 75 77 # Check if a temp directory already exists in the current work directory 76 78 if ( !( -e "temp" ) ) { 77 78 79 # Create temp directory to store STDOUT, STDERR files during test run 79 80 `mkdir temp`; 80 81 # Display message of new directory created82 print("Creating temp directory\n");83 81 } 84 82 … … 87 85 88 86 # Display message that verified subdirectory doesn't exist 89 print (" Verified directory doesn't exist.\n");87 print STDERR " Verified directory doesn't exist.\n"; 90 88 91 89 # Exit script since the test cannot be run with verified files … … 95 93 # Check if the test driver file exists and is executable 96 94 if ( ( -e $testFile ) && ( -x $testFile ) ) { 97 98 # Display message the test driver is being executed99 print("--- Executing test driver: $testFile\n");100 95 101 96 # Invoke the test driver … … 112 107 # Display failure message with return value to user 113 108 if ( $? != 0 && ( $testFile !~ /^A/i ) ) { 114 print ("Failed - Test Driver returned $?, expected 0.\n");109 print STDERR "Failed - Test Driver returned $?, expected 0.\n"; 115 110 } 116 111 elsif ( $? == 0 && ( $testFile =~ /^A/i ) ) { 117 print ("Failed - Test Driver returned $?, expected abort.\n");112 print STDERR "Failed - Test Driver returned $?, expected abort.\n"; 118 113 } 119 114 $exitValue |= 64; … … 148 143 } 149 144 if (m/^---> TESTPOINT\s(\S+)/) { 150 print "\t$testfile- $1\n"; 145 print "\t$testfile- $1\n" if ($verbose || $1 eq "FAILED"); 146 if ($1 eq "FAILED") { 147 print $testoutput; 148 } 151 149 } 152 150 … … 184 182 s/v\d+.\d+.\d+/vX.X.X/g; 185 183 184 if (m/\*\*\*\*\*\* TESTPOINT \*\*\*\*\*\*/) { 185 $testoutput = $_; 186 } 187 $testoutput += $_; 188 186 189 if (m/ TestPoint:\s*([^\*]+)/) { 187 190 $testfile = $1; 188 191 } 189 192 if (m/^---> TESTPOINT\s(\S+)/) { 190 print "\t$testfile- $1\n"; 193 print "\t$testfile- $1\n" if ($verbose || $1 eq "FAILED"); 194 if ($1 eq "FAILED") { 195 print $testoutput; 196 } 191 197 } 192 198 … … 208 214 209 215 # Compare STDOUT capture with verified file 210 $exitValue |= &compareStream("$verifiedDir/$testFile.stdout");216 $exitValue = &compareStream("$verifiedDir/$testFile.stdout"); 211 217 212 218 # Check exit value to determine if verified file doesn't exist … … 233 239 # Since test driver doesn't exist or is not executable then display 234 240 # message to user. 235 print( 236 " Need to specify an executable test file within directory.\n" 237 ); 241 print STDERR "\tNeed to specify an executable test file.\n"; 238 242 239 243 # Exit value set to indicate test driver doesn't exist or not executable … … 246 250 # of a failed test 247 251 if ( ( $exitValue >> 3 ) != 0 ) { 248 print ("Test failed - return status = $exitValue\n\n");252 print STDERR "Test failed - return status = $exitValue\n\n"; 249 253 } 250 254 else { 251 print("Test successful\n\n");255 exit(0); 252 256 } 253 257 exit($exitValue); … … 287 291 || m/\|A\|/i ) 288 292 { 293 print STDERR "\tFailed - File $fileName contains error strings.\n"; 289 294 if ( $fileName =~ m/out/ ) { 290 print(291 " Failed - File $fileName contains error strings.\n"292 );293 295 $returnVal = 64; 294 296 } 295 297 elsif ( $fileName =~ m/err/ ) { 296 print(297 " Failed - File $fileName contains error strings.\n"298 );299 298 $returnVal = 128; 300 299 } … … 320 319 # 321 320 # Return: 0 - Compare successful 321 # 2 - STDOUT verified file doesn't exist 322 # 4 - STDERR verified file doesn't exist 322 323 # 8 - STDOUT verified file doesn't compare 323 324 # 16 - STDERR verified file doesn't compare … … 331 332 332 333 # Check for existence of verified STD stream files 333 if ( -e $streamFile ) { 334 if ( !( -e $streamFile ) ) { 335 336 # Set exit value bit 1 to indicate proper failure 337 if ( $streamFile =~ /out$/ ) { 338 $returnVal |= 2; 339 } 340 elsif ( $streamFile =~ /err$/ ) { 341 $returnVal |= 4; 342 } 343 } 344 else { 334 345 335 346 # Verified STD stream file exists … … 352 363 353 364 # Display message of the failure of difference to user 354 print (" Failed - STDOUT difference\n$diffstdout\n");365 print STDERR "\tFailed - STDOUT differences\n"; 355 366 356 367 # Exit value to indicate STDOUT did not compare … … 360 371 361 372 # Display message of the failure of difference to user 362 print (" Failed - STDERR difference\n$diffstdout\n");373 print STDERR "\tFailed - STDERR differences\n"; 363 374 364 375 # Exit value to indicate STDERR did not compare
Note:
See TracChangeset
for help on using the changeset viewer.
