#!/bin/sh

set -e

# Run executables from most-debugging-enabled to least-, so if
# there's a failure we get the most informative death possible
ORDERED_METHODS="dbg debug devel profiling pro prof oprofile oprof optimized opt"

for method in ${ORDERED_METHODS}; do
    for mymethod in @METHODS@; do
        if (test "x${mymethod}" = "x${method}"); then
            MY_METHODS="${MY_METHODS} ${mymethod}"
        fi
    done
done

for method in ${MY_METHODS}; do
@LIBMESH_ENABLE_GLIBCXX_DEBUGGING_CPPUNIT_FALSE@@LIBMESH_ENABLE_GLIBCXX_DEBUGGING_TRUE@    if [ "x$method" = "xdbg" ]; then
@LIBMESH_ENABLE_GLIBCXX_DEBUGGING_CPPUNIT_FALSE@@LIBMESH_ENABLE_GLIBCXX_DEBUGGING_TRUE@      continue;
@LIBMESH_ENABLE_GLIBCXX_DEBUGGING_CPPUNIT_FALSE@@LIBMESH_ENABLE_GLIBCXX_DEBUGGING_TRUE@    fi
    echo $LIBMESH_RUN ./unit_tests-$method --option-with-dashes --option_with_underscores 3 $LIBMESH_OPTIONS
    $LIBMESH_RUN ./unit_tests-$method --option-with-dashes --option_with_underscores 3 $LIBMESH_OPTIONS
done

#!/bin/sh

set -e

# Run executables from most-debugging-enabled to least-, so if
# there's a failure we get the most informative death possible
ORDERED_METHODS="dbg debug devel profiling pro prof oprofile oprof optimized opt"

# when run outside of the automake envionment make sure we get METHODS set
# to something useful
if (test "x${METHODS}" = "x"); then
    if (test "x${METHOD}" = "x"); then
        METHODS="@METHODS@"
    else
        METHODS="$METHOD"
    fi
fi

for method in ${ORDERED_METHODS}; do
    for mymethod in ${METHODS}; do
        if (test "x${mymethod}" = "x${method}"); then
            MY_METHODS="${MY_METHODS} ${mymethod}"
        fi
    done
done

for method in ${MY_METHODS}; do
@LIBMESH_ENABLE_GLIBCXX_DEBUGGING_CPPUNIT_FALSE@@LIBMESH_ENABLE_GLIBCXX_DEBUGGING_TRUE@    if [ "x$method" = "xdbg" ]; then
@LIBMESH_ENABLE_GLIBCXX_DEBUGGING_CPPUNIT_FALSE@@LIBMESH_ENABLE_GLIBCXX_DEBUGGING_TRUE@      continue;
@LIBMESH_ENABLE_GLIBCXX_DEBUGGING_CPPUNIT_FALSE@@LIBMESH_ENABLE_GLIBCXX_DEBUGGING_TRUE@    fi
    echo $LIBMESH_RUN ./unit_tests-$method --option-with-dashes --option_with_underscores 3 $LIBMESH_OPTIONS
    $LIBMESH_RUN ./unit_tests-$method --option-with-dashes --option_with_underscores 3 $LIBMESH_OPTIONS
done

Allow override of METHODS when running unit tests
Allow override of METHODS when running unit tests

Sometimes running opt doesn't give you useful internal assertions,
running dbg doesn't let you iterate over a zillion MPI/threading
configurations quickly enough, but running devel is Just Right.
