Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use baseText= in TestText or switch to TestValueXX for short cases #5373

Draft
wants to merge 15 commits into
base: develop
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/test/tests/databases/bov.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ def TestBOVDivide(prefix, db, doSubset):

# Make sure there are the right number of zones.
Query("NumZones",use_actual_data=0)
TestText(prefix + "01", GetQueryOutputString())
TestValueEQ(prefix + "01", GetQueryOutputValue(), 680340)

# Let's slice a few times to make sure that crucial areas have the
# right values
Expand Down
27 changes: 21 additions & 6 deletions src/test/tests/databases/export_db.py
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ def test1():
for fn in files:
if formats[f][0] in fn:
s = fn + "\n"
TestText("files", s)
TestText("files", s) # MCM (12Jan21)...noticed this never executes in testing
t = CreateAnnotationObject("Text2D")
t.text = f
t.position = (0.01, 0.91)
Expand Down Expand Up @@ -328,15 +328,15 @@ def test2(writeGroupSize):
OpenDatabase(datafile)
AddPlot(formats[f][3], formats[f][4])
opendbs = opendbs + [datafile]
filelist = filelist + datafile + "\n"
filelist = filelist + datafile + ", "
else:
if OpenDatabase(formats[f][1]):
md = GetMetaData(formats[f][1])
AddPlot(formats[f][3], formats[f][4])
opendbs = opendbs + [formats[f][1]]
filelist = filelist + formats[f][1] + "\n"
filelist = filelist + formats[f][1] + ", "
else:
filelist = "ERROR: " + "\n".join(os.listdir("."))
filelist = "ERROR: " + ", ".join(os.listdir("."))
DrawPlots()
t = CreateAnnotationObject("Text2D")
t.text = f
Expand All @@ -345,7 +345,7 @@ def test2(writeGroupSize):
SetView3D(v)
SetAnnotationAttributes(a)
Test(formats[f][2])
TestText(formats[f][2] + "fn", filelist)
TestText(formats[f][2] + "fn", filelist, baseText=baseVals[formats[f][2] + "fn"])

# Clean up window 2
DeleteAllPlots()
Expand Down Expand Up @@ -539,9 +539,24 @@ def test_vtk_tetrahedralize():
DrawPlots()
Query("NumZones")
nzNew = int(GetQueryOutputValue())
TestText("export_db_vtk_tets_%s"%db_noext, "Ratio of exported zone count to original is %d"%(nzNew/nzOrig))
TestValueEQ("export_db_vtk_tets_zone_count_ratio_%s"%db_noext, nzNew/nzOrig,
baseVals["export_db_vtk_tets_zone_count_ratio_%s"%db_noext])
DeleteAllPlots()

baseVals = {
"export_db_2_01fn": "wg_PLY.1.ply, wg_PLY.2.ply",
"export_db_2_02fn": "wg_RAW.1.raw, wg_RAW.2.raw",
"export_db_2_03fn": "wg_STL.1.stl, wg_STL.2.stl",
"export_db_2_04fn": "wg_Silo.silo",
"export_db_2_05fn": "wg_Tecplot.1.tec, wg_Tecplot.2.tec",
"export_db_2_06fn": "wg_VTK.visit",
"export_db_2_07fn": "wg_OBJ.1.obj, wg_OBJ.2.obj",
"export_db_2_08fn": "wg_XYZ.1.xyz, wg_XYZ.2.xyz",
"export_db_2_09fn": "wg_Xmdv.visit",
"export_db_vtk_tets_zone_count_ratio_specmix_ucd": 2,
"export_db_vtk_tets_zone_count_ratio_ucd3d": 6
}

def main():
test0()
test1()
Expand Down
20 changes: 6 additions & 14 deletions src/test/tests/queries/kurtosis.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,31 +18,23 @@
DrawPlots()

Query("Kurtosis")
text = GetQueryOutputString()
TestText("kurtosis_01", text)
TestValueEQ("kurtosis_01", GetQueryOutputValue(), 5.9999)

