# Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved.
# Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without modification,
# are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice, this list of
#    conditions and the following disclaimer.
#
# 2. Redistributions in binary form must reproduce the above copyright notice, this list
#    of conditions and the following disclaimer in the documentation and/or other materials
#    provided with the distribution.
#
# 3. Neither the name of the copyright holder nor the names of its contributors may be used
#    to endorse or promote products derived from this software without specific prior written
#    permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

import("//build/lite/config/test.gni")
import("../../config.gni")

common_include_dirs = [
  "//third_party/googletest/googletest/include",
  "../../common/include",
  "//kernel/liteos_a/testsuites/unittest/fs/vfs",
  "//kernel/liteos_a/testsuites/unittest/fs/vfat",
]

sources_entry = [
  "../../common/osTest.cpp",
  "VfsFatTest.cpp",
]

sources_smoke = [
  "smoke/It_vfs_fat_026.cpp",
]

sources_pressure = [
  "pressure/It_fs_fat_performance_001.cpp",
  "pressure/It_fs_fat_performance_002.cpp",
  "pressure/It_fs_fat_performance_003.cpp",
  "pressure/It_fs_fat_performance_004.cpp",
  "pressure/It_fs_fat_performance_005.cpp",
  "pressure/It_fs_fat_performance_006.cpp",
  "pressure/It_fs_fat_performance_007.cpp",
  "pressure/It_fs_fat_performance_008.cpp",
  "pressure/It_fs_fat_performance_013.cpp",
  "pressure/It_fs_fat_performance_014.cpp",
  "pressure/It_fs_fat_performance_015.cpp",
  "pressure/It_fs_fat_performance_016.cpp",

  "pressure/It_fs_fat_pressure_029.cpp",
  "pressure/It_fs_fat_pressure_030.cpp",
  "pressure/It_fs_fat_pressure_031.cpp",
  "pressure/It_fs_fat_pressure_038.cpp",
  "pressure/It_fs_fat_pressure_040.cpp",
  "pressure/It_fs_fat_pressure_041.cpp",
  "pressure/It_fs_fat_pressure_042.cpp",
  "pressure/It_fs_fat_pressure_301.cpp",
  "pressure/It_fs_fat_pressure_302.cpp",
  "pressure/It_fs_fat_pressure_303.cpp",
  "pressure/It_fs_fat_pressure_305.cpp",
  "pressure/It_fs_fat_pressure_306.cpp",
  "pressure/It_fs_fat_pressure_309.cpp",

  "pressure/It_vfs_fat_mutipthread_003.cpp",
  "pressure/It_vfs_fat_mutipthread_004.cpp",
  "pressure/It_vfs_fat_mutipthread_005.cpp",
  "pressure/It_vfs_fat_mutipthread_006.cpp",
  "pressure/It_vfs_fat_mutipthread_008.cpp",
  "pressure/It_vfs_fat_mutipthread_009.cpp",
  "pressure/It_vfs_fat_mutipthread_010.cpp",
  "pressure/It_vfs_fat_mutipthread_012.cpp",
  "pressure/It_vfs_fat_mutipthread_014.cpp",
  "pressure/It_vfs_fat_mutipthread_016.cpp",
  "pressure/It_vfs_fat_mutipthread_017.cpp",
  "pressure/It_vfs_fat_mutipthread_018.cpp",
  "pressure/It_vfs_fat_mutipthread_019.cpp",
  "pressure/It_vfs_fat_mutipthread_020.cpp",
  "pressure/It_vfs_fat_mutipthread_021.cpp",
  "pressure/It_vfs_fat_mutipthread_022.cpp",
  "pressure/It_vfs_fat_mutipthread_023.cpp",
  "pressure/It_vfs_fat_mutipthread_024.cpp",
  "pressure/It_vfs_fat_mutipthread_027.cpp",
  "pressure/It_vfs_fat_mutipthread_029.cpp",
  "pressure/It_vfs_fat_mutipthread_030.cpp",
  "pressure/It_vfs_fat_mutipthread_032.cpp",
  "pressure/It_vfs_fat_mutipthread_033.cpp",
  "pressure/It_vfs_fat_mutipthread_035.cpp",
  "pressure/It_vfs_fat_mutipthread_036.cpp",
  "pressure/It_vfs_fat_mutipthread_038.cpp",
  "pressure/It_vfs_fat_mutipthread_039.cpp",
  "pressure/It_vfs_fat_mutipthread_040.cpp",
  "pressure/It_vfs_fat_mutipthread_041.cpp",
  "pressure/It_vfs_fat_mutipthread_042.cpp",
  "pressure/It_vfs_fat_mutipthread_043.cpp",
  "pressure/It_vfs_fat_mutipthread_044.cpp",
  "pressure/It_vfs_fat_mutipthread_045.cpp",
  "pressure/It_vfs_fat_mutipthread_046.cpp",
  "pressure/It_vfs_fat_mutipthread_047.cpp",
  "pressure/It_vfs_fat_mutipthread_048.cpp",
  "pressure/It_vfs_fat_mutipthread_049.cpp",
  "pressure/It_vfs_fat_mutipthread_050.cpp",
]

