Run pre hook only after checking disabled tests

This commit is contained in:
jvican 2017-05-02 00:48:26 +02:00
parent 0ee3585b6d
commit 210dcde822
No known key found for this signature in database
GPG Key ID: 42DAFA0F112E8050
1 changed files with 9 additions and 9 deletions

View File

@ -140,17 +140,17 @@ final class ScriptedTests(resourceBaseDirectory: File,
// Copy test's contents and reload the sbt instance to pick them up // Copy test's contents and reload the sbt instance to pick them up
IO.copyDirectory(originalDir, tempTestDir) IO.copyDirectory(originalDir, tempTestDir)
// Reload and initialize (to reload contents of .sbtrc files) val runTest = () => {
val sbtHandler = handlers.getOrElse('>', sys.error("Missing sbt handler.")) // Reload and initialize (to reload contents of .sbtrc files)
val statement = val sbtHandler = handlers.getOrElse('>', sys.error("Missing sbt handler."))
Statement(";reload;initialize", Nil, successExpected = true, line = -1) val statement =
runner.processStatement(sbtHandler.asInstanceOf[SbtHandler], statement, states) Statement(";reload;initialize", Nil, successExpected = true, line = -1)
runner.processStatement(sbtHandler.asInstanceOf[SbtHandler], statement, states)
commonRunTest(label, tempTestDir, preHook, handlers, runner, states, buffer)
}
val runTest = // Run the test and delete files (except global that holds local scala jars)
() => commonRunTest(label, tempTestDir, preHook, handlers, runner, states, buffer)
val result = runOrHandleDisabled(label, tempTestDir, runTest, buffer) val result = runOrHandleDisabled(label, tempTestDir, runTest, buffer)
// Delete test's files and clear buffer if successful
IO.delete(tempTestDir.*("*" -- "global").get) IO.delete(tempTestDir.*("*" -- "global").get)
result result
} }