PAPI  5.4.0.0
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
exec.c
Go to the documentation of this file.
1 /*
2 * File: exec.c
3 * CVS: $Id$
4 * Author: Philip Mucci
5 * mucci@cs.utk.edu
6 * Mods: <your name here>
7 * <your email address>
8 */
9 
10 /* This file performs the following test: start, stop and timer
11 functionality for a parent and a forked child. */
12 
13 #include "papi_test.h"
14 #include <sys/wait.h>
15 
16 int
17 main( int argc, char **argv )
18 {
19  int retval;
20 
21  tests_quiet( argc, argv ); /* Set TESTS_QUIET variable */
22 
23  if ( ( argc > 1 ) && ( strcmp( argv[1], "xxx" ) == 0 ) ) {
25  if ( retval != PAPI_VER_CURRENT )
26  test_fail( __FILE__, __LINE__, "execed PAPI_library_init", retval );
27  } else {
29  if ( retval != PAPI_VER_CURRENT )
30  test_fail( __FILE__, __LINE__, "main PAPI_library_init", retval );
31 
32  PAPI_shutdown( );
33 
34  if ( execlp( argv[0], argv[0], "xxx", NULL ) == -1 )
35  test_fail( __FILE__, __LINE__, "execlp", PAPI_ESYS );
36  }
37 
38  test_pass( __FILE__, NULL, 0 );
39  exit( 1 );
40 }
tests_quiet(argc, argv)
test_pass(__FILE__, NULL, 0)
int int argc
Definition: iozone.c:1609
char ** argv
Definition: iozone.c:1610
test_fail(__FILE__, __LINE__,"PAPI_library_init", retval)
int PAPI_library_init(int version)
Definition: papi.c:497
void PAPI_shutdown(void)
Definition: papi.c:4400
#define PAPI_ESYS
Definition: papi.h:253
ssize_t retval
Definition: libasync.c:338
#define PAPI_VER_CURRENT
Definition: papi.h:223
int main(int argc, char **argv)
List all appio events codes and names.
void exit()