Integrate SCCT (Scala Code Coverage Tool) with Lift Scala project

Table of contents
Reading Time: < 1 minute

Its always a good practice to have a fine test coverage in any project. I am working on Lift framework. I have tried to integrate the SCCT with my lift scala project.

Here, I am going to elaborate a few easy steps to integrate the SCCT in Lift Scala project. I am using scala 2.10.0 and sbt 0.12 version.

1. Add the following lines of code in your plugin.sbt file. You need to add the plugin dependency to your project’s plugins.sbt.

2. Add the following to build.sbt to add SCCT plugin settings:

3. Now, set the path to your project on the terminal and run sbt. This will download the all SCCT dependencies.

4. That’s it. Lets run the SCCT with command scct:test

5. You’ll find the html file with name index.html which would give you the full test report. You’ll find this file in this path /target/scala-2.10/coverage-report/index.html.

6. Run this file on browser and get the test coverage details.

1 thought on “Integrate SCCT (Scala Code Coverage Tool) with Lift Scala project1 min read

  1. Hi,
    1. I have added below dependencies to the plugin.sbt

    resolvers += Classpaths.typesafeResolver

    resolvers += “scct-github-repository” at “http://mtkopone.github.com/scct/maven-repo”

    addSbtPlugin(“reaktor” % “sbt-scct” % “0.2-SNAPSHOT”

    2. added seq(ScctPlugin.instrumentSettings: _*) this line in my Build.scala file

    3. after that i did; sbt clean compile

    4. now when i ran the scct:test or sbt clean scct:test

    getting the follwoing error: [info] Set current project to Pixie Workflow (in build file:/home/anji/project_dev/pixie/pixie-workflow/)
    [error] No such setting/task
    [error] scct:test
    [error] ^

    could please guid me, where I am doing mistake.

    I suspect step 2 not set properly, please guid me.

Comments are closed.

Discover more from Knoldus Blogs

Subscribe now to keep reading and get access to the full archive.

Continue reading