source: BOL/script_install_amaury/test_compils.sh @ 4909

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

add test_compils.sh
modify orch 2.2 to correct fortran mistakes
fix orch2.0 rev
remove useless makeorchidee -clean call
remove orchidee bench for 2.2 since it's not yet compatible

  • Property svn:executable set to *
File size: 1.8 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"
17
18    logfile="test_logs/$args.out"
19    if [[ -f $logfile ]]; then return; fi
20    echo "Testing $args"
21    rm -rf LMDZ
22
23
24    # shellcheck disable=SC2086
25    if ! ./install_lmdz.sh -name LMDZ $args > "$logfile" 2>&1; then
26        # Check bench success if bench
27        if (grep -q "EXECUTION DU BENCH" < "$logfile") && (! grep -q "Everything is cool" < "$logfile"); then
28            echo "/!\\ Bench FAILED /!\\"
29        else
30            echo "/!\\ Install FAILED /!\\"
31        fi
32    fi
33}
34
35function run_all_tests {
36    for parallel in "none" "mpi_omp"; do
37    for rad in "oldrad" "rrtm"; do
38    for veget in "none" "orch2.0" "orch2.2"; do
39    for xios in "" "-xios"; do
40        if [[ $xios = "-xios" && $parallel = "none" ]]; then continue; fi
41        do_one_test
42    done
43    done
44    done
45    done
46}
47
48function display_results {
49    cd "test_logs"
50    echo "Success=o, Failure=XXX"
51    echo "INSTALL  BENCH  NAME"
52    for fname in *; do
53        if [[ $(tail -n 1 -- "$fname") = " Everything is cool" ]]; then
54            echo "   o       o    $fname"
55        else
56            if grep -q "EXECUTION DU BENCH" < "$fname"; then
57                echo "   o      XXX   $fname"
58            else
59                echo "  XXX           $fname"
60            fi
61        fi
62    done
63}
64
65skip_tests=""
66while (($# > 0)); do
67    case $1 in
68        "-s") skip_tests="y"; shift;;
69    esac
70done
71
72if [[ -z $skip_tests ]]; then run_all_tests; fi
73display_results
Note: See TracBrowser for help on using the repository browser.