1import("//llvm/utils/gn/build/toolchain/compiler.gni") 2import("//third-party/unittest/unittest.gni") 3 4test_cflags = [ "-DSCUDO_DEBUG=1" ] 5 6unittest("ScudoUnitTest") { 7 configs += [ "//llvm/utils/gn/build:crt_code" ] 8 cflags = test_cflags 9 deps = [ "//compiler-rt/lib/scudo/standalone:sources" ] 10 sources = [ 11 "allocator_config_test.cpp", 12 "atomic_test.cpp", 13 "bytemap_test.cpp", 14 "checksum_test.cpp", 15 "chunk_test.cpp", 16 "combined_test.cpp", 17 "common_test.cpp", 18 "condition_variable_test.cpp", 19 "flags_test.cpp", 20 "list_test.cpp", 21 "map_test.cpp", 22 "memtag_test.cpp", 23 "mutex_test.cpp", 24 "primary_test.cpp", 25 "quarantine_test.cpp", 26 "release_test.cpp", 27 "report_test.cpp", 28 "scudo_unit_test.h", 29 "scudo_unit_test_main.cpp", 30 "secondary_test.cpp", 31 "size_class_map_test.cpp", 32 "stats_test.cpp", 33 "strings_test.cpp", 34 "timing_test.cpp", 35 "tsd_test.cpp", 36 "vector_test.cpp", 37 ] 38 has_custom_main = true 39} 40 41unittest("ScudoCUnitTest") { 42 configs += [ "//llvm/utils/gn/build:crt_code" ] 43 cflags = test_cflags 44 deps = [ 45 "//compiler-rt/lib/scudo/standalone:c_wrapper_sources", 46 "//compiler-rt/lib/scudo/standalone:sources", 47 ] 48 sources = [ 49 "scudo_unit_test_main.cpp", 50 "wrappers_c_test.cpp", 51 ] 52 has_custom_main = true 53} 54 55unittest("ScudoCxxUnitTest") { 56 configs += [ "//llvm/utils/gn/build:crt_code" ] 57 cflags = test_cflags 58 deps = [ 59 "//compiler-rt/lib/scudo/standalone:c_wrapper_sources", 60 "//compiler-rt/lib/scudo/standalone:cxx_wrapper_sources", 61 "//compiler-rt/lib/scudo/standalone:sources", 62 ] 63 sources = [ 64 "scudo_unit_test_main.cpp", 65 "wrappers_cpp_test.cpp", 66 ] 67 if (is_clang) { 68 cflags += [ "-Wno-mismatched-new-delete" ] 69 } 70 has_custom_main = true 71} 72 73unittest("ScudoHooksUnitTest") { 74 configs += [ "//llvm/utils/gn/build:crt_code" ] 75 cflags = test_cflags 76 deps = [ 77 "//compiler-rt/lib/scudo/standalone:c_wrapper_sources", 78 "//compiler-rt/lib/scudo/standalone:sources", 79 ] 80 sources = [ "scudo_unit_test_main.cpp" ] 81 has_custom_main = true 82} 83