diff options
Diffstat (limited to 'test/test.scala')
-rw-r--r-- | test/test.scala | 53 |
1 files changed, 38 insertions, 15 deletions
diff --git a/test/test.scala b/test/test.scala index 811e619..2c4f391 100644 --- a/test/test.scala +++ b/test/test.scala @@ -1,12 +1,14 @@ import cbt._ import cbt.paths._ import scala.collection.immutable.Seq +import java.io.File // micro framework object Main{ def main(_args: Array[String]): Unit = { val args = new Stage1ArgsParser(_args.toVector) implicit val logger: Logger = new Logger(args.enabledLoggers) + val lib = new Lib(logger) var successes = 0 var failures = 0 @@ -69,19 +71,14 @@ object Main{ logger.test( "Running tests " ++ _args.toList.toString ) - usage("nothing") - compile("nothing") - usage("multi-build") - compile("multi-build") - usage("simple") - compile("simple") - { val noContext = Context(cbtHome ++ "/test/nothing", Seq(), logger, false, new ClassLoaderCache(logger)) val b = new Build(noContext){ override def dependencies = Seq( - JavaDependency("net.incongru.watchservice","barbary-watchservice","1.0"), - JavaDependency("net.incongru.watchservice","barbary-watchservice","1.0") + MavenRepository.central.resolve( + MavenDependency("net.incongru.watchservice","barbary-watchservice","1.0"), + MavenDependency("net.incongru.watchservice","barbary-watchservice","1.0") + ) ) } val cp = b.classpath @@ -90,22 +87,48 @@ object Main{ // test that messed up artifacts crash with an assertion (which should tell the user what's up) assertException[AssertionError](){ - JavaDependency("com.jcraft", "jsch", " 0.1.53").classpath + MavenRepository.central.resolveOne( MavenDependency("com.jcraft", "jsch", " 0.1.53") ).classpath } assertException[AssertionError](){ - JavaDependency("com.jcraft", null, "0.1.53").classpath + MavenRepository.central.resolveOne( MavenDependency("com.jcraft", null, "0.1.53") ).classpath } assertException[AssertionError](){ - JavaDependency("com.jcraft", "", " 0.1.53").classpath + MavenRepository.central.resolveOne( MavenDependency("com.jcraft", "", " 0.1.53") ).classpath } assertException[AssertionError](){ - JavaDependency("com.jcraft%", "jsch", " 0.1.53").classpath + MavenRepository.central.resolveOne( MavenDependency("com.jcraft%", "jsch", " 0.1.53") ).classpath } assertException[AssertionError](){ - JavaDependency("", "jsch", " 0.1.53").classpath + MavenRepository.central.resolveOne( MavenDependency("", "jsch", " 0.1.53") ).classpath } - + ( + MavenRepository.combine( + MavenRepository.central, MavenRepository.bintray("tpolecat") + ).resolve( + lib.ScalaDependency("org.tpolecat","tut-core","0.4.2", scalaMajorVersion="2.11") + ).classpath.strings + ++ + MavenRepository.sonatype.resolve( + MavenDependency("org.cvogt","play-json-extensions_2.11","0.8.0") + ).classpath.strings + ++ + MavenRepository.combine( + MavenRepository.central, MavenRepository.sonatypeSnapshots + ).resolve( + MavenDependency("ai.x","lens_2.11","1.0.0-SNAPSHOT") + ).classpath.strings + ).foreach{ + path => assert(new File(path).exists, path) + } + + usage("nothing") + compile("nothing") + usage("multi-build") + compile("multi-build") + usage("simple") + compile("simple") + System.err.println(" DONE!") System.err.println( successes.toString ++ " succeeded, "++ failures.toString ++ " failed" ) if(failures > 0) System.exit(1) else System.exit(0) |