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 | # |
Ron Eldor | d731eb8 | 2017-07-23 15:25:32 +0300 | [diff] [blame] | 4 | # Copyright (c) 2017, ARM Limited, All Rights Reserved |
Bence Szépkúti | 51b41d5 | 2020-05-26 01:54:15 +0200 | [diff] [blame^] | 5 | # SPDX-License-Identifier: Apache-2.0 |
| 6 | # |
| 7 | # Licensed under the Apache License, Version 2.0 (the "License"); you may |
| 8 | # not use this file except in compliance with the License. |
| 9 | # You may obtain a copy of the License at |
| 10 | # |
| 11 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 12 | # |
| 13 | # Unless required by applicable law or agreed to in writing, software |
| 14 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT |
| 15 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 16 | # See the License for the specific language governing permissions and |
| 17 | # limitations under the License. |
| 18 | # |
| 19 | # This file is part of Mbed TLS (https://tls.mbed.org) |
Ron Eldor | d731eb8 | 2017-07-23 15:25:32 +0300 | [diff] [blame] | 20 | # |
| 21 | # Purpose |
| 22 | # |
Ron Eldor | bf007d2 | 2016-12-15 14:42:37 +0200 | [diff] [blame] | 23 | # Called by "git push" after it has checked the remote status, but before anything has been |
| 24 | # 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] | 25 | # This script can also be used independently, not using git. |
Ron Eldor | bf007d2 | 2016-12-15 14:42:37 +0200 | [diff] [blame] | 26 | # |
| 27 | # This hook is called with the following parameters: |
| 28 | # |
| 29 | # $1 -- Name of the remote to which the push is being done |
| 30 | # $2 -- URL to which the push is being done |
| 31 | # |
| 32 | # If pushing without using a named remote those arguments will be equal. |
| 33 | # |
| 34 | # Information about the commits which are being pushed is supplied as lines to |
| 35 | # the standard input in the form: |
| 36 | # |
| 37 | # <local ref> <local sha1> <remote ref> <remote sha1> |
| 38 | # |
Ron Eldor | bf007d2 | 2016-12-15 14:42:37 +0200 | [diff] [blame] | 39 | |
| 40 | REMOTE="$1" |
| 41 | URL="$2" |
| 42 | |
| 43 | echo "REMOTE is $REMOTE" |
| 44 | echo "URL is $URL" |
| 45 | |
Ron Eldor | d731eb8 | 2017-07-23 15:25:32 +0300 | [diff] [blame] | 46 | set -eu |
| 47 | |
Ron Eldor | bf007d2 | 2016-12-15 14:42:37 +0200 | [diff] [blame] | 48 | run_test() |
| 49 | { |
| 50 | TEST=$1 |
| 51 | echo "running '$TEST'" |
| 52 | if ! `$TEST > /dev/null 2>&1`; then |
| 53 | echo "test '$TEST' failed" |
| 54 | return 1 |
| 55 | fi |
| 56 | } |
| 57 | |
| 58 | run_test ./tests/scripts/check-doxy-blocks.pl |
| 59 | run_test ./tests/scripts/check-names.sh |
| 60 | run_test ./tests/scripts/check-generated-files.sh |
Darryl Green | 2699de3 | 2018-05-21 11:40:22 +0100 | [diff] [blame] | 61 | run_test ./tests/scripts/check-files.py |
Ron Eldor | b0ef434 | 2018-04-01 17:43:26 +0300 | [diff] [blame] | 62 | run_test ./tests/scripts/doxygen.sh |