[53d3b2a] | 1 | #!/bin/bash |
---|
| 2 | # |
---|
| 3 | # @Author: Anne Philipp |
---|
| 4 | # |
---|
| 5 | # @Date: November, 20 2019 |
---|
| 6 | # |
---|
| 7 | # @Description: Starts the comparison script for all cases found in the new |
---|
| 8 | # version directory. Results are written to a log file placed |
---|
| 9 | # in the Log directory. |
---|
| 10 | # |
---|
| 11 | # @Call command: ./run_cmp_test.sh <reference version> <new version> |
---|
| 12 | # |
---|
| 13 | # @ChangeHistory: |
---|
| 14 | # |
---|
| 15 | # @Licence: |
---|
| 16 | # (C) Copyright 2014-2019. |
---|
| 17 | # |
---|
| 18 | # SPDX-License-Identifier: CC-BY-4.0 |
---|
| 19 | # |
---|
| 20 | # This work is licensed under the Creative Commons Attribution 4.0 |
---|
| 21 | # International License. To view a copy of this license, visit |
---|
| 22 | # http://creativecommons.org/licenses/by/4.0/ or send a letter to |
---|
| 23 | # Creative Commons, PO Box 1866, Mountain View, CA 94042, USA. |
---|
| 24 | # |
---|
| 25 | # @Example: |
---|
| 26 | # ./run_cmp_test.sh 7.0.4 7.1 |
---|
| 27 | # |
---|
| 28 | |
---|
| 29 | if [ $# -eq 0 ]; then |
---|
| 30 | echo "No arguments passed" |
---|
| 31 | exit |
---|
| 32 | fi |
---|
| 33 | |
---|
| 34 | if [ $# -eq 1 ]; then |
---|
| 35 | echo "Second argument is missing" |
---|
| 36 | exit |
---|
| 37 | fi |
---|
| 38 | |
---|
| 39 | old_version=$1 |
---|
| 40 | new_version=$2 |
---|
| 41 | |
---|
| 42 | current_time=$(date "+%Y-%m-%d_%H-%M-%S") |
---|
| 43 | testcases=`ls ${new_version}/` |
---|
| 44 | |
---|
| 45 | echo 'Test to compare GRIB files between two versions' |
---|
| 46 | echo 'Compare GRIB files between version ' + old_version + ' and version ' + new_version + ' : \n' > Log/log_$current_time |
---|
| 47 | |
---|
| 48 | for case in $testcases; do |
---|
| 49 | |
---|
| 50 | if [[ "$case" == "Controls" ]]; then |
---|
| 51 | continue |
---|
| 52 | fi |
---|
| 53 | echo "Compare $case ..." |
---|
| 54 | python test_cmp_grib_file.py -r 7.0.4/${case}/ -n 7.1/${case}/ -p '*' >> Log/log_$current_time 2>&1 |
---|
| 55 | |
---|
| 56 | echo "===================================================================================================" >> Log/log_$current_time |
---|
| 57 | |
---|
| 58 | done |
---|
| 59 | |
---|