Unverified Commit 2da7ebdd authored by ihumphrey's avatar ihumphrey Committed by GitHub
Browse files

Merge pull request #448 from kdl222/testPreference

Changed which TestPreference file gets copied to the build directory and updated truth data for tests 
parents bc48c46d dfb5dbae
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -379,7 +379,7 @@ endif()
install(CODE "EXECUTE_PROCESS(COMMAND rm -f ${CMAKE_INSTALL_PREFIX}/lib/libisis3.6.0${SO})")
install(CODE "EXECUTE_PROCESS(COMMAND rm -f ${CMAKE_INSTALL_PREFIX}/lib/libisis3.6${SO})")
install(CODE "EXECUTE_PROCESS(COMMAND rm -f ${CMAKE_INSTALL_PREFIX}/lib/libisis3.${SO})")
EXECUTE_PROCESS(COMMAND cp -f ${CMAKE_SOURCE_DIR}/src/base/objs/Preference/TestPreferences ${CMAKE_BINARY_DIR}/)
EXECUTE_PROCESS(COMMAND cp -f ${CMAKE_SOURCE_DIR}/TestPreferences ${CMAKE_BINARY_DIR}/)
install(CODE "EXECUTE_PROCESS(COMMAND cp -f ${CMAKE_SOURCE_DIR}/src/base/objs/Preference/TestPreferences ${CMAKE_INSTALL_PREFIX}/)")
install(CODE "EXECUTE_PROCESS(COMMAND cp -f ${CMAKE_SOURCE_DIR}/IsisPreferences ${CMAKE_INSTALL_PREFIX}/)")

+15 −14
Original line number Diff line number Diff line
@@ -38,25 +38,26 @@ userInput = parser.parse_args()
testInput = userInput.test

if "_unit_" in testInput:
    unitTestName = testInput.split("_test_")[1] + ".truth"
    # we should probably append the path to the front so it ends up in
    # in the same directory as the test
    unitTestPath = builddir + "/unitTest/"
    unitTestName = testInput.split("_test_")[1]
    truthFileName = unitTestName + ".truth"

    os.system(unitTestPath + testInput + ">&" + builddir + "/testOutputDir/" + unitTestName)
    print("Unit Test Output In " + builddir + "/testOutputDir/ As " + unitTestName)

    if userInput.truth:
    # We need to run the unit test from the object's directory because 
    # some tests have an xml file in the object's directory. If we ran the 
    # unit test from /unitTest, these files would not be able to be opened.
    with open(builddir + "/objects/CTestTestfile.cmake") as testFile:
        for line in testFile:
                if unitTestName in line:
                    unitTestSrcPath = line.split("\" \"")[2][13:]
                    os.system("cp -f " + builddir + "/testOutputDir/" + unitTestName + " " + unitTestSrcPath)
            if "/" + unitTestName + "/" in line:
                unitTestSrcPath = line.split("\" \"")[2][13:].split(unitTestName + "/")[0] + unitTestName + "/"
                if not os.path.exists(unitTestSrcPath + "unitTest"):              
                    os.system("ln -s " + builddir + "/unitTest/" + testInput + " " + unitTestSrcPath + "unitTest")
                os.system(unitTestSrcPath + "unitTest" + ">& " + builddir + "/testOutputDir/" + truthFileName)
                print("Unit Test Output In " + builddir + "/testOutputDir/ As " + truthFileName)
                break

    if userInput.truth:
        os.system("cp -f " + builddir + "/testOutputDir/" + truthFileName + " " + unitTestSrcPath + truthFileName)
        print("Checked In Truth Data To " + unitTestSrcPath)


else:
    apptest = testInput
    makefilePath = ""
+0 −1
Original line number Diff line number Diff line
@@ -8,7 +8,6 @@ APPNAME = reduce
# user had entered.

labels.txt.IGNORELINES = ByteOrder StartByte Bytes TileSamples TileLines
results.pvl.SKIPLINES=2

include $(ISISROOT)/make/isismake.tsts

+3 −4
Original line number Diff line number Diff line
@@ -26,10 +26,9 @@ APPNAME = ringspt
include $(ISISROOT)/make/isismake.tsts

commands:
	$(APPNAME) from=$(INPUT)/W1591159850_1_cal.cub > $(OUTPUT)/redirectedOutput.txt;
	echo -e "Group = Results" &> $(OUTPUT)/centersample_centerline_lev1.pvl;
	$(CAT) $(OUTPUT)/redirectedOutput.txt | grep -v "Processed" | grep -v "ringspt" \
	  >> $(OUTPUT)/centersample_centerline_lev1.pvl;
	$(APPNAME) from=$(INPUT)/W1591159850_1_cal.cub \
	to=$(OUTPUT)/centersample_centerline_lev1.pvl \
	> /dev/null;
	$(APPNAME) from=$(INPUT)/W1591159850_1_cal.cub \
	  to=$(OUTPUT)/appendedOutput_tmp.txt \
	  format=flat \
+45 −37
Original line number Diff line number Diff line
@@ -22,6 +22,7 @@

#include <cmath>

#include <QRegExp>
#include <QStack>
#include <QVector>

@@ -1003,12 +1004,19 @@ namespace Isis {
  void Calculator::PrintTop() {
    if (p_valStack->empty()) return;

    std::cout << "[ ";
    QString temp;
    temp += "[ ";
    QVector<double> top = p_valStack->top();
    for (int i = 0; i < (int)top.size(); i++) {
      std::cout << top[i] << " ";
    }
    std::cout << "]" << std::endl;
      temp += QString::number(top[i]);
      temp += " ";
    }
    temp += "]";
    // On some operating systems, -nan was being outputted. 
    // Because this method is only used as a cout in our tests, we do not 
    // care about the difference between nan and -nan; they are the same in this case.
    temp.replace(QRegExp("-nan"), "nan");
    std::cout<<temp<<std::endl;
  }


Loading