简体   繁体   中英

Difference between Test and test in sbt

For example i can write in my build:

name in Test := "some name"
name in test := "some name"

and both would perfectly work. So what's the difference between them?

In the first case Test is of type configuration. As it is sad in the official docs to sbt:

A configuration defines a flavor of build, potentially with its own classpath, sources, generated packages, etc. 

and the second test is just a simple task defined in the global scope. If you call inspect test in sbt it will show that test just executes all tests and is provided by global scope *:test , it's like an aggregator of all test tasks. The whole task tree under test you can see with inspect tree task command. To inspect Test configuration you should call inspect test:configuration , as you can see it just provides configuration for test scope in your project. So name in test and name in Test have the same result

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM