test27cellsStars.sh.in 2.19 KB
Newer Older
Loic Hausammann's avatar
Loic Hausammann committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85
#!/bin/bash

# List each test that should be run
declare -a TEST_LIST=(test27cellsStars test27cellsStars_subset)

# Run same test for each executable
for TEST in "${TEST_LIST[@]}"
do
  # Test for particles with the same smoothing length
    echo ""
    
    rm -f star_brute_force_27_standard.dat swift_star_dopair_27_standard.dat

    echo "Running ./$TEST -n 6 -N 7 -r 1 -d 0 -f standard"
    ./$TEST -n 6 -N 7 -r 1 -d 0 -f standard

    if [ -e star_brute_force_27_standard.dat ]
    then
      if python @srcdir@/difffloat.py star_brute_force_27_standard.dat swift_star_dopair_27_standard.dat @srcdir@/star_tolerance_27_normal.dat 6
      then
        echo "Accuracy test passed"
      else
        echo "Accuracy test failed"
        exit 1
      fi
    else
      echo "Error Missing test output file"
      exit 1
    fi

    echo "------------"


  # Test for particles with random smoothing lengths
    echo ""

    rm -f star_brute_force_27_standard.dat swift_star_dopair_27_standard.dat

    echo "Running ./$TEST -n 6 -N 7 -r 1 -d 0 -f standard -p 1.1"
    ./$TEST -n 6 -N 7 -r 1 -d 0 -f standard -p 1.1

    if [ -e star_brute_force_27_standard.dat ]
    then
      if python @srcdir@/difffloat.py star_brute_force_27_standard.dat swift_star_dopair_27_standard.dat @srcdir@/star_tolerance_27_perturbed_h.dat 6
      then
        echo "Accuracy test passed"
      else
        echo "Accuracy test failed"
        exit 1
      fi
    else
      echo "Error Missing test output file"
      exit 1
    fi

    echo "------------"


  # Test for particles with random smoothing lengths
    echo ""

    rm -f star_brute_force_27_standard.dat swift_star_dopair_27_standard.dat

    echo "Running ./$TEST -n 6 -N 7 -r 1 -d 0 -f standard -p 1.3"
    ./$TEST -n 6 -N 7 -r 1 -d 0 -f standard -p 1.3

    if [ -e star_brute_force_27_standard.dat ]
    then
      if python @srcdir@/difffloat.py star_brute_force_27_standard.dat swift_star_dopair_27_standard.dat @srcdir@/star_tolerance_27_perturbed_h2.dat 6
      then
        echo "Accuracy test passed"
      else
        echo "Accuracy test failed"
        exit 1
      fi
    else
      echo "Error Missing test output file"
      exit 1
    fi

    echo "------------"

done

exit $?