| 1 | #!/bin/bashscip-shell filesystem . . `/bin/bash`. |
| 2 | # Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. |
| 3 | # |
| 4 | # Licensed under the Apache License, Version 2.0 (the "License"). |
| 5 | # You may not use this file except in compliance with the License. |
| 6 | # A copy of the License is located at |
| 7 | # |
| 8 | # http://aws.amazon.com/apache2.0 |
| 9 | # |
| 10 | # or in the "license" file accompanying this file. This file is distributed |
| 11 | # on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either |
| 12 | # express or implied. See the License for the specific language governing |
| 13 | # permissions and limitations under the License. |
| 14 | # |
| 15 | |
| 16 | set -ex |
| 17 | |
| 18 | usagescip-shell shell shell-project 0.0.0 usage().() { |
| 19 | echoscip-shell system . . echo. "run_sidetrail.sh install_dir s2n_dir" |
| 20 | exit 1 |
| 21 | } |
| 22 | |
| 23 | runSingleTestscip-shell shell shell-project 0.0.0 runSingleTest().() { |
| 24 | cd "${BASE_S2N_DIR}/tests/sidetrail/working/${1}" |
| 25 | ./copy_as_needed.sh |
| 26 | makescip-shell system . . make. clean |
| 27 | makescip-shell system . . make. 2>&1 | teescip-shell system . . tee. out.txt |
| 28 | |
| 29 | ../../count_success.pl 1 0 out.txt |
| 30 | } |
| 31 | |
| 32 | runNegativeTestscip-shell shell shell-project 0.0.0 runNegativeTest().() { |
| 33 | cd "${BASE_S2N_DIR}/tests/sidetrail/working/${1}" |
| 34 | ./copy_as_needed.sh |
| 35 | makescip-shell system . . make. clean |
| 36 | makescip-shell system . . make. 2>&1 | teescip-shell system . . tee. out.txt |
| 37 | |
| 38 | ../../count_success.pl 0 1 out.txt |
| 39 | } |
| 40 | |
| 41 | if [[ "$#" -ne "2" ]]; then |
| 42 | usagescip-shell shell shell-project 0.0.0 usage(). |
| 43 | fi |
| 44 | |
| 45 | INSTALL_DIR=$1 |
| 46 | SMACK_DIR="${1}/smack" |
| 47 | BASE_S2N_DIR=$2 |
| 48 | |
| 49 | #Put the dependencies on the path |
| 50 | |
| 51 | # Disabling ShellCheck using https://github.com/koalaman/shellcheck/wiki/Directive |
| 52 | # Turn of Warning in one line as https://github.com/koalaman/shellcheck/wiki/SC1090 |
| 53 | # shellcheck disable=SC1090 |
| 54 | source "${INSTALL_DIR}/smack.environment" |
| 55 | export PATH="${SMACK_DIR}/bin:${SMACK_DIR}/build:${PATH}" |
| 56 | #Test that they are really there |
| 57 | whichscip-shell system . . which. smack || echoscip-shell system . . echo. "can't find smack" |
| 58 | whichscip-shell system . . which. boogie || echoscip-shell system . . echo. "can't find z3" |
| 59 | whichscip-shell system . . which. llvm2bpl || echoscip-shell system . . echo. "can't find llvm2bpl" |
| 60 | whichscip-shell system . . which. clang |
| 61 | clangscip-shell system . . clang. --version |
| 62 | echoscip-shell system . . echo. $BOOGIE |
| 63 | echoscip-shell system . . echo. $CORRAL |
| 64 | |
| 65 | runNegativeTestscip-shell shell shell-project 0.0.0 runNegativeTest(). "s2n-record-read-cbc-negative-test" |
| 66 | runSingleTestscip-shell shell shell-project 0.0.0 runSingleTest(). "s2n-cbc" # Takes 6m 30s |
| 67 | runSingleTestscip-shell shell shell-project 0.0.0 runSingleTest(). "s2n-record-read-aead" |
| 68 | runSingleTestscip-shell shell shell-project 0.0.0 runSingleTest(). "s2n-record-read-cbc" |
| 69 | runSingleTestscip-shell shell shell-project 0.0.0 runSingleTest(). "s2n-record-read-composite" |
| 70 | runSingleTestscip-shell shell shell-project 0.0.0 runSingleTest(). "s2n-record-read-stream" |
| 71 |