sources_full = [
  "full/It_vfs_fat_066.cpp",
  "full/It_vfs_fat_068.cpp",
  "full/It_vfs_fat_072.cpp",
  "full/It_vfs_fat_073.cpp",
  "full/It_vfs_fat_074.cpp",
  "full/It_vfs_fat_496.cpp",
  "full/It_vfs_fat_497.cpp",
  "full/It_vfs_fat_498.cpp",
  "full/It_vfs_fat_499.cpp",
  "full/It_vfs_fat_500.cpp",
  "full/It_vfs_fat_501.cpp",
  "full/It_vfs_fat_502.cpp",
  "full/It_vfs_fat_503.cpp",
  "full/It_vfs_fat_504.cpp",
  "full/It_vfs_fat_506.cpp",
  "full/It_vfs_fat_507.cpp",
  "full/It_vfs_fat_508.cpp",
  "full/It_vfs_fat_509.cpp",
  "full/It_vfs_fat_510.cpp",
  "full/It_vfs_fat_511.cpp",
  "full/It_vfs_fat_512.cpp",
  "full/It_vfs_fat_513.cpp",
  "full/It_vfs_fat_514.cpp",
  "full/It_vfs_fat_515.cpp",
  "full/It_vfs_fat_516.cpp",
  "full/It_vfs_fat_517.cpp",
  "full/It_vfs_fat_518.cpp",
  "full/It_vfs_fat_519.cpp",
  "full/It_vfs_fat_662.cpp",
  "full/It_vfs_fat_663.cpp",
  "full/It_vfs_fat_664.cpp",
  "full/It_vfs_fat_665.cpp",
  "full/It_vfs_fat_666.cpp",
  "full/It_vfs_fat_667.cpp",
  "full/It_vfs_fat_668.cpp",
  "full/It_vfs_fat_669.cpp",
  "full/It_vfs_fat_670.cpp",
  "full/It_vfs_fat_671.cpp",
  "full/It_vfs_fat_672.cpp",
  "full/It_vfs_fat_673.cpp",
  "full/It_vfs_fat_674.cpp",
  "full/It_vfs_fat_675.cpp",
  "full/It_vfs_fat_676.cpp",
  "full/It_vfs_fat_677.cpp",
  "full/It_vfs_fat_678.cpp",
  "full/It_vfs_fat_679.cpp",
  "full/It_vfs_fat_680.cpp",
  "full/It_vfs_fat_681.cpp",
  "full/It_vfs_fat_682.cpp",
  "full/It_vfs_fat_683.cpp",
  "full/It_vfs_fat_684.cpp",
  "full/It_vfs_fat_685.cpp",
  "full/It_vfs_fat_686.cpp",
  "full/It_vfs_fat_687.cpp",
  "full/It_vfs_fat_692.cpp",
  "full/It_vfs_fat_693.cpp",
  "full/It_vfs_fat_694.cpp",
  "full/It_vfs_fat_870.cpp",
  "full/It_vfs_fat_872.cpp",
  "full/It_vfs_fat_873.cpp",
  "full/It_vfs_fat_874.cpp",
  "full/It_vfs_fat_875.cpp",
  "full/It_vfs_fat_902.cpp",
  "full/It_vfs_fat_903.cpp",
  "full/It_vfs_fat_904.cpp",
  "full/It_vfs_fat_909.cpp",
]

if (LOSCFG_USER_TEST_LEVEL >= TEST_LEVEL_LOW) {
  unittest("liteos_a_fs_vfat_unittest_door") {
    output_extension = "bin"
    output_dir = "$root_out_dir/test/unittest/kernel"
    include_dirs = common_include_dirs
    sources = sources_entry
    sources += sources_smoke
    sources_full = []
    sources += sources_full
    sources_pressure = []
    sources += sources_pressure
    configs = [ "../..:public_config_for_door" ]
    deps = [ "//third_party/bounds_checking_function:libsec_shared" ]
  }
}

if (LOSCFG_USER_TEST_LEVEL >= TEST_LEVEL_MIDDLE) {
  unittest("liteos_a_fs_vfat_unittest") {
    output_extension = "bin"
    output_dir = "$root_out_dir/test/unittest/kernel"
    include_dirs = common_include_dirs
    sources = sources_entry
    sources += sources_smoke
    sources += sources_full
    sources_pressure = []
    sources += sources_pressure
    configs = [ "../..:public_config_for_all" ]
    deps = [ "//third_party/bounds_checking_function:libsec_shared" ]
  }
}

if (LOSCFG_USER_TEST_LEVEL >= TEST_LEVEL_HIGH) {
  unittest("liteos_a_fs_vfat_unittest_pressure") {
    output_extension = "bin"
    output_dir = "$root_out_dir/test/unittest/kernel"
    include_dirs = common_include_dirs
    sources = sources_entry
    sources_smoke = []
    sources += sources_smoke
    sources_full = []
    sources += sources_full
    sources += sources_pressure
    configs = [ "../..:public_config_for_pressure" ]
    deps = [ "//third_party/bounds_checking_function:libsec_shared" ]
  }
}