Query("Skewness")
text = GetQueryOutputString()
TestText("kurtosis_02", text)
TestValueEQ("kurtosis_02", GetQueryOutputValue(), -2.29557e-09)

ChangeActivePlotsVar("Log Normal Distribution")
Query("Kurtosis")
text = GetQueryOutputString()
TestText("kurtosis_03", text)
TestValueEQ("kurtosis_03", GetQueryOutputValue(), 19.73632)

Query("Skewness")
text = GetQueryOutputString()
TestText("kurtosis_04", text)
TestValueEQ("kurtosis_04", GetQueryOutputValue(), 3.38354)

ChangeActivePlotsVar("Exponential Distribution")
Query("Kurtosis")
text = GetQueryOutputString()
TestText("kurtosis_05", text)
TestValueEQ("kurtosis_05", GetQueryOutputValue(), 8.99968)

Query("Skewness")
text = GetQueryOutputString()
TestText("kurtosis_06", text)


TestValueEQ("kurtosis_06", GetQueryOutputValue(), 1.99999)

Exit()
103 changes: 74 additions & 29 deletions src/test/tests/queries/line_scan.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@

import os


ca=CurveAttributes()
ca.cycleColors = 0
SetDefaultPlotOptions(ca)
Expand Down Expand Up @@ -85,13 +84,11 @@ def TestOne(index, filename, varname, meshname, limit):
test1 = "ls_%d_%d" %(index,1)
Test(test1)
Query("Integrate")
text = GetQueryOutputString()
test2 = "ls_%d_%d" %(index,2)
TestText(test2, text)
TestValueEQ(test2, GetQueryOutputValue(), baseVals[test2])
Query("Expected Value")
text = GetQueryOutputString()
test3 = "ls_%d_%d" %(index,3)
TestText(test3, text)
TestValueEQ(test3, GetQueryOutputValue(), baseVals[test3])
DeleteAllPlots()
OpenDatabase("md0.ult")
ReOpenDatabase("md0.ult") # Flush out cached version
Expand All @@ -101,13 +98,11 @@ def TestOne(index, filename, varname, meshname, limit):
test4 = "ls_%d_%d" %(index,4)
Test(test4)
Query("Integrate")
text = GetQueryOutputString()
test5 = "ls_%d_%d" %(index,5)
TestText(test5, text)
TestValueEQ(test5, GetQueryOutputValue(), baseVals[test5])
Query("Expected Value")
text = GetQueryOutputString()
test6 = "ls_%d_%d" %(index,6)
TestText(test6, text)
TestValueEQ(test6, GetQueryOutputValue(), baseVals[test6])
DeleteAllPlots()
OpenDatabase("dfb0.ult")
ReOpenDatabase("dfb0.ult") # Flush out cached version
Expand All @@ -117,13 +112,11 @@ def TestOne(index, filename, varname, meshname, limit):
test7 = "ls_%d_%d" %(index,7)
Test(test7)
Query("Integrate")
text = GetQueryOutputString()
test8 = "ls_%d_%d" %(index,8)
TestText(test8, text)
TestValueEQ(test8, GetQueryOutputValue(), baseVals[test8])
Query("Expected Value")
text = GetQueryOutputString()
test9 = "ls_%d_%d" %(index,9)
TestText(test9, text)
TestValueEQ(test9, GetQueryOutputValue(), baseVals[test9])
DeleteAllPlots()
OpenDatabase("cld_a0.ult")
ReOpenDatabase("cld_a0.ult") # Flush out cached version
Expand All @@ -133,13 +126,11 @@ def TestOne(index, filename, varname, meshname, limit):
test1 = "ls_%d_%d" %(index,10)
Test(test1)
Query("Integrate")
text = GetQueryOutputString()
test2 = "ls_%d_%d" %(index,11)
TestText(test2, text)
TestValueEQ(test2, GetQueryOutputValue(), baseVals[test2])
Query("Expected Value")
text = GetQueryOutputString()
test3 = "ls_%d_%d" %(index,12)
TestText(test3, text)
TestValueEQ(test3, GetQueryOutputValue(), baseVals[test3])
DeleteAllPlots()
OpenDatabase("rld_i0.ult")
ReOpenDatabase("rld_i0.ult") # Flush out cached version
Expand All @@ -149,13 +140,11 @@ def TestOne(index, filename, varname, meshname, limit):
test1 = "ls_%d_%d" %(index,13)
Test(test1)
Query("Integrate")
text = GetQueryOutputString()
test2 = "ls_%d_%d" %(index,14)
TestText(test2, text)
TestValueEQ(test2, GetQueryOutputValue(), baseVals[test2])
Query("Expected Value")
text = GetQueryOutputString()
test3 = "ls_%d_%d" %(index,15)
TestText(test3, text)
TestValueEQ(test3, GetQueryOutputValue(), baseVals[test3])
DeleteAllPlots()
OpenDatabase("rld_a0.ult")
ReOpenDatabase("rld_a0.ult") # Flush out cached version
Expand All @@ -165,13 +154,11 @@ def TestOne(index, filename, varname, meshname, limit):
test1 = "ls_%d_%d" %(index,16)
Test(test1)
Query("Integrate")
text = GetQueryOutputString()
test2 = "ls_%d_%d" %(index,17)
TestText(test2, text)
TestValueEQ(test2, GetQueryOutputValue(), baseVals[test2])
Query("Expected Value")
text = GetQueryOutputString()
test3 = "ls_%d_%d" %(index,18)
TestText(test3, text)
TestValueEQ(test3, GetQueryOutputValue(), baseVals[test3])
DeleteAllPlots()
OpenDatabase("lst0.ult")
ReOpenDatabase("lst0.ult") # Flush out cached version
Expand All @@ -181,15 +168,73 @@ def TestOne(index, filename, varname, meshname, limit):
test1 = "ls_%d_%d" %(index,19)
Test(test1)
Query("Integrate")
text = GetQueryOutputString()
test2 = "ls_%d_%d" %(index,20)
TestText(test2, text)
TestValueEQ(test2, GetQueryOutputValue(), baseVals[test2])
Query("Expected Value")
text = GetQueryOutputString()
test3 = "ls_%d_%d" %(index,21)
TestText(test3, text)
TestValueEQ(test3, GetQueryOutputValue(), baseVals[test3])
DeleteAllPlots()

