【问题标题】:How to work with update_engine Unit test provided by AOSP?如何使用 AOSP 提供的 update_engine 单元测试?
【发布时间】:2022-01-20 10:51:11
【问题描述】:

我们计划使用 google 的单元测试进行验证 - https://chromium.googlesource.com/aosp/platform/system/update_engine/+/HEAD/

我尝试像任何其他模块一样构建 update_engine -

mydir/update_engine $ mm
mydir/update_engine $ ./run_unittests

但在页面上,它被提及为 building update_enginerunning unit-test - 我不知道在我的终端中运行这些命令。

我尝试使用 chroot,但似乎它需要 root 访问权限,而我的系统上目前没有。 如果有人尝试过这些单元测试,您能帮帮我吗?

【问题讨论】:

    标签: android unit-testing android-source googletest ota


    【解决方案1】:

    最后,尽管我设法运行了 Google 提供的 update_engine 单元测试,但我没有得到任何答案或没有找到任何 Google 文档。以下是我遵循的步骤-

    • 使用mm 命令构建update_engine-

      mydir/update_engine $ mm
      
    • 以上命令将在 out 目录中生成带有/data/nativetest/ 的二进制文件

    • 将生成的/data/nativetest/复制到设备的/data/目录中。

      adb push nativetest /data/
      
    • 在连接设备的情况下使用以下命令运行单元测试-

      adb shell /data/nativetest/update_engine_unittests/update_engine_unittests
      
    • 就是这样!它会输出结果说总610通过/失败,你可以看到完整的报告。

    如果您遇到问题,请告诉我,很乐意为您提供帮助。

    谢谢 :-) 编码愉快!!

    【讨论】:

      猜你喜欢
      • 2020-05-01
      • 2011-03-29
      • 1970-01-01
      • 1970-01-01
      • 2017-08-23
      • 1970-01-01
      • 2012-04-11
      • 1970-01-01
      相关资源
      最近更新 更多