Commit 60bee9df authored by Salko Jr, Robert's avatar Salko Jr, Robert
Browse files

Use system python for tests

parent 9540fe02
Loading
Loading
Loading
Loading
+7 −9
Original line number Diff line number Diff line
#!/bin/bash
BASEDIR=$(pwd)

# Pass in the Python exe to use
PYTHON="$(cd "$(dirname "$1")"; pwd)/$(basename "$1")"
echo "Using python found in: $PYTHON"


# Pass in "rebaseline" to do a rebaseline of all tests
if [ "$2" == "rebaseline" ]; then
@@ -19,7 +17,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"
@@ -29,7 +27,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
@@ -51,7 +49,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"
@@ -61,14 +59,14 @@ runInputTest(){
      echo "Rebaselining the test case based on user input!!!!"
      cp "$2.inp" "$2.inp.gold"
   fi
   $PYTHON $BASEDIR/deckCompare.py "$2.inp" "$2.inp.gold"
   python $BASEDIR/deckCompare.py "$2.inp" "$2.inp.gold"
   if [ "$?" != "0" ]; then
      echo "...TEST FAILED"
      exit 1
   fi
   if [ "$5" = true ]; then
      echo "Checking vuq_mult.txt file"
      $PYTHON $BASEDIR/deckCompare.py "vuq_mult.txt" "$2.vuq_mult.txt.gold"
      python $BASEDIR/deckCompare.py "vuq_mult.txt" "$2.vuq_mult.txt.gold"
      if [ "$?" != "0" ]; then
         echo "...TEST FAILED"
         exit 1
@@ -76,7 +74,7 @@ runInputTest(){
   fi
   if [ "$6" = true ]; then
      echo "Checking vuq_param.txt file"
      $PYTHON $BASEDIR/deckCompare.py "vuq_param.txt" "$2.vuq_param.txt.gold"
      python $BASEDIR/deckCompare.py "vuq_param.txt" "$2.vuq_param.txt.gold"
      if [ "$?" != "0" ]; then
         echo "...TEST FAILED"
         exit 1
+3 −5
Original line number Diff line number Diff line
#!/bin/bash

# Pass in the Python exe to use
PYTHON="$(cd "$(dirname "$1")"; pwd)/$(basename "$1")"
echo "Using python found in: $PYTHON"


# Pass in "rebaseline" to do a rebaseline of all tests
if [ "$2" == "rebaseline" ]; then
@@ -24,7 +22,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"
@@ -34,7 +32,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
+2 −4
Original line number Diff line number Diff line
# Test the scripts that will be installed

# Pass in the Python exe to use
PYTHON="$(cd "$(dirname "$1")"; pwd)/$(basename "$1")"
echo "Using python found in: $PYTHON"


runScriptTest(){
   # Arguments
@@ -11,7 +9,7 @@ runScriptTest(){
   echo "=========================================="
   echo "...Script test: $1"
   echo "=========================================="
   $PYTHON $1
   python $1
   if [ "$?" != "0" ]; then
      echo "... TEST FAILED"
      exit 1
+4 −6
Original line number Diff line number Diff line
#!/bin/bash

# Pass in the Python exe to use
PYTHON="$(cd "$(dirname "$1")"; pwd)/$(basename "$1")"
echo "Using python found in: $PYTHON"


BASEDIR=$(pwd)

@@ -14,7 +12,7 @@ runUnitTest(){
   echo "=========================================="
   echo "...Unit test: $1"
   echo "=========================================="
   $PYTHON $1
   python $1
   if [ "$?" != "0" ]; then
      echo "...UNIT TEST FAILED"
      exit 1
@@ -22,7 +20,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"
@@ -32,7 +30,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"