version.c File Reference

Include dependency graph for ctests/version.c:

Go to the source code of this file.

Functions

int main (int argc, char **argv)

Variables

int TESTS_QUIET

Function Documentation

int main ( int  argc,
char **  argv 
)

Definition at line 8 of file ctests/version.c.

00009 {
00010     int retval, init_version, lib_version;
00011 
00012     tests_quiet( argc, argv );  /* Set TESTS_QUIET variable */
00013 
00014     init_version = PAPI_library_init( PAPI_VER_CURRENT );
00015     if ( init_version != PAPI_VER_CURRENT )
00016         test_fail( __FILE__, __LINE__, "PAPI_library_init", init_version );
00017 
00018     if ( ( lib_version =
00019            PAPI_get_opt( PAPI_LIB_VERSION, NULL ) ) == PAPI_EINVAL )
00020         test_fail( __FILE__, __LINE__, "PAPI_get_opt", PAPI_EINVAL );
00021 
00022     if ( !TESTS_QUIET ) {
00023         printf
00024             ( "Version.c: Compare and report versions from papi.h and the papi library.\n" );
00025         printf
00026             ( "-------------------------------------------------------------------------\n" );
00027         printf( "                    MAJOR  MINOR  REVISION\n" );
00028         printf
00029             ( "-------------------------------------------------------------------------\n" );
00030 
00031         printf( "PAPI_VER_CURRENT : %4d %6d %7d\n",
00032                 PAPI_VERSION_MAJOR( PAPI_VER_CURRENT ),
00033                 PAPI_VERSION_MINOR( PAPI_VER_CURRENT ),
00034                 PAPI_VERSION_REVISION( PAPI_VER_CURRENT ) );
00035         printf( "PAPI_library_init: %4d %6d %7d\n",
00036                 PAPI_VERSION_MAJOR( init_version ),
00037                 PAPI_VERSION_MINOR( init_version ),
00038                 PAPI_VERSION_REVISION( init_version ) );
00039         printf( "PAPI_VERSION     : %4d %6d %7d\n",
00040                 PAPI_VERSION_MAJOR( PAPI_VERSION ),
00041                 PAPI_VERSION_MINOR( PAPI_VERSION ),
00042                 PAPI_VERSION_REVISION( PAPI_VERSION ) );
00043         printf( "PAPI_get_opt     : %4d %6d %7d\n",
00044                 PAPI_VERSION_MAJOR( lib_version ),
00045                 PAPI_VERSION_MINOR( lib_version ),
00046                 PAPI_VERSION_REVISION( lib_version ) );
00047 
00048         printf
00049             ( "-------------------------------------------------------------------------\n" );
00050     }
00051 
00052     if ( lib_version != PAPI_VERSION )
00053         test_fail( __FILE__, __LINE__, "Version Mismatch", PAPI_EINVAL );
00054     test_pass( __FILE__, NULL, 0 );
00055     exit( 1 );
00056 }

Here is the call graph for this function:


Variable Documentation

Definition at line 11 of file test_utils.c.


Generated on 26 Jan 2016 for PAPI by  doxygen 1.6.1