forked from Unidata/netcdf-c
-
Notifications
You must be signed in to change notification settings - Fork 0
/
test_wrapper.in
35 lines (30 loc) · 930 Bytes
/
test_wrapper.in
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <sys/types.h>
#include <sys/wait.h>
/*
This is a round-about way of getting the output from
a shell script test. Apparently, LOG_DRIVER
only works for executables and not for shell scripts.
So, use this executable to indirectly invoke a shell script
test so that its output appears in e.g. travis log.
If I could figure out the shell equivalent of LOG_DRIVER,
then this would not be necessary.
*/
#define CMD "./tst_filter.sh"
#define TOPSRCDIR "@abs_top_srcdir@"
#define TOPBUILDDIR "@abs_top_builddir@"
int
main(int argc, char** argv)
{
int stat;
char path[4096];
fprintf(stderr,"test_wrapper: TOPSRCDIR=%s TOPBUILDDIR=%s\n",TOPSRCDIR,TOPBUILDDIR);
strcpy(path,TOPSRCDIR);
strcat(path,"/nc_test4/");
strcat(path,CMD);
fprintf(stderr,"test_wrapper: path=%s\n",path);
stat = system(path);
return WEXITSTATUS(stat);
}