# Copyright (c) 2024 Huawei Device Co., Ltd.
# 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("../../test.gni")

module_output_path = "previewer/util"

group("util_unittest") {
  testonly = true
  deps = [ ":util_test" ]
}

ide_unittest("util_test") {
  testonly = true
  part_name = "previewer"
  subsystem_name = "ide"
  module_out_path = module_output_path
  output_name = "util"
  sources = [
    "$ide_previewer_path/test/mock/MockGlobalResult.cpp",
    "$ide_previewer_path/test/mock/util/MockLocalSocket.cpp",
    "$ide_previewer_path/util/CallbackQueue.cpp",
    "$ide_previewer_path/util/CommandParser.cpp",
    "$ide_previewer_path/util/CppTimer.cpp",
    "$ide_previewer_path/util/CppTimerManager.cpp",
    "$ide_previewer_path/util/EndianUtil.cpp",
    "$ide_previewer_path/util/FileSystem.cpp",
    "$ide_previewer_path/util/Interrupter.cpp",
    "$ide_previewer_path/util/JsonReader.cpp",
    "$ide_previewer_path/util/ModelManager.cpp",
    "$ide_previewer_path/util/PreviewerEngineLog.cpp",
    "$ide_previewer_path/util/PublicMethods.cpp",
    "$ide_previewer_path/util/SharedDataManager.cpp",
    "$ide_previewer_path/util/TimeTool.cpp",
    "$ide_previewer_path/util/TraceTool.cpp",
    "$ide_previewer_path/util/unix/CrashHandler.cpp",
    "$ide_previewer_path/util/unix/LocalDate.cpp",
    "$ide_previewer_path/util/unix/NativeFileSystem.cpp",
    "CallbackQueueTest.cpp",
    "CommandParserTest.cpp",
    "CppTimerManagerTest.cpp",
    "CppTimerTest.cpp",
    "CrashHandlerTest.cpp",
    "EndianUtilTest.cpp",
    "JsonReaderTest.cpp",
    "LocalDateTest.cpp",
    "ModelManagerTest.cpp",
    "NativeFileSystemTest.cpp",
    "PublicMethodsTest.cpp",
    "SharedDataTest.cpp",
    "TimeToolTest.cpp",
    "TraceToolTest.cpp",
  ]
  include_dirs = [
    "$ide_previewer_path/test/mock",
    "$ide_previewer_path/util",
    "$ide_previewer_path/util/linux",
    "$ide_previewer_path/util/unix",
    "//third_party/cJSON",
    "//third_party/bounds_checking_function/include",
  ]
  deps = [
    "//third_party/bounds_checking_function:libsec_static",
    "//third_party/cJSON:cjson_static",
  ]
  libs = []
  cflags = [ "-fno-exceptions" ]
  cflags_cc = [ "-fno-exceptions" ]
  ldflags = []
}