From 7617abdb402fd0419daa3eefb2ad059ccbb8b6db Mon Sep 17 00:00:00 2001 From: Igor Murashkin Date: Fri, 10 Jul 2015 18:27:47 -0700 Subject: runtime: Add -Xverify:softfail and ART_TEST_INTERPRETER_ACCESS_CHECKS Use ART_TEST_INTERPRETER_ACCESS_CHECKS=true to run all the tests through the interpreter with access checks enabled. The normal interpreter tests do not currently enable access checks, which means that a large part of the interpreter codebase is untested. The verifier will force every class into a soft fail mode if -Xverify:softfail is used, thereby ensuring that if used along with the interpreter (-Xint) that the interpret is always in access checks mode. This is used alongside with --compile-filter=verify-at-runtime to prevent the AOT compiler from putting down any code. Change-Id: I35a10ed8c43d76fa96133cf01fdad497da387200 --- cmdline/cmdline_parser_test.cc | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'cmdline/cmdline_parser_test.cc') diff --git a/cmdline/cmdline_parser_test.cc b/cmdline/cmdline_parser_test.cc index 98fd327f02..52df7deb25 100644 --- a/cmdline/cmdline_parser_test.cc +++ b/cmdline/cmdline_parser_test.cc @@ -216,9 +216,6 @@ TEST_F(CmdlineParserTest, TestSimpleSuccesses) { EXPECT_SINGLE_PARSE_EXISTS("-Xzygote", M::Zygote); EXPECT_SINGLE_PARSE_VALUE_STR("/hello/world", "-Xbootclasspath:/hello/world", M::BootClassPath); EXPECT_SINGLE_PARSE_VALUE("/hello/world", "-Xbootclasspath:/hello/world", M::BootClassPath); - EXPECT_SINGLE_PARSE_VALUE(false, "-Xverify:none", M::Verify); - EXPECT_SINGLE_PARSE_VALUE(true, "-Xverify:remote", M::Verify); - EXPECT_SINGLE_PARSE_VALUE(true, "-Xverify:all", M::Verify); EXPECT_SINGLE_PARSE_VALUE(Memory<1>(234), "-Xss234", M::StackSize); EXPECT_SINGLE_PARSE_VALUE(MemoryKiB(1234*MB), "-Xms1234m", M::MemoryInitialSize); EXPECT_SINGLE_PARSE_VALUE(true, "-XX:EnableHSpaceCompactForOOM", M::EnableHSpaceCompactForOOM); @@ -550,6 +547,14 @@ TEST_F(CmdlineParserTest, TestExperimentalLambdas) { M::ExperimentalLambdas); } +// -Xverify:_ +TEST_F(CmdlineParserTest, TestVerify) { + EXPECT_SINGLE_PARSE_VALUE(verifier::VerifyMode::kNone, "-Xverify:none", M::Verify); + EXPECT_SINGLE_PARSE_VALUE(verifier::VerifyMode::kEnable, "-Xverify:remote", M::Verify); + EXPECT_SINGLE_PARSE_VALUE(verifier::VerifyMode::kEnable, "-Xverify:all", M::Verify); + EXPECT_SINGLE_PARSE_VALUE(verifier::VerifyMode::kSoftFail, "-Xverify:softfail", M::Verify); +} + TEST_F(CmdlineParserTest, TestIgnoreUnrecognized) { RuntimeParser::Builder parserBuilder; -- cgit v1.2.3-59-g8ed1b