Enable cirrus continous integration task for freebsd
[elfdbg/.git] / tests / elfdbg_test.sh
CommitLineData
e65a04f5
SB
1#! /usr/bin/env atf-sh
2
3. $(atf_get_srcdir)/test_helper.sh
4
5atf_test_case stripped
6
7stripped_head()
8{
9 atf_set "descr" "ELF binary test without debug symbols"
10
11}
12
13stripped_body()
14{
15 generate_bin_nodbg
16
17 out=$(elfdbg bin)
18 expected="NO DEBUG"
19 if [ "$out" == "$expected" ]; then
20 atf_pass
21 else
6b322eb0 22 atf_fail "Wrong output w/o debug symbols '$out'"
e65a04f5
SB
23 fi
24}
25
26stripped_cleanup()
27{
28 rm -rf bin bin.c
29}
30
31atf_test_case not_stripped
32
33not_stripped_head()
34{
35 atf_set "descr" "ELF binary test with debug symbols"
36}
37not_stripped_body()
38{
39 generate_bin_dbg
40
41 out=$(elfdbg bin)
42 expected="HAS DEBUG"
43 if [ "$out" == "$expected" ]; then
44 atf_pass
45 else
6b322eb0 46 atf_fail "Wrong output w/ debug symbols '$out'"
e65a04f5
SB
47 fi
48}
49
50not_stripped_cleanup()
51{
52 rm -rf bin bin.c
53}
54
55atf_init_test_cases()
56{
57 atf_add_test_case stripped
58 atf_add_test_case not_stripped
59}