diff options
author | Jan Christopher Vogt <oss.nsp@cvogt.org> | 2016-09-12 15:15:38 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-09-12 15:15:38 +0100 |
commit | 4c889aedae5108cc8d381e9876c1ae956ff078f2 (patch) | |
tree | adc99767f2cdbabe4f27125388746d760d67be08 /test | |
parent | 55e5bad90af19376e3bacbedaea8702456f61d39 (diff) | |
parent | fdab46408ebc1d593794979d21a47a7eb7c2ac22 (diff) | |
download | cbt-4c889aedae5108cc8d381e9876c1ae956ff078f2.tar.gz cbt-4c889aedae5108cc8d381e9876c1ae956ff078f2.tar.bz2 cbt-4c889aedae5108cc8d381e9876c1ae956ff078f2.zip |
Merge pull request #218 from cvogt/fix-stack-traces
Fix stack traces and error message when you forget to extend BaseBuild
Diffstat (limited to 'test')
-rw-r--r-- | test/forgot-extend/build/build.scala | 2 | ||||
-rw-r--r-- | test/test.scala | 11 |
2 files changed, 10 insertions, 3 deletions
diff --git a/test/forgot-extend/build/build.scala b/test/forgot-extend/build/build.scala new file mode 100644 index 0000000..9181a5d --- /dev/null +++ b/test/forgot-extend/build/build.scala @@ -0,0 +1,2 @@ +import cbt._ +class Build(val context: Context) diff --git a/test/test.scala b/test/test.scala index 7bbf1d9..0158ddd 100644 --- a/test/test.scala +++ b/test/test.scala @@ -75,8 +75,8 @@ object Main{ def clean(path: String)(implicit logger: Logger) = { val res = runCbt(path, Seq("clean", "dry-run", "force")) - val debugToken = "\n"++lib.red("Deleting") ++ " " ++ Paths.get("test/"++path++"/target").toAbsolutePath.toString++"\n" - val debugToken2 = "\n"++lib.red("Deleting") ++ " " ++ Paths.get("test/"++path).toAbsolutePath.toString++"\n" + val debugToken = "\n"++lib.red("Deleting") ++ " " ++ (cbtHome ++("/test/"++path++"/target")).toPath.toAbsolutePath.toString++"\n" + val debugToken2 = "\n"++lib.red("Deleting") ++ " " ++ (cbtHome ++("/test/"++path)).toPath.toAbsolutePath.toString++"\n" assertSuccess(res,debugToken) assert(res.out == "", debugToken ++ " " ++ res.toString) assert(res.err.contains(debugToken), debugToken ++ " " ++ res.toString) @@ -87,7 +87,7 @@ object Main{ res.err.split("\n").filter(_.startsWith(lib.red("Deleting"))).foreach{ line => assert( line.size >= debugToken2.trim.size, - "Tried to delete too much: " ++ line + "Tried to delete too much: " ++ line ++" debugToken2: " ++ debugToken2 ) } } @@ -196,6 +196,11 @@ object Main{ task("fullOptJS","../examples/scalajs-react-example/js") compile("../examples/uber-jar-example") + { + val res = runCbt("forgot-extend", Seq("run")) + assert(!res.exit0) + assert(res.err contains "Build cannot be cast to cbt.BuildInterface", res.err) + } System.err.println(" DONE!") System.err.println( successes.toString ++ " succeeded, "++ failures.toString ++ " failed" ) |