From e177e8e0caae3c52a121f4d18d8566e220e23b2b Mon Sep 17 00:00:00 2001 From: Dan Shi Date: Thu, 20 Jun 2019 11:08:14 -0700 Subject: Fix dumpstate_test test config Bug: 135189613 Test: atest dumpstate_test Change-Id: Ie0105376f2db13d3b24f2a2630849633b95e3790 --- cmds/dumpstate/Android.bp | 2 ++ cmds/dumpstate/dumpstate_test.xml | 29 +++++++++++++++++++++++++++++ cmds/dumpstate/tests/dumpstate_test.cpp | 5 ++--- 3 files changed, 33 insertions(+), 3 deletions(-) create mode 100644 cmds/dumpstate/dumpstate_test.xml diff --git a/cmds/dumpstate/Android.bp b/cmds/dumpstate/Android.bp index ee32cb4495..ffad3b1709 100644 --- a/cmds/dumpstate/Android.bp +++ b/cmds/dumpstate/Android.bp @@ -146,6 +146,8 @@ cc_test { "tests/dumpstate_test.cpp", ], static_libs: ["libgmock"], + test_config: "dumpstate_test.xml", + data: [":dumpstate_test_fixture", "tests/testdata/**/*"] } cc_test { diff --git a/cmds/dumpstate/dumpstate_test.xml b/cmds/dumpstate/dumpstate_test.xml new file mode 100644 index 0000000000..e4e4a30a1e --- /dev/null +++ b/cmds/dumpstate/dumpstate_test.xml @@ -0,0 +1,29 @@ + + + + + + + diff --git a/cmds/dumpstate/tests/dumpstate_test.cpp b/cmds/dumpstate/tests/dumpstate_test.cpp index c5d01fdf25..0e88e43258 100644 --- a/cmds/dumpstate/tests/dumpstate_test.cpp +++ b/cmds/dumpstate/tests/dumpstate_test.cpp @@ -105,9 +105,8 @@ class DumpstateBaseTest : public Test { protected: const std::string kTestPath = dirname(android::base::GetExecutablePath().c_str()); - const std::string kFixturesPath = kTestPath + "/../dumpstate_test_fixture/"; - const std::string kTestDataPath = kFixturesPath + "tests/testdata/"; - const std::string kSimpleCommand = kFixturesPath + "dumpstate_test_fixture"; + const std::string kTestDataPath = kTestPath + "/tests/testdata/"; + const std::string kSimpleCommand = kTestPath + "/dumpstate_test_fixture"; const std::string kEchoCommand = "/system/bin/echo"; /* -- cgit v1.2.3-59-g8ed1b