|
PAPI
5.0.1.0
|
00001 /* 00002 * File: exec.c 00003 * CVS: $Id$ 00004 * Author: Philip Mucci 00005 * mucci@cs.utk.edu 00006 * Mods: <your name here> 00007 * <your email address> 00008 */ 00009 00010 /* This file performs the following test: start, stop and timer 00011 functionality for a parent and a forked child. */ 00012 00013 #include "papi_test.h" 00014 #include <sys/wait.h> 00015 00016 int 00017 main( int argc, char **argv ) 00018 { 00019 int retval; 00020 00021 tests_quiet( argc, argv ); /* Set TESTS_QUIET variable */ 00022 00023 if ( ( argc > 1 ) && ( strcmp( argv[1], "xxx" ) == 0 ) ) { 00024 retval = PAPI_library_init( PAPI_VER_CURRENT ); 00025 if ( retval != PAPI_VER_CURRENT ) 00026 test_fail( __FILE__, __LINE__, "execed PAPI_library_init", retval ); 00027 } else { 00028 retval = PAPI_library_init( PAPI_VER_CURRENT ); 00029 if ( retval != PAPI_VER_CURRENT ) 00030 test_fail( __FILE__, __LINE__, "main PAPI_library_init", retval ); 00031 00032 if ( execlp( argv[0], argv[0], "xxx", NULL ) == -1 ) 00033 test_fail( __FILE__, __LINE__, "execlp", PAPI_ESYS ); 00034 } 00035 00036 test_pass( __FILE__, NULL, 0 ); 00037 exit( 1 ); 00038 }