| # Copyright (c) 2020-2022 Project CHIP Authors |
| # |
| # Licensed under the Apache License, Version 2.0 (the "License"); |
| # you may not use this file except in compliance with the License. |
| # You may obtain a copy of the License at |
| # |
| # http://www.apache.org/licenses/LICENSE-2.0 |
| # |
| # Unless required by applicable law or agreed to in writing, software |
| # distributed under the License is distributed on an "AS IS" BASIS, |
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| # See the License for the specific language governing permissions and |
| # limitations under the License. |
| |
| import("//build_overrides/build.gni") |
| import("//build_overrides/chip.gni") |
| |
| import("${chip_root}/build/chip/chip_test_suite.gni") |
| import("${chip_root}/build/chip/fuzz_test.gni") |
| |
| static_library("cert_test_vectors") { |
| output_name = "libCertTestVectors" |
| output_dir = "${root_out_dir}/lib" |
| |
| sources = [ |
| "CHIPAttCert_test_vectors.cpp", |
| "CHIPAttCert_test_vectors.h", |
| "CHIPCert_error_test_vectors.cpp", |
| "CHIPCert_error_test_vectors.h", |
| "CHIPCert_test_vectors.cpp", |
| "CHIPCert_test_vectors.h", |
| "CHIPCert_unit_test_vectors.cpp", |
| "CHIPCert_unit_test_vectors.h", |
| ] |
| |
| cflags = [ "-Wconversion" ] |
| |
| public_deps = [ |
| "${chip_root}/src/credentials", |
| "${chip_root}/src/credentials:test_paa_store", |
| ] |
| } |
| |
| chip_test_suite("tests") { |
| output_name = "libCredentialsTest" |
| |
| test_sources = [ |
| "TestCertificationDeclaration.cpp", |
| "TestChipCert.cpp", |
| "TestDeviceAttestationConstruction.cpp", |
| "TestDeviceAttestationCredentials.cpp", |
| "TestFabricTable.cpp", |
| "TestGroupDataProvider.cpp", |
| "TestPersistentStorageOpCertStore.cpp", |
| ] |
| |
| # DUTVectors test requires <dirent.h> which is not supported on all platforms |
| if (chip_device_platform != "openiotsdk" && chip_device_platform != "nxp") { |
| test_sources += [ "TestCommissionerDUTVectors.cpp" ] |
| } |
| |
| cflags = [ "-Wconversion" ] |
| |
| public_deps = [ |
| ":cert_test_vectors", |
| "${chip_root}/src/app/tests/suites/credentials:dac_provider", |
| "${chip_root}/src/controller:controller", |
| "${chip_root}/src/credentials", |
| "${chip_root}/src/credentials:default_attestation_verifier", |
| "${chip_root}/src/credentials:test_dac_revocation_delegate", |
| "${chip_root}/src/lib/core", |
| "${chip_root}/src/lib/core:string-builder-adapters", |
| "${chip_root}/src/lib/support:testing", |
| ] |
| } |
| |
| if (enable_fuzz_test_targets) { |
| chip_fuzz_target("fuzz-chip-cert") { |
| sources = [ "FuzzChipCert.cpp" ] |
| public_deps = [ |
| "${chip_root}/src/credentials", |
| "${chip_root}/src/platform/logging:default", |
| ] |
| } |
| } |
| |
| if (pw_enable_fuzz_test_targets) { |
| chip_pw_fuzz_target("fuzz-chip-cert-pw") { |
| test_source = [ "FuzzChipCertPW.cpp" ] |
| public_deps = [ |
| "${chip_root}/src/credentials", |
| "${chip_root}/src/platform/logging:default", |
| ] |
| } |
| } |