PAPI  5.6.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 * Author: Philip Mucci
4 * mucci@cs.utk.edu
5 * Mods: <your name here>
6 * <your email address>
7 */
8 
9 /* This file performs the following test: start, stop and timer
10 functionality for a parent and a forked child. */
11 
12 #include <stdio.h>
13 #include <stdlib.h>
14 #include <string.h>
15 #include <unistd.h>
16 #include <sys/wait.h>
17 
18 #include "papi.h"
19 #include "papi_test.h"
20 
21 int
22 main( int argc, char **argv )
23 {
24  int retval;
25 
26  tests_quiet( argc, argv ); /* Set TESTS_QUIET variable */
27 
28  if ( ( argc > 1 ) && ( strcmp( argv[1], "xxx" ) == 0 ) ) {
30  if ( retval != PAPI_VER_CURRENT )
31  test_fail( __FILE__, __LINE__, "execed PAPI_library_init", retval );
32  } else {
34  if ( retval != PAPI_VER_CURRENT )
35  test_fail( __FILE__, __LINE__, "main PAPI_library_init", retval );
36 
37  PAPI_shutdown( );
38 
39  if ( execlp( argv[0], argv[0], "xxx", NULL ) == -1 )
40  test_fail( __FILE__, __LINE__, "execlp", PAPI_ESYS );
41  }
42 
43  test_pass( __FILE__ );
44 
45  return 0;
46 
47 }
void test_pass(const char *filename)
Definition: test_utils.c:432
int int argc
Definition: iozone.c:1609
Return codes and api definitions.
char ** argv
Definition: iozone.c:1610
int PAPI_library_init(int version)
Definition: papi.c:500
void PAPI_shutdown(void)
Definition: papi.c:4461
#define PAPI_ESYS
Definition: papi.h:255
int tests_quiet(int argc, char **argv)
Definition: test_utils.c:376
void test_fail(const char *file, int line, const char *call, int retval)
Definition: test_utils.c:468
ssize_t retval
Definition: libasync.c:338
#define PAPI_VER_CURRENT
Definition: papi.h:225
int main(int argc, char **argv)
List all appio events codes and names.