source: BOL/script_install_amaury/test_compils.sh @ 4997

Last change on this file since 4997 was 4929, checked in by abarral, 7 months ago

fix adastra env names
add cosp & ecrad to tests
cleanup install
fix bench for adastra

  • Property svn:executable set to *
File size: 2.3 KB
Line 
1#!/bin/bash
2# Test LMDZ compilation in various situations
3
4set -eu
5
6mkdir -p test_logs
7
8function do_one_test {
9    # Perform one test, if the log file doesn't already exist
10
11    # Create test args
12    args="-arch_dir arch_local -arch local-gfortran"
13    if [[ ! $parallel = "none" ]]; then
14        args="$args-parallel"
15    fi
16    args="$args -rad $rad -parallel $parallel -netcdf 0 -veget $veget $xios $lmdzrev $cosp"
17    # trim
18    args=$(echo "$args" | xargs)
19
20    logfile="test_logs/$args.out"
21    if [[ -f $logfile ]]; then return; fi
22    echo "Testing $args"
23    rm -rf LMDZ
24
25
26    # shellcheck disable=SC2086
27    if ! ./install_lmdz.sh -name LMDZ $args > "$logfile" 2>&1; then
28        # Check bench success if bench
29        if (grep -q "EXECUTION DU BENCH" < "$logfile") && (! grep -q "Everything is cool" < "$logfile"); then
30            echo "/!\\ Bench FAILED /!\\"
31        else
32            echo "/!\\ Install FAILED /!\\"
33        fi
34    fi
35}
36
37function run_all_tests {
38    for parallel in "none" "mpi_omp"; do
39    for rad in "oldrad" "rrtm" "ecrad"; do
40    for veget in "none" "orch2.0" "orch2.2"; do
41    for xios in "" "-xios"; do
42      if [[ $xios = "-xios" && $parallel = "none" ]]; then continue; fi
43    for lmdzrev in "" "-r 4894"; do  # TODO when base lmdz becomes >=4894, change condition for lmdzrev=""
44        if [[ (! $veget = "none") && ($parallel = "none") && ($(echo "$lmdzrev" | cut -c 4-) -lt 4894) ]]; then continue; fi
45    for cosp in "" "-cosp v1" "-cosp v2"; do
46        do_one_test
47    done
48    done
49    done
50    done
51    done
52    done
53}
54
55function display_results {
56    cd "test_logs"
57    echo "Success=o, Failure=XXX, non-breaking error=/!\\"
58    echo "INSTALL  BENCH  NAME"
59    for fname in *; do
60        if [[ $(tail -n 1 -- "$fname") = " Everything is cool" ]]; then
61            if grep -q "Error" < "$fname"; then
62                    echo "   o      /!\\   $fname"
63                else
64                    echo "   o       o    $fname"
65                fi
66        else
67            if grep -q "EXECUTION DU BENCH" < "$fname"; then
68                echo "   o      XXX   $fname"
69            else
70                echo "  XXX           $fname"
71            fi
72        fi
73    done
74}
75
76skip_tests=""
77while (($# > 0)); do
78    case $1 in
79        "-s") skip_tests="y"; shift;;
80    esac
81done
82
83if [[ -z $skip_tests ]]; then run_all_tests; fi
84display_results
Note: See TracBrowser for help on using the repository browser.