visit
visit copied to clipboard
Improve Auto-Naming Test methods
- Have them take section headings and/or file prefixes from the funciton's doc string instead of the function's name.
- Instead of using an incrimenting index for tests from within the same function, find a way to create a hash based on a more permanent expression of the test (key VisIt CLI methods). For example, from this block of code, https://github.com/visit-dav/visit/blob/8f70eeda2bd57748a22f119d55a70bbb229bfe29/src/test/tests/queries/line_scan.py#L82-L102
OpenDatabase("cld_i0.ult") # test-tag
ReOpenDatabase("cld_i0.ult")
AddPlot("Curve", "Chord length distribution - individual") # test-tag
DrawPlots()
ResetView()
test1 = "ls_%d_%d" %(index,1)
TestAutoName(test1)
Query("Integrate") # test-tag
text = GetQueryOutputString() # test-tag
test2 = "ls_%d_%d" %(index,2)
TestTextAutoName(test2, text)
The auto-naming methods could gobble up and hash all preceding lines with # test-tag in them (whitespace, etc. removed) and use that as the test's index. In the example above. This would make the auto-naming logic less sensitive to minor structural changes in the python code. For example, a new test could be added between the existing two without causing them to rename.