blob: bc8b6f6ffa6319b595e722e5849debeabad84e33 [file] [log] [blame]
Manuel Pégourié-Gonnarde137ea62015-04-09 10:47:44 +02001#!/bin/sh
2
3set -eu
4
5tests/scripts/list-macros.sh
6tests/scripts/list-enum-consts.pl
7tests/scripts/list-identifiers.sh
8tests/scripts/list-symbols.sh
9
10FAIL=0
11
12printf "Exported symbols declared in header: "
13UNDECLARED=$( diff exported-symbols identifiers | sed -n -e 's/^< //p' )
14if [ "x$UNDECLARED" == "x" ]; then
15 echo "PASS"
16else
17 echo "FAIL"
18 echo "$UNDECLARED"
19 FAIL=1
20fi
21
22diff macros identifiers | sed -n -e 's/< //p' > actual-macros
23
24for THING in actual-macros enum-consts; do
25 printf "Names of $THING: "
26 test -r $THING
27 BAD=$( grep -v '^MBEDTLS_[0-9A-Z_]*[0-9A-Z]$' $THING || true )
28 if [ "x$BAD" = "x" ]; then
29 echo "PASS"
30 else
31 echo "FAIL"
32 echo "$BAD"
33 FAIL=1
34 fi
35done
36
37for THING in identifiers; do
38 printf "Names of $THING: "
39 test -r $THING
40 BAD=$( grep -v '^mbedtls_[0-9a-z_]*[0-9a-z]$' $THING || true )
41 if [ "x$BAD" = "x" ]; then
42 echo "PASS"
43 else
44 echo "FAIL"
45 echo "$BAD"
46 FAIL=1
47 fi
48done
49
50if [ "$FAIL" -eq 0 ]; then
51 rm macros actual-macros enum-consts identifiers exported-symbols
52 echo "PASSED"
53 exit 0
54else
55 echo "FAILED"
56 exit 1
57fi