From 0569f074f3a55448fb9a5c1039337a4b114c7673 Mon Sep 17 00:00:00 2001 From: Thai Duong Date: Wed, 4 Apr 2018 13:48:52 -0700 Subject: [PATCH] Fixing the open source build. PiperOrigin-RevId: 191640973 GitOrigin-RevId: e1253df8c8c78a305d746a48778e1aed07cd48fe --- BUILD.bazel | 73 +++++++++++++++++++------------------------- kokoro/continuous.sh | 4 +-- kokoro/presubmit.sh | 7 ----- 3 files changed, 33 insertions(+), 51 deletions(-) diff --git a/BUILD.bazel b/BUILD.bazel index 4ba1272..9c13790 100644 --- a/BUILD.bazel +++ b/BUILD.bazel @@ -4,9 +4,13 @@ java_library( name = "utils", srcs = [ "java/com/google/security/wycheproof/EcUtil.java", + "java/com/google/security/wycheproof/JsonUtil.java", "java/com/google/security/wycheproof/RandomUtil.java", "java/com/google/security/wycheproof/TestUtil.java", ], + deps = [ + "@com_google_code_gson", + ], ) common_deps = [ @@ -20,9 +24,8 @@ test_srcs = glob([ "java/**/testcases/*Test.java", ]) -# These targets run all tests. - -load("//tools:build_defs.bzl", "bouncycastle_all_tests", "spongycastle_all_tests") +# Bouncy Castle tests +load("//tools:build_defs.bzl", "bouncycastle_all_tests", "bouncycastle_tests") # Generates BouncyCastleAllTests_1_xx target for all available versions, # plus a BouncyCastleAllTests alias for latest stable. @@ -37,7 +40,7 @@ load("//tools:build_defs.bzl", "bouncycastle_all_tests", "spongycastle_all_tests # $ bazel test BouncyCastleAllTest_* bouncycastle_all_tests( # This test takes a long time, because key generation for DSA and DH generate new parameters. - size = "large", + size = "enormous", srcs = ["java/com/google/security/wycheproof/BouncyCastleAllTests.java"] + test_srcs, test_class = "com.google.security.wycheproof.BouncyCastleAllTests", deps = common_deps, @@ -45,7 +48,7 @@ bouncycastle_all_tests( java_test( name = "BouncyCastleAllTestsLocal", - size = "large", + size = "enormous", srcs = ["java/com/google/security/wycheproof/BouncyCastleAllTests.java"] + test_srcs, # this target requires specifing a shell variable, thus won't work with the wildcard target patterns. # with tags=["manual"] it'll be excluded from said patterns. @@ -54,29 +57,6 @@ java_test( deps = common_deps + ["@local//:bouncycastle_jar"], ) -# Generates SpongyCastleAllTests_1_xx target for all available versions, -# plus a SpongyCastleAllTests alias for latest stable. -# -# To test latest stable: -# $ bazel test SpongyCastleAllTests -# -# To test other versions, e.g., v1.52.0.0: -# $ bazel test SpongyCastleAllTests_1_52 -# -# To test all known versions (warning, will take a long time): -# $ bazel test SpongyCastleAllTests_* -spongycastle_all_tests( - # This test takes a long time, because key generation for DSA and DH generate new parameters. - size = "large", - srcs = ["java/com/google/security/wycheproof/SpongyCastleAllTests.java"] + test_srcs, - test_class = "com.google.security.wycheproof.SpongyCastleAllTests", - deps = common_deps, -) - -# These targets exclude slow tests. - -load("//tools:build_defs.bzl", "bouncycastle_tests", "spongycastle_tests") - # Generates BouncyCastleTest_1_xx target for all available versions, # plus a BouncyCastleTest alias for latest stable. # @@ -106,6 +86,28 @@ java_test( deps = common_deps + ["@local//:bouncycastle_jar"], ) +# Spongy Castle tests +load("//tools:build_defs.bzl", "spongycastle_all_tests", "spongycastle_tests") + +# Generates SpongyCastleAllTests_1_xx target for all available versions, +# plus a SpongyCastleAllTests alias for latest stable. +# +# To test latest stable: +# $ bazel test SpongyCastleAllTests +# +# To test other versions, e.g., v1.52.0.0: +# $ bazel test SpongyCastleAllTests_1_52 +# +# To test all known versions (warning, will take a long time): +# $ bazel test SpongyCastleAllTests_* +spongycastle_all_tests( + # This test takes a long time, because key generation for DSA and DH generate new parameters. + size = "enormous", + srcs = ["java/com/google/security/wycheproof/SpongyCastleAllTests.java"] + test_srcs, + test_class = "com.google.security.wycheproof.SpongyCastleAllTests", + deps = common_deps, +) + # Generates SpongyCastleTest_1_xx target for all available versions, # plus a SpongyCastleTest alias for latest stable. # @@ -135,7 +137,7 @@ conscrypt_tests( ) conscrypt_all_tests( - size = "large", + size = "enormous", srcs = ["java/com/google/security/wycheproof/ConscryptAllTests.java"] + test_srcs, test_class = "com.google.security.wycheproof.ConscryptAllTests", deps = common_deps, @@ -166,18 +168,7 @@ java_test( deps = common_deps, ) -# Tests using JSON formatted test vectors. - -java_test( - name = "JsonTest", - size = "small", - srcs = ["java/com/google/security/wycheproof/JsonTest.java"] + test_srcs, - data = ["//testvectors:all"], - deps = common_deps, -) - -# javascript - +# WebCrypto Javascript tests load("@io_bazel_rules_closure//closure:defs.bzl", "closure_js_deps") closure_js_deps( diff --git a/kokoro/continuous.sh b/kokoro/continuous.sh index 8c4fd7b..1c6bff6 100644 --- a/kokoro/continuous.sh +++ b/kokoro/continuous.sh @@ -13,8 +13,6 @@ cd git*/wycheproof bazel build ... || exit 1 # Run all tests to generate logs. -bazel test ... - # We don't care about the test results, thus always return successfully. -exit 0 +bazel test ... || exit 0 diff --git a/kokoro/presubmit.sh b/kokoro/presubmit.sh index 8c4fd7b..43a2d5b 100644 --- a/kokoro/presubmit.sh +++ b/kokoro/presubmit.sh @@ -11,10 +11,3 @@ cd git*/wycheproof # Building should work. bazel build ... || exit 1 - -# Run all tests to generate logs. -bazel test ... - -# We don't care about the test results, thus always return successfully. -exit 0 -