[micro-ecc] Migrate to new component templates Test: fx test micro-ecc-tests Change-Id: I541fa37ba6aa729480bc8bbf7243f792a7325b37 Reviewed-on: https://fuchsia-review.googlesource.com/c/third_party/github.com/kmackay/micro-ecc/+/498878 Reviewed-by: Shai Barack <shayba@google.com>
diff --git a/BUILD.gn b/BUILD.gn index a37c15e..b21916f 100644 --- a/BUILD.gn +++ b/BUILD.gn
@@ -2,7 +2,7 @@ # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. -import("//build/test/test_package.gni") +import("//src/sys/build/components.gni") # micro-ecc library source_set("micro-ecc") { @@ -56,13 +56,16 @@ # micro-ecc test binaries template("micro_ecc_test") { assert(defined(invoker.sources), "must specify sources") - executable(target_name) { + executable("${target_name}_bin") { testonly = true visibility = [ ":*" ] sources = invoker.sources configs += [ ":micro-ecc-test_config" ] deps = [ ":micro-ecc" ] } + fuchsia_unittest_component(target_name) { + deps = [ ":${target_name}_bin" ] + } } micro_ecc_test("compress_test") { @@ -86,25 +89,11 @@ } # micro-ecc test package -unittest_package("micro-ecc-tests") { - deps = [ +fuchsia_test_package("micro-ecc-tests") { + test_components = [ ":compress_test", ":compute_test", ":ecdh_test", ":ecdsa_test", ] - tests = [ - { - name = "compress_test" - }, - { - name = "compute_test" - }, - { - name = "ecdh_test" - }, - { - name = "ecdsa_test" - }, - ] }