Commit 2f04090b authored by Salko Jr, Robert's avatar Salko Jr, Robert
Browse files

Correction to tests

Tests need to use the version of python installed during config time
instead of system python.  Also, there was a typo for the conda install
for macs.
parent 52eae2a0
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -17,5 +17,4 @@ tests:
      - rm -rf *
      - $SRC_DIR/config.sh $SRC_DIR
      - make -j4
      - cd tests
      - ./test_driver.sh
      - ctest -j4
+8 −6
Original line number Diff line number Diff line
@@ -76,7 +76,7 @@ if(NOT "find_python_module(PyQt4)")
     "mkdir -p ${CMAKE_CURRENT_BINARY_DIR}"
     )
     SET(PYTHON_CONFIGURE_COMMAND
     "${CMAKE_CURRENT_SOURCE_DIR}/SubKit/utils/bundle/linux/Miniconda2-latest-MacOSX-x86_64.sh -b -u -p ${CMAKE_CURRENT_BINARY_DIR}/conda"
     "${CMAKE_CURRENT_SOURCE_DIR}/SubKit/utils/bundle/macos/Miniconda2-latest-MacOSX-x86_64.sh -b -u -p ${CMAKE_CURRENT_BINARY_DIR}/conda"
     )
     SET(PYTHON_UPDATE_COMMAND
     "${CMAKE_CURRENT_BINARY_DIR}/conda/bin/pip install -r ${CMAKE_CURRENT_BINARY_DIR}/SubKit/utils/bundle/macos/requirements.txt --no-index --find-links file://${CMAKE_CURRENT_BINARY_DIR}/SubKit/utils/bundle/macos"
@@ -96,3 +96,5 @@ endif()

INSTALL( DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/conda DESTINATION ${CMAKE_INSTALL_PREFIX} )
INSTALL( DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/SubKit DESTINATION ${CMAKE_INSTALL_PREFIX} )

add_subdirectory(tests)
+12 −8
Original line number Diff line number Diff line
#!/bin/bash

# Pass in the Python exe to use
PYTHON=$1
echo "Using python found in: $PYTHON"

BASEDIR=$(pwd)


@@ -10,7 +14,7 @@ runUnitTest(){
   echo "=========================================="
   echo "...Unit test: $1"
   echo "=========================================="
   python $1
   $PYTHON $1
   if [ "$?" != "0" ]; then
      echo "...UNIT TEST FAILED"
      exit 1
@@ -18,7 +22,7 @@ runUnitTest(){
}

echo "Testing the unit test harness fails when it should fail (this unit test will fail)"
python testDriver/test_fail.py
$PYTHON testDriver/test_fail.py
if [ "$?" != "0" ]
then
   echo "...TEST PASSED"
@@ -28,7 +32,7 @@ else
fi

echo "Testing the unit test harness passes when it should pass"
python testDriver/test_pass.py
$PYTHON testDriver/test_pass.py
if [ "$?" == "0" ]
then
   echo "...TEST PASSED"
@@ -54,7 +58,7 @@ echo ""
echo ""
echo ""
echo "Running script tests..."
./test_scripts.sh
./test_scripts.sh $PYTHON
echo "Done"
echo ""
echo ""
@@ -66,7 +70,7 @@ echo ""
echo "Running SubKit regression tests..."
echo ""
echo "...Testing python diff script passes for identical files"
python deckCompare.py testDriver/deck.inp testDriver/deck_same.inp
$PYTHON deckCompare.py testDriver/deck.inp testDriver/deck_same.inp
if [ "$?" != "0" ]
then
   echo "...TEST FAILED"
@@ -76,7 +80,7 @@ else
fi
echo ""
echo "...Testing python diff script fails for different files"
python deckCompare.py testDriver/deck.inp testDriver/deck_diff.inp
$PYTHON deckCompare.py testDriver/deck.inp testDriver/deck_diff.inp
if [ "$?" == "0" ]; then
   echo "...TEST FAILED"
   exit 1
@@ -86,13 +90,13 @@ fi
echo ""

# Run input tests
./test_input_mode.sh
./test_input_mode.sh $PYTHON
if [ "$?" != "0" ]; then
   echo "...TEST FAILED"
   exit 1
fi

./test_script_mode.sh
./test_script_mode.sh $PYTHON
if [ "$?" != "0" ]; then
   echo "...TEST FAILED"
   exit 1
+6 −2
Original line number Diff line number Diff line
#!/bin/bash
BASEDIR=$(pwd)

# Pass in the Python exe to use
PYTHON=$1
echo "Using python found in: $PYTHON"

# Pass in "rebaseline" to do a rebaseline of all tests
if [ "$1" == "rebaseline" ]; then
   rebaseline=true
@@ -21,7 +25,7 @@ runInputTest(){
   echo "...Run input test: $3 $2"
   echo "=========================================="
   cd $1
   python $3 "$2.skb"
   $PYTHON $3 "$2.skb"
   if [ "$?" != "0" ]; then
      echo "...TEST FAILED"
      echo "The deck building script has failed"
@@ -31,7 +35,7 @@ runInputTest(){
      echo "Rebaselining the test case based on user input!!!!"
      cp deck.inp "$2.inp.gold"
   fi
   python $BASEDIR/deckCompare.py deck.inp "$2.inp.gold"
   $PYTHON $BASEDIR/deckCompare.py deck.inp "$2.inp.gold"
   if [ "$?" != "0" ]; then
      echo "...TEST FAILED"
      exit 1
+5 −2
Original line number Diff line number Diff line
#!/bin/bash

# Pass in the Python exe to use
PYTHON=$1
echo "Using python found in: $PYTHON"

# Pass in "rebaseline" to do a rebaseline of all tests
if [ "$1" == "rebaseline" ]; then
@@ -21,7 +24,7 @@ runScriptTest(){
   echo "...Run script test: $1 $2"
   echo "=========================================="
   cd $1
   python $2
   $PYTHON $2
   if [ "$?" != "0" ]; then
      echo "...TEST FAILED"
      echo "The deck building script has failed"
@@ -31,7 +34,7 @@ runScriptTest(){
      echo "Rebaselining the test case based on user input!!!!"
      cp deck.inp deck.inp.gold
   fi
   python $BASEDIR/deckCompare.py deck.inp deck.inp.gold
   $PYTHON $BASEDIR/deckCompare.py deck.inp deck.inp.gold
   if [ "$?" != "0" ]; then
      echo "...TEST FAILED"
      exit 1
Loading