| 154 | return tests |
| 155 | |
| 156 | def prepareWorkspace(useGit, gitRef): |
| 157 | global gitCheckoutSucceeded |
| 158 | if useGit: |
| 159 | code = run('git fetch') |
| 160 | if 0 != code: |
| 161 | raise RuntimeError('ERROR: "git fetch" failed. See above.') |
| 162 | checkoutCmd = 'git checkout %s' % gitRef |
| 163 | code = run(checkoutCmd) |
| 164 | if 0 != code: |
| 165 | addWantedBranchCmd = "git remote set-branches --add origin %s" % gitRef |
| 166 | checkoutBranchCmd = 'git checkout -t -b %s origin/%s' % (gitRef, gitRef) # Checkout remote branch as new local branch |
| 167 | print('"%s" failed. Trying "%s" and "%s".' % (checkoutCmd, addWantedBranchCmd, checkoutBranchCmd)) |
| 168 | code = run(addWantedBranchCmd) |
| 169 | if 0 != code: |
| 170 | raise RuntimeError('ERROR: "%s" failed. See above.' % addWantedBranchCmd) |
| 171 | code = run(checkoutBranchCmd) |
| 172 | if 0 != code: |
| 173 | raise RuntimeError('ERROR: "%s" failed. See above.' % checkoutBranchCmd) |
| 174 | gitCheckoutSucceeded = True |
| 175 | run('git merge --ff-only', rememberFailure=False) # Ignore failure on non-branch ref |
| 176 | |
| 177 | code = run('ant clean') |
| 178 | if 0 != code: |
| 179 | raise RuntimeError('ERROR: "ant clean" failed. See above.') |
| 180 | |
| 181 | def groupTestsByModule(tests): |
| 182 | modules = {} |