Skip to content

Commit

Permalink
Generated test files was compared against themselves. Now output dire…
Browse files Browse the repository at this point in the history
…ctory is located in target.
  • Loading branch information
davidlar committed Mar 2, 2015
1 parent 521d41e commit a41f691
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions scalabuff-compiler/src/test/tests/ScalaBuffTest.scala
Original file line number Diff line number Diff line change
Expand Up @@ -17,22 +17,24 @@ class ScalaBuffTest extends FunSuite with Matchers {

val parsedExtension = ".txt"

val outputDir = "scalabuff-compiler" + / + "src" + / + "test" + /
val testSrcDir = "scalabuff-compiler" + / + "src" + / + "test" + /

val protoDir = outputDir + "resources" + / + "proto" + /
val multiProtoDir = outputDir + "resources" + / + "multipleprototests" + /
val parsedDir = outputDir + "resources" + / + "parsed" + /
val protoDir = testSrcDir + "resources" + / + "proto" + /
val multiProtoDir = testSrcDir + "resources" + / + "multipleprototests" + /
val parsedDir = testSrcDir + "resources" + / + "parsed" + /
val resourcesGeneratedDir = "resources" + / + "generated" + /
val generatedDir = outputDir + resourcesGeneratedDir
val generatedDir = testSrcDir + resourcesGeneratedDir

val testProto = "simple"
val testProtoParsed = io.Source.fromFile(new File(parsedDir + testProto.capitalize + parsedExtension), "UTF-8").mkString
val testProtoGenerated = io.Source.fromFile(new File(generatedDir + testProto.capitalize + ".scala"), "UTF-8").mkString

val testProtoMulti = "multi_one"

val testProtoPacked = "packed"

val outputDir = "scalabuff-compiler" + / + "target" + / + "test" + /
new File(outputDir).mkdirs()

test("apply: simple .proto file") {
val settings = ScalaBuff.Settings(generateJsonMethod = true)
val scalaClass: ScalaClass = ScalaBuff(new File(protoDir + testProto + ".proto"))(settings)
Expand Down Expand Up @@ -138,6 +140,7 @@ class ScalaBuffTest extends FunSuite with Matchers {
ScalaBuff.run(Array("--scala_out=" + outputDir,
"--proto_path=" + protoDir,
"--verbose",
"--generate_json_method",
protoFile))
outputStream.toString("utf-8").split("\n").size should be(1)
}
Expand Down

0 comments on commit a41f691

Please sign in to comment.