# Copyright (c) 2020 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("//build_overrides/nlunit_test.gni")

import("${chip_root}/build/chip/chip_test_suite.gni")

chip_test_suite_using_nltest("tests") {
  output_name = "libControllerTests"

  test_sources = [ "TestCommissionableNodeController.cpp" ]

  if (chip_device_platform != "mbed" && chip_device_platform != "efr32" &&
      chip_device_platform != "esp32") {
    test_sources += [ "TestServerCommandDispatch.cpp" ]
    test_sources += [ "TestEventChunking.cpp" ]
    test_sources += [ "TestEventCaching.cpp" ]
    test_sources += [ "TestReadChunking.cpp" ]
    test_sources += [ "TestWriteChunking.cpp" ]
    test_sources += [ "TestEventNumberCaching.cpp" ]
  }

  cflags = [ "-Wconversion" ]

  public_deps = [
    "${chip_root}/src/app/common:cluster-objects",
    "${chip_root}/src/app/tests:helpers",
    "${chip_root}/src/controller",
    "${chip_root}/src/lib/support:testing",
    "${chip_root}/src/messaging/tests:helpers",
    "${chip_root}/src/transport/raw/tests:helpers",
    "${nlunit_test_root}:nlunit-test",
  ]

  if (chip_device_platform != "mbed") {
    public_deps += [ "${chip_root}/src/controller/data_model" ]
  }
}
