Skip to content

Commit

Permalink
windows: language-support java codegen tests (digital-asset#1542)
Browse files Browse the repository at this point in the history
  • Loading branch information
majcherm-da authored Jun 6, 2019
1 parent fb60f4d commit 90c854f
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 6 deletions.
2 changes: 2 additions & 0 deletions build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ bazel build `-`-experimental_execution_log_file ${ARTIFACT_DIRS}/build_execution
//language-support/java/testkit:testkit `
//language-support/java/bindings/... `
//language-support/java/bindings-rxjava/... `
//language-support/java/codegen/... `
//ledger/... `
//ledger-api/... `
//navigator/backend/... `
Expand All @@ -64,6 +65,7 @@ bazel test `-`-experimental_execution_log_file ${ARTIFACT_DIRS}/test_execution_w
//daml-lf/... `
//language-support/java/bindings/... `
//language-support/java/bindings-rxjava/... `
//language-support/java/codegen/... `
//ledger/ledger-api-client/... `
//ledger/ledger-api-common/... `
//ledger-api/... `
Expand Down
1 change: 1 addition & 0 deletions language-support/java/codegen/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ test_deps = [
"//3rdparty/jvm/org/scalatest",
"//3rdparty/jvm/org/scalaz:scalaz_core",
"//3rdparty/jvm/com/google/protobuf:protobuf_java",
"//bazel_tools/runfiles:scala_runfiles",
"//daml-lf/archive:daml_lf_java_proto",
"//daml-lf/data",
"//daml-lf/interface",
Expand Down
4 changes: 2 additions & 2 deletions language-support/java/codegen/codegen.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,14 @@ def dar_to_java(**kwargs):
outs = [mangle(src_jar)],
cmd = """
$(execpath //language-support/java/codegen:codegen) -o {gen_out} -d com.daml.ledger.javaapi.TestDecoder {gen_in}
$(execpath @local_jdk//:bin/jar) -cf $@ -C {gen_out} .
$(execpath @bazel_tools//tools/jdk:jar) -cf $@ -C {gen_out} .
""".format(
gen_in = "$(location %s)=%s" % (dar, package_prefix),
gen_out = src_out,
),
tools = [
"//language-support/java/codegen:codegen",
"@local_jdk//:bin/jar",
"@bazel_tools//tools/jdk:jar",
],
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import com.daml.ledger.javaapi.data.{
Transaction,
Unit => DamlUnit
}
import com.digitalasset.daml.bazeltools.BazelRunfiles
import com.digitalasset.ledger.api.v1.CommandServiceOuterClass.SubmitAndWaitRequest
import com.digitalasset.ledger.api.v1.TransactionServiceOuterClass.{
GetLedgerEndRequest,
Expand All @@ -44,10 +45,11 @@ import tests.wolpertinger.{Color, Wolpertinger}
import scala.collection.JavaConverters._
import scala.language.implicitConversions
import com.digitalasset.ledger.api.domain.LedgerId

@SuppressWarnings(Array("org.wartremover.warts.Any"))
class CodegenLedgerTest extends FlatSpec with Matchers {
class CodegenLedgerTest extends FlatSpec with Matchers with BazelRunfiles {

def testDalf = new File("language-support/java/codegen/ledger-tests-model.dar")
def testDalf = new File(rlocation("language-support/java/codegen/ledger-tests-model.dar"))

val LedgerID = "ledger-test"
def withClient(testCode: Channel => Assertion): Assertion = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,19 @@ package com.digitalasset.daml.lf.codegen
import java.io.File
import java.nio.file.Files

import com.digitalasset.daml.bazeltools.BazelRunfiles
import com.digitalasset.daml.lf.codegen.backend.java.JavaBackend
import com.digitalasset.daml.lf.codegen.conf.Conf
import org.scalatest.{FlatSpec, Matchers}

@SuppressWarnings(Array("org.wartremover.warts.Any"))
class CodeGenRunnerTests extends FlatSpec with Matchers {
class CodeGenRunnerTests extends FlatSpec with Matchers with BazelRunfiles {

behavior of "collectDamlLfInterfaces"

def path(p: String) = new File(p).getAbsoluteFile.toPath

val testDar = path("language-support/java/codegen/test-daml.dar")
val testDar = path(rlocation("language-support/java/codegen/test-daml.dar"))

val dummyOutputDir = Files.createTempDirectory("codegen")

Expand Down

0 comments on commit 90c854f

Please sign in to comment.