build-sys: fix some important 'tests.h' related issues

Exploiting a header file shouldn't also force users to
code their own '#include <stdio.h>'. More importantly,
unless this header is mentioned in dist_noinst_HEADERS
we'd fail 'make distcheck' with the error shown below.

[ the same error will apply to all 'noinst_PROGRAMS' ]
[ that happen to use this header. but please, do not ]
[ ask me to explain exactly why or how my fix works! ]

Reference(s):
../../proc/test_pids.c:24:10: fatal error: tests.h: No such file or directory
   24 | #include "tests.h"
      |          ^~~~~~~~~

Signed-off-by: Jim Warner <james.warner@comcast.net>
This commit is contained in:
Jim Warner 2020-08-15 11:11:11 -05:00 committed by Craig Small
parent ebb57668a1
commit 2c89119668
2 changed files with 3 additions and 0 deletions

View File

@ -6,4 +6,5 @@ dist_noinst_HEADERS = \
rpmatch.h \ rpmatch.h \
signals.h \ signals.h \
strutils.h \ strutils.h \
tests.h \
xalloc.h xalloc.h

View File

@ -2,6 +2,8 @@
#ifndef PROCPS_NG_TESTS_H #ifndef PROCPS_NG_TESTS_H
#define PROCPS_NG_TESTS_H #define PROCPS_NG_TESTS_H
#include <stdio.h>
typedef int (*TestFunction)(void *data); typedef int (*TestFunction)(void *data);
char *testname; char *testname;