Set rust_test modules as NATIVE_TESTS

* Rust test modules should have NATIVE_TESTS class,
  not EXECUTABLES, to work with atest --host.

Bug: 140938178
Test: make rust projects; run atest --host .
Change-Id: Ie9e237ee8c17b6e2d41f08a77c2b79d462a2c193
This commit is contained in:
Chih-Hung Hsieh
2019-11-15 04:14:44 -08:00
parent 409e833def
commit 15f369e1c7

View File

@@ -89,6 +89,7 @@ func (binary *binaryDecorator) AndroidMk(ctx AndroidMkContext, ret *android.Andr
func (test *testDecorator) AndroidMk(ctx AndroidMkContext, ret *android.AndroidMkData) {
test.binaryDecorator.AndroidMk(ctx, ret)
ret.Class = "NATIVE_TESTS"
stem := String(test.baseCompiler.Properties.Stem)
if stem != "" && !strings.HasSuffix(ctx.Name(), "_"+stem) {
// Avoid repeated suffix in the module name.