mirror of
https://github.com/sbt/sbt.git
synced 2026-08-30 17:54:25 +02:00
apply formatting
This commit is contained in:
@@ -15,7 +15,9 @@ class ScriptRunner {
|
||||
def processStatement(handler: StatementHandler, statement: Statement): Unit = {
|
||||
val state = states(handler).asInstanceOf[handler.State]
|
||||
val nextState =
|
||||
try { Right(handler(statement.command, statement.arguments, state)) } catch {
|
||||
try {
|
||||
Right(handler(statement.command, statement.arguments, state))
|
||||
} catch {
|
||||
case e: Exception => Left(e)
|
||||
}
|
||||
nextState match {
|
||||
@@ -42,7 +44,9 @@ class ScriptRunner {
|
||||
statements foreach (Function.tupled(processStatement))
|
||||
} finally {
|
||||
for (handler <- handlers; state <- states.get(handler)) {
|
||||
try { handler.finish(state.asInstanceOf[handler.State]) } catch { case e: Exception => () }
|
||||
try {
|
||||
handler.finish(state.asInstanceOf[handler.State])
|
||||
} catch { case e: Exception => () }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -75,21 +75,22 @@ final class ScriptedTests(
|
||||
val g = groupDir.getName
|
||||
val n = nme.getName
|
||||
val str = s"$g / $n"
|
||||
() =>
|
||||
{
|
||||
println("Running " + str)
|
||||
testResources.readWriteResourceDirectory(g, n) { testDirectory =>
|
||||
val disabled = new File(testDirectory, "disabled").isFile
|
||||
if (disabled) {
|
||||
log.info("D " + str + " [DISABLED]")
|
||||
None
|
||||
} else {
|
||||
try { scriptedTest(str, testDirectory, prescripted, log); None } catch {
|
||||
case _: TestException | _: PendingTestSuccessException => Some(str)
|
||||
}
|
||||
() => {
|
||||
println("Running " + str)
|
||||
testResources.readWriteResourceDirectory(g, n) { testDirectory =>
|
||||
val disabled = new File(testDirectory, "disabled").isFile
|
||||
if (disabled) {
|
||||
log.info("D " + str + " [DISABLED]")
|
||||
None
|
||||
} else {
|
||||
try {
|
||||
scriptedTest(str, testDirectory, prescripted, log); None
|
||||
} catch {
|
||||
case _: TestException | _: PendingTestSuccessException => Some(str)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -149,7 +150,9 @@ final class ScriptedTests(
|
||||
case e: Exception =>
|
||||
testFailed()
|
||||
if (!pending) throw e
|
||||
} finally { buffered.clearBuffer() }
|
||||
} finally {
|
||||
buffered.clearBuffer()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user