aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorJan Christopher Vogt <oss.nsp@cvogt.org>2017-03-11 18:58:56 -0500
committerGitHub <noreply@github.com>2017-03-11 18:58:56 -0500
commit4eb753e4d4ef5be7443b99832892bac697b10b50 (patch)
treed9200d33f7d2f9b1ed9884330fcd4c6ca651f44a /test
parente760ee9e4c4c3b3f39e2bb2dfd47d2b142e12a53 (diff)
parentcf859909fbcf577bac92d9f35f5d11e638a66177 (diff)
downloadcbt-4eb753e4d4ef5be7443b99832892bac697b10b50.tar.gz
cbt-4eb753e4d4ef5be7443b99832892bac697b10b50.tar.bz2
cbt-4eb753e4d4ef5be7443b99832892bac697b10b50.zip
Merge pull request #412 from cvogt/chris
various
Diffstat (limited to 'test')
-rw-r--r--test/simple-fixed/Main.scala2
-rw-r--r--test/simple-fixed/build/build.scala18
-rw-r--r--test/simple/Main.scala3
-rw-r--r--test/simple/build/build.scala5
-rw-r--r--test/test.scala44
5 files changed, 34 insertions, 38 deletions
diff --git a/test/simple-fixed/Main.scala b/test/simple-fixed/Main.scala
index 75f9349..54c764c 100644
--- a/test/simple-fixed/Main.scala
+++ b/test/simple-fixed/Main.scala
@@ -1,6 +1,4 @@
import lib_test.Foo
-import org.eclipse.jgit.lib.Ref
-import com.spotify.missinglink.ArtifactLoader
object Main extends App{
println(Foo.bar)
}
diff --git a/test/simple-fixed/build/build.scala b/test/simple-fixed/build/build.scala
index b46c337..0215c43 100644
--- a/test/simple-fixed/build/build.scala
+++ b/test/simple-fixed/build/build.scala
@@ -7,23 +7,5 @@ class Build(context: cbt.Context) extends BasicBuild(context){
Seq(
GitDependency("https://github.com/cvogt/cbt.git", "f11b8318b85f16843d8cfa0743f64c1576614ad6", Some("test/library-test"))
)
- ++
- Resolver(mavenCentral).bind(
- ScalaDependency("com.typesafe.play", "play-json", "2.4.4"),
- MavenDependency("joda-time", "joda-time", "2.9.2"),
- // the below tests pom inheritance with dependencyManagement and variable substitution for pom properties
- MavenDependency("org.eclipse.jgit", "org.eclipse.jgit", "4.2.0.201601211800-r"),
- // the below tests pom inheritance with variable substitution for pom xml tag contents
- MavenDependency("com.spotify", "missinglink-core", "0.1.1")
- )
- ++
- Resolver(
- mavenCentral,
- bintray("tpolecat"),
- sonatypeSnapshots
- ).bind(
- "org.cvogt" %% "play-json-extensions" % "0.8.0",
- "ai.x" %% "lens" % "1.0.0"
- )
)
}
diff --git a/test/simple/Main.scala b/test/simple/Main.scala
index 75f9349..c742110 100644
--- a/test/simple/Main.scala
+++ b/test/simple/Main.scala
@@ -1,6 +1,5 @@
-import lib_test.Foo
import org.eclipse.jgit.lib.Ref
import com.spotify.missinglink.ArtifactLoader
object Main extends App{
- println(Foo.bar)
+ println("hello, world")
}
diff --git a/test/simple/build/build.scala b/test/simple/build/build.scala
index a132dd1..517dd83 100644
--- a/test/simple/build/build.scala
+++ b/test/simple/build/build.scala
@@ -4,9 +4,6 @@ class Build(val context: cbt.Context) extends BaseBuild{
override def dependencies = (
super.dependencies
++
- Seq(
- GitDependency("https://github.com/cvogt/cbt.git", "f11b8318b85f16843d8cfa0743f64c1576614ad6", Some("test/library-test"))
- ) ++
// FIXME: make the below less verbose
Resolver( mavenCentral ).bind(
ScalaDependency("com.typesafe.play", "play-json", "2.4.4"),
@@ -38,6 +35,6 @@ class Build(val context: cbt.Context) extends BaseBuild{
"ai.x" %% "lens" % "1.0.0"
)
)
-
+
def printArgs = context.args.mkString(" ")
}
diff --git a/test/test.scala b/test/test.scala
index 59a85ac..45315ce 100644
--- a/test/test.scala
+++ b/test/test.scala
@@ -15,10 +15,20 @@ object Main{
val lib = new Lib(logger)
val cbtHome = new File(System.getenv("CBT_HOME"))
+
+ val slow = (
+ System.getenv("CIRCLECI") != null // enable only on circle
+ || args.args.contains("slow")
+ )
+ val compat = !args.args.contains("no-compat")
+
+ if(!slow) System.err.println( "Skipping slow tests" )
+ if(!compat) System.err.println( "Skipping cbt version compatibility tests" )
+
var successes = 0
var failures = 0
def assertException[T:scala.reflect.ClassTag](msg: String = "")(code: => Unit)(implicit logger: Logger) = {
- try{
+ try{
code
assert(false, msg)
}catch{ case _:AssertionError => }
@@ -187,9 +197,11 @@ object Main{
usage("simple")
compile("simple")
clean("simple")
- usage("simple-fixed")
- compile("simple-fixed")
-
+ if( compat ){
+ usage("simple-fixed")
+ compile("simple-fixed")
+ }
+
compile("../plugins/sbt_layout")
compile("../plugins/scalafmt")
compile("../plugins/scalajs")
@@ -200,8 +212,12 @@ object Main{
compile("../examples/scalafmt-example")
compile("../examples/scalariform-example")
compile("../examples/scalatest-example")
- compile("../examples/scalajs-react-example/js")
- compile("../examples/scalajs-react-example/jvm")
+ if(slow){
+ compile("../examples/scalajs-react-example/js")
+ compile("../examples/scalajs-react-example/jvm")
+ compile("../examples/scalajs-plain-example/js")
+ compile("../examples/scalajs-plain-example/jvm")
+ }
compile("../examples/multi-standalone-example")
compile("../examples/multi-combined-example")
if(sys.props("java.version").startsWith("1.7")){
@@ -209,19 +225,23 @@ object Main{
} else {
compile("../examples/dotty-example")
task("run","../examples/dotty-example")
- task("dottydoc","../examples/dotty-example")
+ if(slow){
+ task("dottydoc","../examples/dotty-example")
+ }
+ }
+ if(slow){
+ task("compile","../examples/scalajs-react-example/js")
+ task("fullOpt.compile","../examples/scalajs-react-example/js")
}
- task("compile","../examples/scalajs-react-example/js")
- task("fullOpt.compile","../examples/scalajs-react-example/js")
compile("../examples/uber-jar-example")
-
- {
+
+ if( compat ){
val res = task("docJar","simple-fixed-cbt")
assert( res.out endsWith "simple-fixed-cbt_2.11-0.1-javadoc.jar\n", res.out )
assert( res.err contains "model contains", res.err )
assert( res.err endsWith "documentable templates\n", res.err )
}
-
+
{
val res = runCbt("simple", Seq("printArgs","1","2","3"))
assert(res.exit0)