blob: 7260d7477b506d520bec21f435001b8aa355f47c [file] [log] [blame]
Mathieu Chartier19510f02015-05-26 14:44:35 -07001/*
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 Marko1352f132017-04-28 15:28:29 +010017#include "oatdump_test.h"
Mathieu Chartier19510f02015-05-26 14:44:35 -070018
19namespace art {
20
Vladimir Marko7da31702016-03-29 18:42:21 +010021// Disable tests on arm and mips as they are taking too long to run. b/27824283.
22#if !defined(__arm__) && !defined(__mips__)
Mathieu Chartier19510f02015-05-26 14:44:35 -070023TEST_F(OatDumpTest, TestNoDumpVmap) {
24 std::string error_msg;
Roland Levillain04147ef2016-09-06 11:09:41 +010025 ASSERT_TRUE(Exec(kDynamic, kModeArt, {"--no-dump:vmap"}, kListAndCode, &error_msg)) << error_msg;
26}
27TEST_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 Chartier19510f02015-05-26 14:44:35 -070031}
32
33TEST_F(OatDumpTest, TestNoDisassemble) {
34 std::string error_msg;
Roland Levillain04147ef2016-09-06 11:09:41 +010035 ASSERT_TRUE(Exec(kDynamic, kModeArt, {"--no-disassemble"}, kListAndCode, &error_msg))
36 << error_msg;
37}
38TEST_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 Chartier19510f02015-05-26 14:44:35 -070042}
43
44TEST_F(OatDumpTest, TestListClasses) {
45 std::string error_msg;
Roland Levillain04147ef2016-09-06 11:09:41 +010046 ASSERT_TRUE(Exec(kDynamic, kModeArt, {"--list-classes"}, kListOnly, &error_msg)) << error_msg;
47}
48TEST_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 Chartier19510f02015-05-26 14:44:35 -070052}
53
54TEST_F(OatDumpTest, TestListMethods) {
55 std::string error_msg;
Roland Levillain04147ef2016-09-06 11:09:41 +010056 ASSERT_TRUE(Exec(kDynamic, kModeArt, {"--list-methods"}, kListOnly, &error_msg)) << error_msg;
57}
58TEST_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 Chartier19510f02015-05-26 14:44:35 -070062}
63
64TEST_F(OatDumpTest, TestSymbolize) {
65 std::string error_msg;
Roland Levillain04147ef2016-09-06 11:09:41 +010066 ASSERT_TRUE(Exec(kDynamic, kModeSymbolize, {}, kListOnly, &error_msg)) << error_msg;
67}
68TEST_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 Chartier19510f02015-05-26 14:44:35 -070072}
Nicolas Geoffray973ce7c2016-03-24 09:23:04 +000073#endif
Mathieu Chartier19510f02015-05-26 14:44:35 -070074} // namespace art