gambas-source-code/main/lib/test/gb.test/.src/TestSuite/MTest.module
Christof Thalhofer 315c383a4d gb.test run testsuite by name from settings
[GB.TEST]
* OPT: gb.test: Run test suite by name from settings
2020-05-27 20:56:33 +02:00

23 lines
616 B
Text

' Gambas module file
''' Helper functions for Test class (that need to be tested but should not be exported)
'' fiddle out testsuite's tests out of .test file
Public Function GetTestSuiteByName(Name As String) As String
Dim Set As New Settings(Application.Path &/ ".test")
Dim sKey As String
If Name Begins "@" Then
Name = Right(Name, String.Len(Name) - 1)
Endif
For Each sKey In Set.Keys
If Set[sKey &/ "Name"] = Name Then
Return Set[sKey &/ "Tests"]
Endif
Next
Error.Raise(Subst(("Could not find a test suite with the name '&1'."), Name))
End