Skip to content

Commit

Permalink
Reactivate TranslatorTest case
Browse files Browse the repository at this point in the history
Signed-off-by: reidspencer <reid.spencer@yoppworks.com>
  • Loading branch information
reid-spencer committed Nov 13, 2022
1 parent 8a55d31 commit 762856e
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 10 deletions.
2 changes: 1 addition & 1 deletion language/src/test/input/everything.riddl
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// RIDDL is about defining domains so ...
domain Everything by author Reid is {

author Reid is { ??? }
author Reid is { name: "Reid" email: "reid@ossum.biz" }

type SomeType is String
command DoAThing is { thingField: Integer }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,28 +53,35 @@ class TranslatorTest extends ValidatingTest {
}
}

val directory = "examples/src/riddl/"
val output = "examples/target/translator/"
val roots = Map("Reactive BBQ" -> "ReactiveBBQ/ReactiveBBQ.riddl")
val directory = "language/src/test/input/"
val output = "language/target/translator-test/"
val roots = Seq(
"domains/simpleDomain.riddl",
"everything.riddl"
)

"Translator" should {
pending // this needs to move to riddl-examples repository
for { (name, fileName) <- roots } {
s"translate $name" in {
for { fileName <- roots } {
s"translate $fileName" in {
val tt = new TestTranslator
val logger = StringLogger()
val inputPath = Path.of(directory).resolve(fileName)
val options = TestTranslatingOptions(outputDir =
Some(Path.of(s"language/target/translator-test").resolve(fileName))
Some(Path.of(output).resolve(fileName))
)
tt.parseValidateTranslate(
inputPath,
logger,
CommonOptions(showStyleWarnings = false, showMissingWarnings = false),
options
) match {
case Right(_) => succeed
case Left(messages) => fail(messages.format)
case Right(_) => succeed
case Left(messages) =>
val errors = messages.justErrors
if (errors.isEmpty) {
info(messages.format)
succeed
} else { fail(messages.format) }
}
}
}
Expand Down

0 comments on commit 762856e

Please sign in to comment.