#
# Expected results for each test
#
baseVals = {
"ls_0_2":1,
"ls_0_3":0.0312789,
"ls_0_5":0.125232,
"ls_0_6":0.00631335,
"ls_0_8":0.125232,
"ls_0_9":0.00316435,
"ls_1_11":1,
"ls_0_11":1,
"ls_0_12":0.182223,
"ls_0_14":1,
"ls_0_15":0.0141507,
"ls_0_17":1,
"ls_0_18":0.0572263,
"ls_0_20":0.164641,
"ls_0_21":0.00609974,
"ls_1_2":1,
"ls_1_3":0.0322331,
"ls_1_5":0.142894,
"ls_1_6":0.00773154,
"ls_1_8":0.142894,
"ls_1_9":0.00387523,
"ls_1_12":0.20811,
"ls_1_14":0.999999,
"ls_1_15":0.0145833,
"ls_1_17":1,
"ls_1_18":0.0642869,
"ls_1_20":0.18530,
"ls_1_21":0.00830585,
"ls_2_2":1,
"ls_2_3":0.0266496,
"ls_2_5":3.38562e-06,
"ls_2_6":1.87224e-07,
"ls_2_8":3.38562e-06,
"ls_2_9":9.37578e-08,
"ls_2_11":1,
"ls_3_11":1,
"ls_2_12":0.0860585,
"ls_2_14":1,
"ls_2_15":0.001,
"ls_2_17":1,
"ls_2_18":0.001,
"ls_2_20":0.0798091,
"ls_2_21":0.00218212,
"ls_3_2":1,
"ls_3_3":1.08223,
"ls_3_5":1.11039,
"ls_3_6":1.53097,
"ls_3_8":1.11039,
"ls_3_9":0.765742,
"ls_3_12":1.25808,
"ls_3_14":0.999999,
"ls_3_15":0.160933,
"ls_3_17":0.999999,
"ls_3_18":0.178107,
"ls_3_20":1.25822,
"ls_3_21":0.9419}

