1#!/bin/sh
2
3# check if generated files are up-to-date
4
5set -eu
6
7if [ -d library -a -d include -a -d tests ]; then :; else
8    echo "Must be run from mbed TLS root" >&2
9    exit 1
10fi
11
12check()
13{
14    FILE=$1
15    SCRIPT=$2
16
17    cp $FILE $FILE.bak
18    $SCRIPT
19    diff $FILE $FILE.bak
20    mv $FILE.bak $FILE
21}
22
23check library/error.c scripts/generate_errors.pl
24check library/version_features.c scripts/generate_features.pl
25