<commit_before>// Copyright © 2013, <NAME> <www.orfjackal.net>
// This software is released under the Apache License 2.0.
// The license text is at http://www.apache.org/licenses/LICENSE-2.0

package fi.jumi.sbt

import sbt._
import sbt.Keys._
import fi.jumi.launcher.JumiBootstrap

object SbtJumiPlugin extends Plugin {

  val jumiTest = TaskKey[Unit]("jumi-test", "Run tests using Jumi")

  override val settings = Seq(
    jumiTest <<= (fullClasspath in Test) map jumiTestTask dependsOn (compile in Test)
  )

  def jumiTestTask(testClasspath: Classpath) {
    val bootstrap = new JumiBootstrap()
    bootstrap.suite.
      setClassPath(testClasspath map (_.data.toPath): _*).
      addJvmOptions("-ea"). // TODO: parameterize
      setIncludedTestsPattern("glob:**Test.class") // TODO: parameterize
    bootstrap.
      //enableDebugMode().
      runSuite() // TODO: make fail without throwing the exception from here
  }
}
<commit_msg>Hide the failure message's stack trace using sbt.FeedbackProvidedException<commit_after>// Copyright © 2013, <NAME> <www.orfjackal.net>
// This software is released under the Apache License 2.0.
// The license text is at http://www.apache.org/licenses/LICENSE-2.0

package fi.jumi.sbt

import sbt._
import sbt.Keys._
import fi.jumi.launcher.JumiBootstrap

object SbtJumiPlugin extends Plugin {

  val jumiTest = TaskKey[Unit]("jumi-test", "Run tests using Jumi")

  override val settings = Seq(
    jumiTest <<= (fullClasspath in Test) map jumiTestTask dependsOn (compile in Test)
  )

  def jumiTestTask(testClasspath: Classpath) {
    val bootstrap = new JumiBootstrap()
    bootstrap.suite.
      setClassPath(testClasspath map (_.data.toPath): _*).
      addJvmOptions("-ea"). // TODO: parameterize
      setIncludedTestsPattern("glob:**Test.class") // TODO: parameterize
    try {
      bootstrap.runSuite()
    } catch {
      case e: AssertionError => throw new TestsFailedException
    }
  }
}

{'fraction_non_alphanumeric': 0.11277033985581875, 'fraction_numerical': 0.008238928939237899, 'mean_word_length': 3.5933806146572103, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 8, 'https://': 0, 'lorem ipsum': 0, 'www.': 4, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '362713', 'n_tokens_mistral': 629, 'n_tokens_neox': 603, 'n_words': 170}