// Build the unit tests for libaudioprocessing

package {
    default_team: "trendy_team_media_framework_audio",
    // See: http://go/android-license-faq
    // A large-scale-change added 'default_applicable_licenses' to import
    // all of the 'license_kinds' from "frameworks_av_license"
    // to get the below license kinds:
    //   SPDX-license-identifier-Apache-2.0
    default_applicable_licenses: ["frameworks_av_license"],
}

cc_defaults {
    name: "libaudioprocessing_test_defaults",

    header_libs: [
        "libbase_headers",
        "libmedia_headers",
    ],

    shared_libs: [
        "libaudioclient",
        "libaudioprocessing",
        "libaudioutils",
        "libcutils",
        "liblog",
        "libutils",
        "libvibrator",
    ],

    cflags: [
        "-Wall",
        "-Werror",
    ],
}

//
// resampler unit test
//
cc_test {
    name: "resampler_tests",
    defaults: ["libaudioprocessing_test_defaults"],

    srcs: ["resampler_tests.cpp"],
}

//
// audio mixer test tool
//
cc_binary {
    name: "test-mixer",
    defaults: ["libaudioprocessing_test_defaults"],

    srcs: ["test-mixer.cpp"],
    static_libs: ["libsndfile"],
}

//
// build audio resampler test tool
//
cc_binary {
    name: "test-resampler",
    defaults: ["libaudioprocessing_test_defaults"],

    srcs: ["test-resampler.cpp"],
    static_libs: ["libsndfile"],
}

//
// build mixerops objdump
//
// This is used to verify proper optimization of the code.
//
// For example, use:
// ./prebuilts/gcc/linux-x86/aarch64/aarch64-linux-android-4.9/bin/aarch64-linux-android-objdump
//      -d --source ./out/target/product/crosshatch/symbols/system/bin/mixerops_objdump
//
cc_binary {
    name: "mixerops_objdump",
    header_libs: ["libaudioutils_headers"],
    srcs: ["mixerops_objdump.cpp"],
}

//
// build mixerops benchmark
//
cc_benchmark {
    name: "mixerops_benchmark",
    header_libs: ["libaudioutils_headers"],
    srcs: ["mixerops_benchmark.cpp"],
    static_libs: ["libgoogle-benchmark"],
}

//
// mixerops unit test
//
cc_test {
    name: "mixerops_tests",
    defaults: ["libaudioprocessing_test_defaults"],
    srcs: ["mixerops_tests.cpp"],
}