TestOne(0, silo_data_path("rect2d.silo") , "d", "quadmesh2d", 0.5)
TestOne(1, silo_data_path("multi_rect2d.silo") , "d", "mesh1", 0.5)
Expand Down
2 changes: 1 addition & 1 deletion src/test/tests/queries/queriesOverTime.py
Original file line number Diff line number Diff line change
Expand Up @@ -678,7 +678,7 @@ def TestPickRangeTimeQuery():
s = str(output_dict)

Test("TimePickRange_00")
TestText("TimePickRangeDict_00",s)
TestText("TimePickRangeDict_00",s,baseText="None")
ClearPickPoints()

#
Expand Down
32 changes: 16 additions & 16 deletions src/test/tests/queries/variable_sum_volume.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,43 +17,43 @@
SetQueryFloatFormat("%g")
# Material 1
TurnMaterialsOff(("4", "9"))
text = Query("Variable Sum")
TestText("mat_1", text)
Query("Variable Sum")
TestValueEQ("mat_1", GetQueryOutputValue(), 255.762, rndprec=3)

# Material 4
TurnMaterialsOff("1")
TurnMaterialsOn("4")
text = Query("Variable Sum")
TestText("mat_4", text)
Query("Variable Sum")
TestValueEQ("mat_4", GetQueryOutputValue(), 224.805, rndprec=3)

# Material 9
TurnMaterialsOff("4")
TurnMaterialsOn("9")
text = Query("Variable Sum")
TestText("mat_9", text)
Query("Variable Sum")
TestValueEQ("mat_9", GetQueryOutputValue(), 176.458, rndprec=3)

# Material 14
TurnMaterialsOff("9")
TurnMaterialsOn(("1", "4"))
text = Query("Variable Sum")
TestText("mat_14", text)
Query("Variable Sum")
TestValueEQ("mat_14", GetQueryOutputValue(), 480.567, rndprec=3)

# Material 19
TurnMaterialsOff("4")
TurnMaterialsOn("9")
text = Query("Variable Sum")
TestText("mat_19", text)
Query("Variable Sum")
TestValueEQ("mat_19", GetQueryOutputValue(), 432.22, rndprec=3)

# Material 49
TurnMaterialsOff("1")
TurnMaterialsOn("4")
text = Query("Variable Sum")
TestText("mat_49", text)
Query("Variable Sum")
TestValueEQ("mat_49", GetQueryOutputValue(), 401.263, rndprec=3)

# Material 149
TurnMaterialsOn()
text = Query("Variable Sum")
TestText("mat_149", text)
Query("Variable Sum")
TestValueEQ("mat_149", GetQueryOutputValue(), 657.025, rndprec=3)

DeleteAllPlots()
CloseDatabase(data_path("silo_pdb_test_data/ucd3d.silo"))
Expand All @@ -62,7 +62,7 @@
OpenDatabase(data_path("silo_pdb_test_data/multi_dim_cells.silo"))
AddPlot("Pseudocolor", "coordx", 1, 1)
DrawPlots()
text = Query("Weighted Variable Sum")
TestText("vws_mult_dim", text)
Query("Weighted Variable Sum")
TestValueEQ("vws_mult_dim", GetQueryOutputValue(), 4.5, rndprec=3)

Exit()
Loading