f5f86bf74f5fdebba224775614f405366a5e44c5
[jansson.git] / test / suites / api / check-exports
1 #!/bin/sh
2
3 # This test checks that libjansson.so exports the correct symbols.
4
5 # The list of symbols that the shared object should export
6 sort >$test_log/exports <<EOF
7 json_delete
8 json_true
9 json_false
10 json_null
11 json_string
12 json_string_nocheck
13 json_string_value
14 json_string_set
15 json_string_set_nocheck
16 json_integer
17 json_integer_value
18 json_integer_set
19 json_real
20 json_real_value
21 json_real_set
22 json_number_value
23 json_array
24 json_array_size
25 json_array_get
26 json_array_set_new
27 json_array_append_new
28 json_array_insert_new
29 json_array_remove
30 json_array_clear
31 json_array_extend
32 json_object
33 json_object_size
34 json_object_get
35 json_object_set_new
36 json_object_set_new_nocheck
37 json_object_del
38 json_object_clear
39 json_object_update
40 json_object_update_existing
41 json_object_update_missing
42 json_object_iter
43 json_object_iter_at
44 json_object_iter_next
45 json_object_iter_key
46 json_object_iter_value
47 json_object_iter_set_new
48 json_object_key_to_iter
49 json_dumps
50 json_dumpf
51 json_dump_file
52 json_dump_callback
53 json_loads
54 json_loadb
55 json_loadf
56 json_load_file
57 json_load_callback
58 json_equal
59 json_copy
60 json_deep_copy
61 json_pack
62 json_pack_ex
63 json_vpack_ex
64 json_unpack
65 json_unpack_ex
66 json_vunpack_ex
67 json_set_alloc_funcs
68 EOF
69
70 # The list of functions are not exported in the library because they
71 # are macros or static inline functions. This is only the make the
72 # list complete, there are not used by the test.
73 sort >$test_log/macros_or_inline <<EOF
74 json_typeof
75 json_incref
76 json_decref
77 json_is_object
78 json_is_object
79 json_is_array
80 json_is_string
81 json_is_integer
82 json_is_real
83 json_is_true
84 json_is_false
85 json_is_null
86 json_is_number
87 json_is_boolean
88 json_array_set
89 json_array_append
90 json_array_insert
91 json_object_set
92 json_object_set_nocheck
93 EOF
94
95 SOFILE="../src/.libs/libjansson.so"
96
97 nm -D $SOFILE >/dev/null >$test_log/symbols 2>/dev/null \
98     || exit 77  # Skip if "nm -D" doesn't seem to work
99
100 grep ' T ' $test_log/symbols | cut -d' ' -f3 | sort >$test_log/output
101
102 if ! cmp -s $test_log/exports $test_log/output; then
103     diff -u $test_log/exports $test_log/output >&2
104     exit 1
105 fi