summaryrefslogtreecommitdiff
path: root/0004-Makefile-Make-self-test-accessible-by-make-test.patch
blob: 84b5e579dd19bb55b55fe73c58f34e02d715d04b (plain)
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
36
37
38
39
40
41
42
43
44
45
46
47
48
From 22820938a43871b7cd634767809faec31d139f27 Mon Sep 17 00:00:00 2001
From: Phil Sutter <psutter@redhat.com>
Date: Fri, 25 Nov 2016 11:45:05 +0100
Subject: [PATCH] Makefile: Make self-test accessible by 'make test'

This will call 'test' three times: The first call makes sure that
KEEPALIVE=off is respected, the last two calls check that environment
variables KEEPCNT, KEEPIDLE and KEEPINTVL are applied as expected.

Signed-off-by: Phil Sutter <psutter@redhat.com>
---
 Makefile      | 3 +++
 test/Makefile | 6 ++++++
 2 files changed, 9 insertions(+)

diff --git a/Makefile b/Makefile
index 524d6a98c8329..01622771d73c5 100644
--- a/Makefile
+++ b/Makefile
@@ -13,6 +13,9 @@ default:
 	cp src/libkeepalive.so libkeepalive.so
 	strip -s libkeepalive.so
 
+test: default
+	make -C test/ runtest
+
 clean:
 	make -C src/ clean
 	make -C test/ clean
diff --git a/test/Makefile b/test/Makefile
index 2a0f6e2780d5e..6baf822c2338d 100644
--- a/test/Makefile
+++ b/test/Makefile
@@ -11,5 +11,11 @@ CC=gcc
 
 default: test
 
+TENV = LD_PRELOAD=../libkeepalive.so SELFTEST=on
+runtest:
+	${TENV} KEEPALIVE=off ./test
+	${TENV} KEEPCNT=13 KEEPIDLE=23 KEEPINTVL=42 ./test
+	${TENV} KEEPCNT=42 KEEPIDLE=13 KEEPINTVL=23 ./test
+
 clean:
 	rm -f test
-- 
2.10.0