Browse code
refine test run
Greg Wiley authored on 30/03/2017 22:51:42
Showing 2 changed files
Showing 2 changed files
... | ... |
@@ -13,17 +13,17 @@ $(MODULEOBJS): %.o: %.c |
13 | 13 |
|
14 | 14 |
.PHONY: clean |
15 | 15 |
clean: |
16 |
- rm -f *.o *.a |
|
17 |
- rm -f dual_control_test |
|
16 |
+ @rm -f *.o *.a |
|
17 |
+ @rm -f dual_control_test |
|
18 | 18 |
|
19 | 19 |
.PHONY: distclean |
20 | 20 |
distclean: clean |
21 |
- rm -f Makefile config.h |
|
21 |
+ @rm -f Makefile config.h |
|
22 | 22 |
|
23 | 23 |
dual_control_test: dual_control_test.c $(MODULEOBJS) |
24 | 24 |
$(CC) $(CFLAGS) $(CPPFLAGS) -o $@ $^ |
25 | 25 |
|
26 | 26 |
.PHONY: test |
27 | 27 |
test: dual_control_test |
28 |
- ./dual_control_test |
|
28 |
+ @./dual_control_test > /dev/null |
|
29 | 29 |
|
... | ... |
@@ -34,27 +34,24 @@ int pam_sm_setcred_returns_success() { |
34 | 34 |
int main(int argc, char* argv[]) { |
35 | 35 |
int test1_result = pam_sm_acct_mgmt_returns_successs(); |
36 | 36 |
if (!test1_result) { |
37 |
- printf("acct management failed\n"); |
|
37 |
+ fprintf(stderr, "acct management failed\n"); |
|
38 | 38 |
} |
39 | 39 |
|
40 | 40 |
int test2_result = pam_sm_authenticate_returns_success(); |
41 | 41 |
if (!test2_result) { |
42 |
- printf("acct auth failed\n"); |
|
42 |
+ fprintf(stderr, "acct auth failed\n"); |
|
43 | 43 |
} |
44 | 44 |
|
45 | 45 |
int test3_result = pam_sm_setcred_returns_success(); |
46 | 46 |
if (!test3_result) { |
47 |
- printf("set cred failed\n"); |
|
47 |
+ fprintf(stderr, "set cred failed\n"); |
|
48 | 48 |
} |
49 | 49 |
|
50 | 50 |
|
51 | 51 |
if (test1_result && test2_result && test3_result) { |
52 |
- printf("success!\n"); |
|
53 | 52 |
return 0; |
54 | 53 |
} else { |
55 |
- printf("fail\n"); |
|
56 | 54 |
return 1; |
57 | 55 |
} |
58 | 56 |
} |
59 | 57 |
|
60 |
- |