New test script for generated files
This commit is contained in:
parent
f5dc8ec358
commit
b3b8e43a12
2 changed files with 27 additions and 0 deletions
|
@ -73,6 +73,9 @@ msg()
|
|||
msg "test: recursion.pl" # < 1s
|
||||
scripts/recursion.pl library/*.c
|
||||
|
||||
msg "test: freshness of generated source files" # < 1s
|
||||
tests/scripts/check-generated-files.sh
|
||||
|
||||
msg "build: cmake, gcc, ASan" # ~ 1 min 50s
|
||||
cleanup
|
||||
CC=gcc cmake -D CMAKE_BUILD_TYPE:String=Asan .
|
||||
|
|
24
tests/scripts/check-generated-files.sh
Executable file
24
tests/scripts/check-generated-files.sh
Executable file
|
@ -0,0 +1,24 @@
|
|||
#!/bin/sh
|
||||
|
||||
# check if generated files are up-to-date
|
||||
|
||||
set -eu
|
||||
|
||||
if [ -d library -a -d include -a -d tests ]; then :; else
|
||||
echo "Must be run from mbed TLS root" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
check()
|
||||
{
|
||||
FILE=$1
|
||||
SCRIPT=$2
|
||||
|
||||
cp $FILE $FILE.bak
|
||||
$SCRIPT
|
||||
diff $FILE $FILE.bak
|
||||
mv $FILE.bak $FILE
|
||||
}
|
||||
|
||||
check library/error.c scripts/generate_errors.pl
|
||||
check library/version_features.c scripts/generate_features.pl
|
Loading…
Reference in a new issue