PAPI  5.3.0.0
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
ctests/version.c
Go to the documentation of this file.
1 /* This file performs the following test: compare and report versions from papi.h and the papi library */
2 
3 #include "papi_test.h"
4 extern int TESTS_QUIET; /* Declared in test_utils.c */
5 
6 
7 int
8 main( int argc, char **argv )
9 {
10  int retval, init_version, lib_version;
11 
12  tests_quiet( argc, argv ); /* Set TESTS_QUIET variable */
13 
14  init_version = PAPI_library_init( PAPI_VER_CURRENT );
15  if ( init_version != PAPI_VER_CURRENT )
16  test_fail( __FILE__, __LINE__, "PAPI_library_init", init_version );
17 
18  if ( ( lib_version =
20  test_fail( __FILE__, __LINE__, "PAPI_get_opt", PAPI_EINVAL );
21 
22  if ( !TESTS_QUIET ) {
23  printf
24  ( "Version.c: Compare and report versions from papi.h and the papi library.\n" );
25  printf
26  ( "-------------------------------------------------------------------------\n" );
27  printf( " MAJOR MINOR REVISION\n" );
28  printf
29  ( "-------------------------------------------------------------------------\n" );
30 
31  printf( "PAPI_VER_CURRENT : %4d %6d %7d\n",
35  printf( "PAPI_library_init: %4d %6d %7d\n",
36  PAPI_VERSION_MAJOR( init_version ),
37  PAPI_VERSION_MINOR( init_version ),
38  PAPI_VERSION_REVISION( init_version ) );
39  printf( "PAPI_VERSION : %4d %6d %7d\n",
43  printf( "PAPI_get_opt : %4d %6d %7d\n",
44  PAPI_VERSION_MAJOR( lib_version ),
45  PAPI_VERSION_MINOR( lib_version ),
46  PAPI_VERSION_REVISION( lib_version ) );
47 
48  printf
49  ( "-------------------------------------------------------------------------\n" );
50  }
51 
52  if ( lib_version != PAPI_VERSION )
53  test_fail( __FILE__, __LINE__, "Version Mismatch", PAPI_EINVAL );
54  test_pass( __FILE__, NULL, 0 );
55  exit( 1 );
56 }
#define PAPI_VERSION
Definition: fpapi.h:15
tests_quiet(argc, argv)
return PAPI_EINVAL
Definition: linux-nvml.c:408
#define printf
Definition: papi_test.h:125
test_pass(__FILE__, NULL, 0)
int int argc
Definition: iozone.c:1609
int TESTS_QUIET
Definition: test_utils.c:11
char ** argv
Definition: iozone.c:1610
test_fail(__FILE__, __LINE__,"PAPI_library_init", retval)
int PAPI_library_init(int version)
Definition: papi.c:495
#define PAPI_VERSION_MAJOR(x)
Definition: papi.h:215
int PAPI_get_opt(int option, PAPI_option_t *ptr)
Definition: papi.c:4030
#define PAPI_VERSION_REVISION(x)
Definition: papi.h:217
#define PAPI_VER_CURRENT
Definition: fpapi.h:14
#define PAPI_VERSION_MINOR(x)
Definition: papi.h:216
ssize_t retval
Definition: libasync.c:338
int main(int argc, char **argv)
List all appio events codes and names.
void exit()
#define PAPI_LIB_VERSION
Definition: fpapi.h:64