Android12之gtest测试示例

1.Android.bp

cc_test {
    name: "gtest_01",

    shared_libs: [
        "libbase",
        "liblog",
        "libmedia_helper",
        "libutils",
        "libxml2",
    ],

    srcs: ["gtest_01.cpp"],
}

2.gtest_01.cpp

#include <gtest/gtest.h>
#include <log/log.h>

TEST(test1, test2) {
    printf("xxx------------->%s(), line = %d\n",__FUNCTION__,__LINE__);
    ALOGE("xxx------------->%s(), line = %d",__FUNCTION__,__LINE__);
}

TEST(test3, test4) {
    printf("xxx------------->%s(), line = %d\n",__FUNCTION__,__LINE__);
    ALOGE("xxx------------->%s(), line = %d",__FUNCTION__,__LINE__);
}



猜你喜欢

转载自blog.csdn.net/u010164190/article/details/125984763