...
 
Commits (2)
' Gambas test file
Public Sub IHaveAWrongPlan()
Test.Plan(1)
Assert.Ok(True)
Assert.NotOk(False)
End
......@@ -16,8 +16,6 @@ Private $hNext As TestAssertion
Private $Suite As TestSuite
'' Trigger gb.test to get all tests as string. Used to get all test names on the commandline with gbx3 -T "@AllTestNames" /path/to/project
Public Const _TRIG_GETTESTS As String = "@AllTestNames"
'' The static procedure Test.Main() starts tests. By default it runs all testmethods in all
'' testmodules ordered by name and prints the result to the console.
......@@ -42,11 +40,6 @@ Public Const _TRIG_GETTESTS As String = "@AllTestNames"
Public Sub Main(Optional Tests As String)
' If Tests = _TRIG_GETTESTS Then
' Print AllTests()
' Goto TheEnd
' Endif
If Not Tests Then
PrintAllTests()
Return
......@@ -69,50 +62,6 @@ TheEnd:
End
' '' Called by the interpreter when a collection of tests is to be run.
' '' Adds a single Testmodule, Tests must be a string in this format:
' '' Name of the testmodule (mandatory) and if testmethods have to be called
' '' it is followed by a dot and the testmethods have to be separated by a semikolon.
'
' Public Sub _Add(Testclass As Class, Tests As String)
'
' Dim sName As String
'
' If Not $Suite Then
' $Suite = New TestSuite
' Endif
'
' If Testclass.Name = Tests Then
' 'Add all methods in Testclass
' $Suite.AddAllTestCases(Testclass)
' Goto TheEnd
' Endif
'
' ' got sth like "TestAllAsserts.TestAssertErrorCode;TestNote;TestLike"
' For Each sName In Split(Split(Tests, ".")[1], ";")
' $Suite.AddTestCase(sName, Testclass)
' Next
'
' TheEnd:
' If $hPrinter.Session.Summary.Description = Null Then
' $hPrinter.Session.Summary.Description = Tests
' Else
' $hPrinter.Session.Summary.Description &= "," & Tests
' Endif
'
' End
' '' Called by the interpreter when argument = "*". Example: gbx3 -T "*" /path/to/project
'
' Public Sub _Run()
'
' 'Test._Reset() ' only if you run this Main multiple times per process, which you shouldn't
' RunTests()
' PrintSummary()
' Quit ExitCode()
'
' End
Private Sub PrintSummary()
With $hPrinter.Session
......
......@@ -33,7 +33,7 @@ Function Name_Read() As String
End
'Create the fixture, run the test and collect the results in Track
'' Create the fixture, run the test and collect the results in Track
Public Sub Run()
Assert $MyTestModule
......@@ -72,4 +72,4 @@ Public Function _compare(TC As Testcase) As Integer
Endif
Return Comp(Me.TestModule.Name, TC.TestModule.Name)
End
\ No newline at end of file
End
[TestSuites]
Count=1
TestWith=1
Default="TestAllAsserts,TestFailures.TestEqualsFailure;TestLongFailure;TestLongTypeMismatchFailure;TestStringFailure,TestInternals.CommandsToString;InterpreterInterface;ParseTestCommands"
Count=4
TestWith=3
Default="TestAllAsserts,TestFailures.TestEqualsFailure;TestLongFailure;TestLongTypeMismatchFailure;TestStringFailure,TestInternals.CommandsToString;InterpreterInterface;ParseTestCommands;ReflectTest;ReflectTestsString"
[TestSuites/1]
Name="Suite de tests n°1"
Tests="TestCrashes.TestDoACrash;TestErrorTwo,TestElse.TestNoMessage;TestNoMessageInbetween;TestNote,TestEmpty"
Name="! Must Bail out!"
Tests="TestBailout.TestBailout"
[TestSuites/2]
Name="! Must fail (a couple of crashes)"
Tests="TestCrashes.TestDoACrash;TestErrorTwo"
[TestSuites/3]
Name="! Must fail (wrong plan)"
Tests="TestWrongPlan.IHaveAWrongPlan"
[TestSuites/4]
Name="All good"
Tests="TestAllAsserts.TestAssert;TestAssertEmpty;TestAssertEqualsDate;TestAssertEqualsFloat;TestAssertEqualsLong;TestAssertEqualsObject;TestAssertEqualsString;TestAssertError;TestAssertErrorCode;TestAssertNotNull;TestLike;TestNote;TestTodoErrorCode,TestElse.TestNoMessage;TestNoMessageInbetween;TestNote,TestEmpty,TestError.TestError,TestFailures.TestEqualsFailure;TestError;TestLongFailure;TestLongTypeMismatchFailure;TestStringFailure,TestInternals.CommandsToString;InterpreterInterface;ParseTestCommands;ReflectTest;ReflectTestsString,TestSetup.NameOfMethodDoesNotStartWithTest;TestFirst,TestSummary.DoSkip;DoSomeAsserts;DoTodo"
[TestSuites/Suite1]
Name="Série de tests n°1"
......
## To Do
- Plan
> Plan works but only for assertions in testmodules. If a plan failes it has to be reported in the summary which is not the case at the moment
> If a plan failes it has to be reported in the TAP output as well as in the summary which is not the case at the moment. There is no plan for testmodules which counts the testmethods.
* [ ] Plan for testmodules (as a constant?)
* [ ] Plan failure must be reported in TAP output and in summary (there has to be reported where it fails).
- Parser parse subtests
- Skip all
> Parse `1..0 # SKIP` style TAPs indicating that a whole test was skipped.
- Plan selftests
> gb.test: Every subtest in all tests must plan the own assertion count
- TestAllAssertion must test all assertions
## Work
- Decide where Skip, SkipAll, Todo reside
> SkipAll is in Test, Skip in Assert, Todo in Assert. This is inconsistent, We have to decide where they should be.
> SkipAll is in Test, Skip in Assert, Todo in Assert. This is inconsistent, We have to decide where they should be. Chris: I am for Test.
- Document Approximate and RelativeApproximate
## Done
......