installd: Unit test for RunDex2oat
Add unit tests run_dex2oat_test.
In order to make RunDex2oat testable,
- RunDex2Oat is extracted from dexopt.cpp such that the class is
visible to test
- ExecVHelper is extracted from dexopt.cpp such that it can be used by
RunDex2Oat and the others in the original file.
- Main logic of RunDex2Oat is removed from constructor (otherwise
virtual functions can't be overridden in derived class).
Bug: 161470356
Test: atest run_dex2oat_test
Test: atest frameworks/native/cmds/installd/tests
Test: cmd package compile -m speed -f com.android.egg
Change-Id: I416d57a008374a598def9160b65407ed043ab0eb
9 files changed