2022-01-03 19:36:51 +03:00
|
|
|
# Copyright (c) 2022 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved.
|
2019-04-04 11:33:38 +03:00
|
|
|
# SPDX-License-Identifier: Apache-2.0
|
|
|
|
|
|
|
|
load(
|
2019-04-12 14:10:16 +03:00
|
|
|
"//rules_daml:daml.bzl",
|
2021-06-23 13:39:10 +03:00
|
|
|
"daml_build_test",
|
2019-04-12 14:10:16 +03:00
|
|
|
"daml_compile",
|
2019-04-04 11:33:38 +03:00
|
|
|
)
|
2021-06-08 12:49:02 +03:00
|
|
|
load(
|
|
|
|
"//daml-lf/language:daml-lf.bzl",
|
|
|
|
"lf_version_configuration",
|
|
|
|
)
|
2019-04-04 11:33:38 +03:00
|
|
|
|
|
|
|
TEST_FILES = \
|
2019-04-12 14:10:16 +03:00
|
|
|
[
|
|
|
|
"BasicTests",
|
|
|
|
"AuthorizedDivulgence",
|
2019-11-01 18:14:25 +03:00
|
|
|
"DontDiscloseNonConsumingExercisesToObservers",
|
2019-04-12 14:10:16 +03:00
|
|
|
"LargeTransaction",
|
|
|
|
"ConjunctionChoices",
|
2020-05-27 17:27:50 +03:00
|
|
|
"ContractKeys",
|
2021-10-18 14:33:23 +03:00
|
|
|
"AuthTests",
|
2019-04-12 14:10:16 +03:00
|
|
|
]
|
2019-04-04 11:33:38 +03:00
|
|
|
|
|
|
|
[
|
2019-04-12 14:10:16 +03:00
|
|
|
daml_compile(
|
|
|
|
name = name,
|
2020-03-19 02:06:55 +03:00
|
|
|
srcs = ["%s.daml" % name],
|
2021-12-20 21:31:06 +03:00
|
|
|
enable_scenarios = True,
|
2019-04-12 14:10:16 +03:00
|
|
|
visibility = ["//daml-lf:__subpackages__"],
|
|
|
|
)
|
|
|
|
for name in TEST_FILES
|
2019-04-04 11:33:38 +03:00
|
|
|
]
|
|
|
|
|
|
|
|
daml_compile(
|
2019-04-12 14:10:16 +03:00
|
|
|
name = "Optional",
|
2020-03-19 02:06:55 +03:00
|
|
|
srcs = ["Optional.daml"],
|
2019-04-12 14:10:16 +03:00
|
|
|
visibility = ["//daml-lf:__subpackages__"],
|
2019-04-04 11:33:38 +03:00
|
|
|
)
|
|
|
|
|
2021-04-16 17:43:02 +03:00
|
|
|
daml_compile(
|
|
|
|
name = "Exceptions",
|
|
|
|
srcs = ["Exceptions.daml"],
|
|
|
|
visibility = ["//daml-lf:__subpackages__"],
|
|
|
|
)
|
|
|
|
|
2021-11-18 19:40:03 +03:00
|
|
|
daml_compile(
|
|
|
|
name = "Interfaces",
|
|
|
|
srcs = ["Interfaces.daml"],
|
|
|
|
target = "1.dev",
|
|
|
|
visibility = ["//daml-lf:__subpackages__"],
|
|
|
|
)
|
|
|
|
|
2021-06-23 13:39:10 +03:00
|
|
|
daml_build_test(
|
|
|
|
name = "ReinterpretTests",
|
|
|
|
dar_dict = {
|
|
|
|
"//daml-lf/tests:AtVersion13.dar": "at-version-13.dar",
|
|
|
|
"//daml-lf/tests:AtVersion14.dar": "at-version-14.dar",
|
|
|
|
},
|
|
|
|
project_dir = "reinterpret",
|
|
|
|
visibility = ["//daml-lf:__subpackages__"],
|
|
|
|
)
|
|
|
|
|
|
|
|
daml_compile(
|
|
|
|
name = "AtVersion13",
|
|
|
|
srcs = ["reinterpret/AtVersion13.daml"],
|
|
|
|
target = "1.13",
|
|
|
|
visibility = ["//daml-lf:__subpackages__"],
|
|
|
|
)
|
|
|
|
|
|
|
|
daml_compile(
|
|
|
|
name = "AtVersion14",
|
|
|
|
srcs = ["reinterpret/AtVersion14.daml"],
|
|
|
|
target = "1.14",
|
|
|
|
visibility = ["//daml-lf:__subpackages__"],
|
|
|
|
)
|
|
|
|
|
2021-05-03 13:59:57 +03:00
|
|
|
daml_compile(
|
|
|
|
name = "MultiKeys",
|
|
|
|
srcs = ["MultiKeys.daml"],
|
|
|
|
visibility = ["//daml-lf:__subpackages__"],
|
|
|
|
)
|
|
|
|
|
2019-04-04 11:33:38 +03:00
|
|
|
[
|
2019-04-12 14:10:16 +03:00
|
|
|
sh_test(
|
|
|
|
name = name + "-test",
|
|
|
|
size = "small",
|
|
|
|
srcs = ["daml-lf-test.sh"],
|
|
|
|
args = [
|
|
|
|
"$(location //daml-lf/repl:repl)",
|
2021-03-17 12:31:37 +03:00
|
|
|
"$(location //compiler/damlc:damlc-compile-only)",
|
2019-04-15 17:45:08 +03:00
|
|
|
"$(location :%s.dar)" % name,
|
2019-04-12 14:10:16 +03:00
|
|
|
],
|
|
|
|
data = [
|
2021-03-17 12:31:37 +03:00
|
|
|
"//compiler/damlc:damlc-compile-only",
|
2019-04-12 14:10:16 +03:00
|
|
|
"//daml-lf/repl",
|
2019-04-15 17:45:08 +03:00
|
|
|
":%s.dar" % name,
|
2019-04-12 14:10:16 +03:00
|
|
|
],
|
2019-05-14 17:18:55 +03:00
|
|
|
deps = [
|
|
|
|
"@bazel_tools//tools/bash/runfiles",
|
|
|
|
],
|
2019-04-12 14:10:16 +03:00
|
|
|
)
|
|
|
|
for name in TEST_FILES
|
2019-04-04 11:33:38 +03:00
|
|
|
]
|
|
|
|
|
|
|
|
[
|
2019-04-12 14:10:16 +03:00
|
|
|
sh_test(
|
2020-06-23 18:08:37 +03:00
|
|
|
name = "test-scenario-stable-" + file.split("/")[2],
|
2019-05-14 17:18:55 +03:00
|
|
|
size = "medium",
|
2019-04-12 14:10:16 +03:00
|
|
|
srcs = ["scenario/test.sh"],
|
|
|
|
args = [
|
|
|
|
"$(location //daml-lf/repl:repl)",
|
2021-03-17 12:31:37 +03:00
|
|
|
"$(location //compiler/damlc:damlc-compile-only)",
|
2019-04-12 14:10:16 +03:00
|
|
|
"$(location :%s)" % file,
|
2019-11-26 12:06:44 +03:00
|
|
|
"$(POSIX_DIFF)",
|
2020-06-23 18:08:37 +03:00
|
|
|
"false",
|
2019-04-12 14:10:16 +03:00
|
|
|
],
|
|
|
|
data = [
|
2021-03-17 12:31:37 +03:00
|
|
|
"//compiler/damlc:damlc-compile-only",
|
2019-04-12 14:10:16 +03:00
|
|
|
"//daml-lf/repl",
|
|
|
|
file,
|
|
|
|
"%s/EXPECTED.ledger" % "/".join(file.split("/")[0:3]),
|
|
|
|
],
|
2019-11-26 12:06:44 +03:00
|
|
|
toolchains = [
|
|
|
|
"@rules_sh//sh/posix:make_variables",
|
|
|
|
],
|
2019-05-14 17:18:55 +03:00
|
|
|
deps = [
|
|
|
|
"@bazel_tools//tools/bash/runfiles",
|
|
|
|
],
|
2019-04-12 14:10:16 +03:00
|
|
|
)
|
2020-06-23 18:08:37 +03:00
|
|
|
for file in glob(["scenario/stable/*/Test.daml"])
|
|
|
|
]
|
|
|
|
|
|
|
|
[
|
|
|
|
sh_test(
|
|
|
|
name = "test-scenario-dev-" + file.split("/")[2],
|
|
|
|
size = "medium",
|
|
|
|
srcs = ["scenario/test.sh"],
|
|
|
|
args = [
|
|
|
|
"$(location //daml-lf/repl:repl)",
|
2021-03-17 12:31:37 +03:00
|
|
|
"$(location //compiler/damlc:damlc-compile-only)",
|
2020-06-23 18:08:37 +03:00
|
|
|
"$(location :%s)" % file,
|
|
|
|
"$(POSIX_DIFF)",
|
|
|
|
"true",
|
|
|
|
],
|
|
|
|
data = [
|
2021-03-17 12:31:37 +03:00
|
|
|
"//compiler/damlc:damlc-compile-only",
|
2020-06-23 18:08:37 +03:00
|
|
|
"//daml-lf/repl",
|
|
|
|
file,
|
|
|
|
"%s/EXPECTED.ledger" % "/".join(file.split("/")[0:3]),
|
|
|
|
],
|
|
|
|
toolchains = [
|
|
|
|
"@rules_sh//sh/posix:make_variables",
|
|
|
|
],
|
|
|
|
deps = [
|
|
|
|
"@bazel_tools//tools/bash/runfiles",
|
|
|
|
],
|
|
|
|
)
|
|
|
|
for file in glob(["scenario/dev/*/Test.daml"])
|
2019-04-04 11:33:38 +03:00
|
|
|
]
|