Mathieu Chartier | 19510f0 | 2015-05-26 14:44:35 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2015 The Android Open Source Project |
| 3 | * |
| 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | * you may not use this file except in compliance with the License. |
| 6 | * You may obtain a copy of the License at |
| 7 | * |
| 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | * |
| 10 | * Unless required by applicable law or agreed to in writing, software |
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | * See the License for the specific language governing permissions and |
| 14 | * limitations under the License. |
| 15 | */ |
| 16 | |
Vladimir Marko | 1352f13 | 2017-04-28 15:28:29 +0100 | [diff] [blame^] | 17 | #include "oatdump_test.h" |
Mathieu Chartier | 19510f0 | 2015-05-26 14:44:35 -0700 | [diff] [blame] | 18 | |
| 19 | namespace art { |
| 20 | |
Vladimir Marko | 7da3170 | 2016-03-29 18:42:21 +0100 | [diff] [blame] | 21 | // Disable tests on arm and mips as they are taking too long to run. b/27824283. |
| 22 | #if !defined(__arm__) && !defined(__mips__) |
Mathieu Chartier | 19510f0 | 2015-05-26 14:44:35 -0700 | [diff] [blame] | 23 | TEST_F(OatDumpTest, TestNoDumpVmap) { |
| 24 | std::string error_msg; |
Roland Levillain | 04147ef | 2016-09-06 11:09:41 +0100 | [diff] [blame] | 25 | ASSERT_TRUE(Exec(kDynamic, kModeArt, {"--no-dump:vmap"}, kListAndCode, &error_msg)) << error_msg; |
| 26 | } |
| 27 | TEST_F(OatDumpTest, TestNoDumpVmapStatic) { |
| 28 | TEST_DISABLED_FOR_NON_STATIC_HOST_BUILDS(); |
| 29 | std::string error_msg; |
| 30 | ASSERT_TRUE(Exec(kStatic, kModeArt, {"--no-dump:vmap"}, kListAndCode, &error_msg)) << error_msg; |
Mathieu Chartier | 19510f0 | 2015-05-26 14:44:35 -0700 | [diff] [blame] | 31 | } |
| 32 | |
| 33 | TEST_F(OatDumpTest, TestNoDisassemble) { |
| 34 | std::string error_msg; |
Roland Levillain | 04147ef | 2016-09-06 11:09:41 +0100 | [diff] [blame] | 35 | ASSERT_TRUE(Exec(kDynamic, kModeArt, {"--no-disassemble"}, kListAndCode, &error_msg)) |
| 36 | << error_msg; |
| 37 | } |
| 38 | TEST_F(OatDumpTest, TestNoDisassembleStatic) { |
| 39 | TEST_DISABLED_FOR_NON_STATIC_HOST_BUILDS(); |
| 40 | std::string error_msg; |
| 41 | ASSERT_TRUE(Exec(kStatic, kModeArt, {"--no-disassemble"}, kListAndCode, &error_msg)) << error_msg; |
Mathieu Chartier | 19510f0 | 2015-05-26 14:44:35 -0700 | [diff] [blame] | 42 | } |
| 43 | |
| 44 | TEST_F(OatDumpTest, TestListClasses) { |
| 45 | std::string error_msg; |
Roland Levillain | 04147ef | 2016-09-06 11:09:41 +0100 | [diff] [blame] | 46 | ASSERT_TRUE(Exec(kDynamic, kModeArt, {"--list-classes"}, kListOnly, &error_msg)) << error_msg; |
| 47 | } |
| 48 | TEST_F(OatDumpTest, TestListClassesStatic) { |
| 49 | TEST_DISABLED_FOR_NON_STATIC_HOST_BUILDS(); |
| 50 | std::string error_msg; |
| 51 | ASSERT_TRUE(Exec(kStatic, kModeArt, {"--list-classes"}, kListOnly, &error_msg)) << error_msg; |
Mathieu Chartier | 19510f0 | 2015-05-26 14:44:35 -0700 | [diff] [blame] | 52 | } |
| 53 | |
| 54 | TEST_F(OatDumpTest, TestListMethods) { |
| 55 | std::string error_msg; |
Roland Levillain | 04147ef | 2016-09-06 11:09:41 +0100 | [diff] [blame] | 56 | ASSERT_TRUE(Exec(kDynamic, kModeArt, {"--list-methods"}, kListOnly, &error_msg)) << error_msg; |
| 57 | } |
| 58 | TEST_F(OatDumpTest, TestListMethodsStatic) { |
| 59 | TEST_DISABLED_FOR_NON_STATIC_HOST_BUILDS(); |
| 60 | std::string error_msg; |
| 61 | ASSERT_TRUE(Exec(kStatic, kModeArt, {"--list-methods"}, kListOnly, &error_msg)) << error_msg; |
Mathieu Chartier | 19510f0 | 2015-05-26 14:44:35 -0700 | [diff] [blame] | 62 | } |
| 63 | |
| 64 | TEST_F(OatDumpTest, TestSymbolize) { |
| 65 | std::string error_msg; |
Roland Levillain | 04147ef | 2016-09-06 11:09:41 +0100 | [diff] [blame] | 66 | ASSERT_TRUE(Exec(kDynamic, kModeSymbolize, {}, kListOnly, &error_msg)) << error_msg; |
| 67 | } |
| 68 | TEST_F(OatDumpTest, TestSymbolizeStatic) { |
| 69 | TEST_DISABLED_FOR_NON_STATIC_HOST_BUILDS(); |
| 70 | std::string error_msg; |
| 71 | ASSERT_TRUE(Exec(kStatic, kModeSymbolize, {}, kListOnly, &error_msg)) << error_msg; |
Mathieu Chartier | 19510f0 | 2015-05-26 14:44:35 -0700 | [diff] [blame] | 72 | } |
Nicolas Geoffray | 973ce7c | 2016-03-24 09:23:04 +0000 | [diff] [blame] | 73 | #endif |
Mathieu Chartier | 19510f0 | 2015-05-26 14:44:35 -0700 | [diff] [blame] | 74 | } // namespace art |