| 66 | } |
| 67 | |
| 68 | func (runner *SGRTestRunner) Run(test func(t *testing.T)) { |
| 69 | if runner.initialisedInsideRunnerCode { |
| 70 | require.FailNow(runner.TB(), "must not initialise SGRPeers outside Run() method") |
| 71 | } |
| 72 | |
| 73 | runner.initialisedInsideRunnerCode = true |
| 74 | defer func() { |
| 75 | // reset bool post test run to ensure no one can setup SetupSGRPeers outside run method upon completion of Run() |
| 76 | runner.initialisedInsideRunnerCode = false |
| 77 | }() |
| 78 | |
| 79 | if !runner.SkipSubtest[RevtreeSubtestName] { |
| 80 | runner.t.Run(RevtreeSubtestName, func(t *testing.T) { |
| 81 | runner.SupportedSubprotocols = []string{db.CBMobileReplicationV3.SubprotocolString()} |
| 82 | test(t) |
| 83 | }) |
| 84 | } |
| 85 | if !runner.SkipSubtest[VersionVectorSubtestName] { |
| 86 | runner.t.Run(VersionVectorSubtestName, func(t *testing.T) { |
| 87 | runner.SupportedSubprotocols = []string{db.CBMobileReplicationV4.SubprotocolString()} |
| 88 | test(t) |
| 89 | }) |
| 90 | } |
| 91 | } |
| 92 | |
| 93 | func (runner *SGRTestRunner) RunSubprotocolV3(test func(t *testing.T)) { |
| 94 | if runner.initialisedInsideRunnerCode { |