Ron Eldor | bf007d2 | 2016-12-15 14:42:37 +0200 | [diff] [blame] | 1 | #!/bin/sh |
Ron Eldor | d731eb8 | 2017-07-23 15:25:32 +0300 | [diff] [blame] | 2 | # pre-push.sh |
| 3 | # |
| 4 | # This file is part of mbed TLS (https://tls.mbed.org) |
| 5 | # |
| 6 | # Copyright (c) 2017, ARM Limited, All Rights Reserved |
| 7 | # |
| 8 | # Purpose |
| 9 | # |
Ron Eldor | bf007d2 | 2016-12-15 14:42:37 +0200 | [diff] [blame] | 10 | # Called by "git push" after it has checked the remote status, but before anything has been |
| 11 | # pushed. If this script exits with a non-zero status nothing will be pushed. |
Ron Eldor | d731eb8 | 2017-07-23 15:25:32 +0300 | [diff] [blame] | 12 | # This script can also be used independently, not using git. |
Ron Eldor | bf007d2 | 2016-12-15 14:42:37 +0200 | [diff] [blame] | 13 | # |
| 14 | # This hook is called with the following parameters: |
| 15 | # |
| 16 | # $1 -- Name of the remote to which the push is being done |
| 17 | # $2 -- URL to which the push is being done |
| 18 | # |
| 19 | # If pushing without using a named remote those arguments will be equal. |
| 20 | # |
| 21 | # Information about the commits which are being pushed is supplied as lines to |
| 22 | # the standard input in the form: |
| 23 | # |
| 24 | # <local ref> <local sha1> <remote ref> <remote sha1> |
| 25 | # |
Ron Eldor | bf007d2 | 2016-12-15 14:42:37 +0200 | [diff] [blame] | 26 | |
| 27 | REMOTE="$1" |
| 28 | URL="$2" |
| 29 | |
| 30 | echo "REMOTE is $REMOTE" |
| 31 | echo "URL is $URL" |
| 32 | |
Ron Eldor | d731eb8 | 2017-07-23 15:25:32 +0300 | [diff] [blame] | 33 | set -eu |
| 34 | |
Ron Eldor | bf007d2 | 2016-12-15 14:42:37 +0200 | [diff] [blame] | 35 | run_test() |
| 36 | { |
| 37 | TEST=$1 |
| 38 | echo "running '$TEST'" |
| 39 | if ! `$TEST > /dev/null 2>&1`; then |
| 40 | echo "test '$TEST' failed" |
| 41 | return 1 |
| 42 | fi |
| 43 | } |
| 44 | |
| 45 | run_test ./tests/scripts/check-doxy-blocks.pl |
| 46 | run_test ./tests/scripts/check-names.sh |
| 47 | run_test ./tests/scripts/check-generated-files.sh |
Darryl Green | 2699de3 | 2018-05-21 11:40:22 +0100 | [diff] [blame] | 48 | run_test ./tests/scripts/check-files.py |
Ron Eldor | b0ef434 | 2018-04-01 17:43:26 +0300 | [diff] [blame] | 49 | run_test ./tests/scripts/doxygen.sh |