1import("//llvm/utils/gn/build/toolchain/compiler.gni") 2import("//llvm/utils/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 "atomic_test.cpp", 12 "bytemap_test.cpp", 13 "checksum_test.cpp", 14 "chunk_test.cpp", 15 "combined_test.cpp", 16 "common_test.cpp", 17 "flags_test.cpp", 18 "list_test.cpp", 19 "map_test.cpp", 20 "mutex_test.cpp", 21 "primary_test.cpp", 22 "quarantine_test.cpp", 23 "release_test.cpp", 24 "report_test.cpp", 25 "scudo_unit_test.h", 26 "scudo_unit_test_main.cpp", 27 "secondary_test.cpp", 28 "size_class_map_test.cpp", 29 "stats_test.cpp", 30 "strings_test.cpp", 31 "tsd_test.cpp", 32 "vector_test.cpp", 33 ] 34 has_custom_main = true 35} 36 37unittest("ScudoCUnitTest") { 38 configs += [ "//llvm/utils/gn/build:crt_code" ] 39 cflags = test_cflags 40 deps = [ 41 "//compiler-rt/lib/scudo/standalone:c_wrapper_sources", 42 "//compiler-rt/lib/scudo/standalone:sources", 43 ] 44 sources = [ 45 "scudo_unit_test_main.cpp", 46 "wrappers_c_test.cpp", 47 ] 48 has_custom_main = true 49} 50 51unittest("ScudoCxxUnitTest") { 52 configs += [ "//llvm/utils/gn/build:crt_code" ] 53 cflags = test_cflags 54 deps = [ 55 "//compiler-rt/lib/scudo/standalone:c_wrapper_sources", 56 "//compiler-rt/lib/scudo/standalone:cxx_wrapper_sources", 57 "//compiler-rt/lib/scudo/standalone:sources", 58 ] 59 sources = [ 60 "scudo_unit_test_main.cpp", 61 "wrappers_cpp_test.cpp", 62 ] 63 if (is_clang) { 64 cflags += [ "-Wno-mismatched-new-delete" ] 65 } 66 has_custom_main = true 67} 68