source: BOL/script_install_amaury/test_compils.sh @ 4917

Last change on this file since 4917 was 4917, checked in by abarral, 4 weeks ago

load env from fcm
detect non-critical failures in bench

  • 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"
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"; 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        do_one_test
46    done
47    done
48    done
49    done
50    done
51}
52
53function display_results {
54    cd "test_logs"
55    echo "Success=o, Failure=XXX, non-breaking error=/!\\"
56    echo "INSTALL  BENCH  NAME"
57    for fname in *; do
58        if [[ $(tail -n 1 -- "$fname") = " Everything is cool" ]]; then
59            if grep -q "Error" < "$fname"; then
60                    echo "   o      /!\\   $fname"
61                else
62                    echo "   o       o    $fname"
63                fi
64        else
65            if grep -q "EXECUTION DU BENCH" < "$fname"; then
66                echo "   o      XXX   $fname"
67            else
68                echo "  XXX           $fname"
69            fi
70        fi
71    done
72}
73
74skip_tests=""
75while (($# > 0)); do
76    case $1 in
77        "-s") skip_tests="y"; shift;;
78    esac
79done
80
81if [[ -z $skip_tests ]]; then run_all_tests; fi
82display_results
Note: See TracBrowser for help on using the repository browser.