diff options
author | Phil Sutter <phil@nwl.cc> | 2022-02-07 14:09:18 +0100 |
---|---|---|
committer | Phil Sutter <phil@nwl.cc> | 2022-02-08 11:00:29 +0100 |
commit | 6407868ff8fd6c94f696395e0a7f94973ee893b5 (patch) | |
tree | b727f95394e6f4de89003b081838fd321fab1c9d /tests/test_connlabel.c | |
parent | 41a7bb8f021b7eedfd0f8e40403375dde9db4f9c (diff) |
tests: Add simple tests to TESTS variable
This way, 'make check' and 'make distcheck' call them. Omit
ct_stress/ct_events_reliable, they require root.
For test_connlabel to find qa-connlabel.conf during 'make distcheck',
use of 'srcdir' env variable is needed. Add this as a third option to
not break existing use-cases.
Signed-off-by: Phil Sutter <phil@nwl.cc>
Diffstat (limited to 'tests/test_connlabel.c')
-rw-r--r-- | tests/test_connlabel.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/test_connlabel.c b/tests/test_connlabel.c index 99b1171..f6f222b 100644 --- a/tests/test_connlabel.c +++ b/tests/test_connlabel.c @@ -1,4 +1,5 @@ #include <assert.h> +#include <limits.h> #include <stdio.h> #include <stdlib.h> #include <time.h> @@ -60,6 +61,13 @@ int main(void) l = nfct_labelmap_new("qa-connlabel.conf"); if (!l) l = nfct_labelmap_new("tests/qa-connlabel.conf"); + if (!l) { + char testconf[PATH_MAX]; + + snprintf(testconf, PATH_MAX, + "%s/qa-connlabel.conf", getenv("srcdir")); + l = nfct_labelmap_new(testconf); + } assert(l); puts("qa-connlabel.conf:"); dump_map(l); |