Search code examples
chisel

Chisel how to test only one package


I am working with chisel-template

In my src/main/scala I have two folders, let say A and B.

In src/test/scala, I have a folder for A and a folder for B.

I want to test only A but when I do

$ sbt "test:runMain A.TestMain" 

I have the errors of B which make the compilation fail. I know there are problems in B but I just want to check A first.

How can I test or compile only one folder ?

Thanks !


Solution

  • I don't think there is a way to do this. But if you use scalatest to launch your tests instead of a main it's fairly easy. You can specify just the path you want with testOnly for example, from sbt command line

    testOnly A.*
    

    Or from the shell command line

    sbt 'testOnly A.*'
    

    In fact, with tests you can even specify specific tests within a test harness by using

    sbt 'testOnly A.* -- -z "dog"'
    

    (notes, the quoting is significant), you can run only those tests in package a that have the word dog in the test name