File: test_wrapper.in

package info (click to toggle)
netcdf-parallel 1%3A4.6.2-1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 101,668 kB
  • sloc: ansic: 200,241; sh: 10,807; yacc: 2,522; makefile: 1,306; lex: 1,153; xml: 173; awk: 2
file content (35 lines) | stat: -rw-r--r-- 930 bytes parent folder | download | duplicates (8)
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);
}