How do you share classes between test configurations using SBT

后端 未结 4 1860
野的像风
野的像风 2021-01-01 18:05

I have followed the instructions on SBT\'s documentation for setting up test configurations. I have three test configurations Test, IntegrationTest, and AcceptanceTest. So m

4条回答
  •  旧巷少年郎
    2021-01-01 18:26

    In case you want to stick with predefined configurations instead of defining new ones, and since both Test and IntegrationTest extend Runtime (one would expect IntegrationTest to extend Test…), you could use the following:

    dependencyClasspath in IntegrationTest := (dependencyClasspath in IntegrationTest).value ++ (exportedProducts in Test).value
    

    This should put all the classes you define in Test on the IntegrationTest classpth.

    ##EDIT:

    I was just became aware to amuch better solution thanks to @mjhoy:

    lazy val DeepIntegrationTest = IntegrationTest.extend(Test)
    

提交回复
热议问题