Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

windows: language-support java codegen tests #1542

Merged
merged 1 commit into from
Jun 6, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
windows: language-support java codegen tests
  • Loading branch information
majcherm-da committed Jun 6, 2019
commit 95421a9dab2b7433c7a401087867d2d899e88b7c
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