# 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 = "libSystemLayerTests"

  test_sources = [
    "TestSystemClock.cpp",
    "TestSystemErrorStr.cpp",
    "TestSystemPacketBuffer.cpp",
    "TestSystemScheduleLambda.cpp",
    "TestSystemTimer.cpp",
    "TestSystemWakeEvent.cpp",
    "TestTimeSource.cpp",
  ]

  if (chip_device_platform != "fake") {
    test_sources += [ "TestSystemScheduleWork.cpp" ]
  }

  # SystemPacketBuffer on nrfconnect and openiotsdk uses LwIP buffers, which ignore the
  #  requested allocation size and always allocate at max-size.  So our test,
  #  which tries to size-limit the buffers, does not work correctly there.
  if (chip_device_platform != "nrfconnect" &&
      chip_device_platform != "openiotsdk") {
    test_sources += [ "TestTLVPacketBufferBackingStore.cpp" ]
  }

  cflags = [ "-Wconversion" ]

  public_deps = [
    "${chip_root}/src/inet",
    "${chip_root}/src/lib/support:testing_nlunit",
    "${chip_root}/src/platform",
    "${chip_root}/src/system",
    "${nlunit_test_root}:nlunit-test",
  ]
}
