How to work with update_engine Unit test provided by AOSP?

Viewed 118

We are planning to use google's unit tests for verification - https://chromium.googlesource.com/aosp/platform/system/update_engine/+/HEAD/

I tried building update_engine like any other module -

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

But on-page, it's mentioned like building update_engine and running unit-test - I don't know to run these commands in my terminal.

I tried using chroot, but seems like it requires root access and that I don't have currently on my system. If anyone ever tried these unit tests, could you help me?

1 Answers

Finally, I didn't get any answer or didn't find any Google document yet though I manage to run the update_engine unit test provided by Google. Below are the steps I followed -

  • Build the update_engine by using mm command-

    mydir/update_engine $ mm
    
  • Above command will generate binaries in out dir with /data/nativetest/

  • Copy the generated /data/nativetest/ into device's /data/ dir.

    adb push nativetest /data/
    
  • Run the unittest using below command with device connected-

    adb shell /data/nativetest/update_engine_unittests/update_engine_unittests
    
  • That's all! It will output the result saying total 610 passed/ fail, you can see the complete report.

Let me know if you are facing issue, happy to assist.

Thanks :-) Happy Coding!!

Related