summaryrefslogtreecommitdiffstats
path: root/jack-tests/tests/com/android/jack/inner/InnerTests.java
blob: 82302322a99c2354587bb7abadeb0f8499a4ce38 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
/*
* Copyright (C) 2014 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
*      http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package com.android.jack.inner;

import com.android.jack.test.category.RedundantTests;
import com.android.jack.test.category.RuntimeRegressionTest;
import com.android.jack.test.comparator.ComparatorDex;
import com.android.jack.test.helper.CheckDexStructureTestHelper;
import com.android.jack.test.helper.RuntimeTestHelper;
import com.android.jack.test.helper.SourceToDexComparisonTestHelper;
import com.android.jack.test.runtime.RuntimeTest;
import com.android.jack.test.runtime.RuntimeTestInfo;
import com.android.jack.test.toolchain.AbstractTestTools;
import com.android.jack.test.toolchain.IToolchain;

import org.junit.BeforeClass;
import org.junit.Test;
import org.junit.experimental.categories.Category;

import javax.annotation.Nonnull;

public class InnerTests extends RuntimeTest {

  private RuntimeTestInfo TEST001 = new RuntimeTestInfo(
    AbstractTestTools.getTestRootDir("com.android.jack.inner.test001"),
    "com.android.jack.inner.test001.dx.Tests");

  private RuntimeTestInfo TEST002 = new RuntimeTestInfo(
    AbstractTestTools.getTestRootDir("com.android.jack.inner.test002"),
    "com.android.jack.inner.test002.dx.Tests");

  private RuntimeTestInfo TEST003 = new RuntimeTestInfo(
    AbstractTestTools.getTestRootDir("com.android.jack.inner.test003"),
    "com.android.jack.inner.test003.dx.Tests");

  private RuntimeTestInfo TEST004 = new RuntimeTestInfo(
    AbstractTestTools.getTestRootDir("com.android.jack.inner.test004"),
    "com.android.jack.inner.test004.dx.Tests");

  private RuntimeTestInfo TEST005 = new RuntimeTestInfo(
    AbstractTestTools.getTestRootDir("com.android.jack.inner.test005"),
    "com.android.jack.inner.test005.dx.Tests");

  private RuntimeTestInfo TEST006 = new RuntimeTestInfo(
    AbstractTestTools.getTestRootDir("com.android.jack.inner.test006"),
    "com.android.jack.inner.test006.dx.Tests");

  private RuntimeTestInfo TEST007 = new RuntimeTestInfo(
    AbstractTestTools.getTestRootDir("com.android.jack.inner.test007"),
    "com.android.jack.inner.test007.dx.Tests");

  private RuntimeTestInfo TEST008 = new RuntimeTestInfo(
    AbstractTestTools.getTestRootDir("com.android.jack.inner.test008"),
    "com.android.jack.inner.test008.dx.Tests");

  private RuntimeTestInfo TEST009 = new RuntimeTestInfo(
    AbstractTestTools.getTestRootDir("com.android.jack.inner.test009"),
    "com.android.jack.inner.test009.dx.Tests");

  private RuntimeTestInfo TEST010 = new RuntimeTestInfo(
    AbstractTestTools.getTestRootDir("com.android.jack.inner.test010"),
    "com.android.jack.inner.test010.dx.Tests");

  private RuntimeTestInfo TEST011 = new RuntimeTestInfo(
    AbstractTestTools.getTestRootDir("com.android.jack.inner.test011"),
    "com.android.jack.inner.test011.dx.Tests");

  private RuntimeTestInfo TEST012 = new RuntimeTestInfo(
    AbstractTestTools.getTestRootDir("com.android.jack.inner.test012"),
    "com.android.jack.inner.test012.dx.Tests");

  private RuntimeTestInfo TEST013 = new RuntimeTestInfo(
    AbstractTestTools.getTestRootDir("com.android.jack.inner.test013"),
    "com.android.jack.inner.test013.dx.Tests");

  private RuntimeTestInfo TEST014 = new RuntimeTestInfo(
    AbstractTestTools.getTestRootDir("com.android.jack.inner.test014"),
    "com.android.jack.inner.test014.dx.Tests");

  private RuntimeTestInfo TEST015 = new RuntimeTestInfo(
    AbstractTestTools.getTestRootDir("com.android.jack.inner.test015"),
    "com.android.jack.inner.test015.dx.Tests");

  private RuntimeTestInfo TEST016 = new RuntimeTestInfo(
    AbstractTestTools.getTestRootDir("com.android.jack.inner.test016"),
    "com.android.jack.inner.test016.dx.Tests");

  private RuntimeTestInfo TEST017 = new RuntimeTestInfo(
    AbstractTestTools.getTestRootDir("com.android.jack.inner.test017"),
    "com.android.jack.inner.test017.dx.Tests");

  private RuntimeTestInfo TEST018 = new RuntimeTestInfo(
    AbstractTestTools.getTestRootDir("com.android.jack.inner.test018"),
    "com.android.jack.inner.test018.dx.Tests");

  private RuntimeTestInfo TEST019 = new RuntimeTestInfo(
    AbstractTestTools.getTestRootDir("com.android.jack.inner.test019"),
    "com.android.jack.inner.test019.dx.Tests");

  private RuntimeTestInfo TEST020 = new RuntimeTestInfo(
    AbstractTestTools.getTestRootDir("com.android.jack.inner.test020"),
    "com.android.jack.inner.test020.dx.Tests");

  private RuntimeTestInfo TEST021 = new RuntimeTestInfo(
    AbstractTestTools.getTestRootDir("com.android.jack.inner.test021"),
    "com.android.jack.inner.test021.dx.Tests");

  private RuntimeTestInfo TEST022 = new RuntimeTestInfo(
    AbstractTestTools.getTestRootDir("com.android.jack.inner.test022"),
    "com.android.jack.inner.test022.dx.Tests");

  private RuntimeTestInfo TEST023 = new RuntimeTestInfo(
    AbstractTestTools.getTestRootDir("com.android.jack.inner.test023"),
    "com.android.jack.inner.test023.dx.Tests");

  private RuntimeTestInfo TEST024 = new RuntimeTestInfo(
    AbstractTestTools.getTestRootDir("com.android.jack.inner.test024"),
    "com.android.jack.inner.test024.dx.Tests");

  private RuntimeTestInfo TEST026 = new RuntimeTestInfo(
    AbstractTestTools.getTestRootDir("com.android.jack.inner.test026"),
    "com.android.jack.inner.test026.dx.Tests");

  @BeforeClass
  public static void setUpClass() {
    InnerTests.class.getClassLoader().setDefaultAssertionStatus(true);
  }
  @Test
  @Category(RuntimeRegressionTest.class)
  public void test001() throws Exception {
    new RuntimeTestHelper(TEST001).compileAndRunTest();
  }

  @Test
  @Category(RuntimeRegressionTest.class)
  public void test002() throws Exception {
    new RuntimeTestHelper(TEST002).compileAndRunTest();
  }

  @Test
  @Category(RuntimeRegressionTest.class)
  public void test003() throws Exception {
    new RuntimeTestHelper(TEST003).compileAndRunTest();
  }

  @Test
  @Category(RuntimeRegressionTest.class)
  public void test004() throws Exception {
    new RuntimeTestHelper(TEST004).compileAndRunTest();
  }

  @Test
  @Category(RuntimeRegressionTest.class)
  public void test005() throws Exception {
    new RuntimeTestHelper(TEST005).compileAndRunTest();
  }

  @Test
  @Category(RuntimeRegressionTest.class)
  public void test006() throws Exception {
    new RuntimeTestHelper(TEST006).compileAndRunTest();
  }

  @Test
  @Category(RuntimeRegressionTest.class)
  public void test007() throws Exception {
    new RuntimeTestHelper(TEST007).compileAndRunTest();
  }

  @Test
  @Category(RuntimeRegressionTest.class)
  public void test008() throws Exception {
    new RuntimeTestHelper(TEST008).compileAndRunTest();
  }

  @Test
  @Category(RuntimeRegressionTest.class)
  public void test009() throws Exception {
    new RuntimeTestHelper(TEST009).compileAndRunTest();
  }

  @Test
  @Category(RuntimeRegressionTest.class)
  public void test010() throws Exception {
    new RuntimeTestHelper(TEST010).compileAndRunTest();
  }

  @Test
  @Category(RuntimeRegressionTest.class)
  public void test011() throws Exception {
    new RuntimeTestHelper(TEST011).compileAndRunTest();
  }

  @Test
  @Category(RuntimeRegressionTest.class)
  public void test012() throws Exception {
    new RuntimeTestHelper(TEST012).compileAndRunTest();
  }

  @Test
  @Category(RuntimeRegressionTest.class)
  public void test013() throws Exception {
    new RuntimeTestHelper(TEST013).compileAndRunTest();
  }

  @Test
  @Category(RuntimeRegressionTest.class)
  public void test014() throws Exception {
    new RuntimeTestHelper(TEST014).compileAndRunTest();
  }

  @Test
  @Category(RuntimeRegressionTest.class)
  public void test015() throws Exception {
    new RuntimeTestHelper(TEST015).compileAndRunTest();
  }

  @Test
  @Category(RuntimeRegressionTest.class)
  public void test016() throws Exception {
    new RuntimeTestHelper(TEST016).compileAndRunTest();
  }

  @Test
  @Category(RuntimeRegressionTest.class)
  public void test017() throws Exception {
    new RuntimeTestHelper(TEST017).compileAndRunTest();
  }

  @Test
  @Category(RuntimeRegressionTest.class)
  public void test018() throws Exception {
    new RuntimeTestHelper(TEST018).compileAndRunTest();
  }

  @Test
  @Category(RuntimeRegressionTest.class)
  public void test019() throws Exception {
    new RuntimeTestHelper(TEST019).compileAndRunTest();
  }

  @Test
  @Category(RuntimeRegressionTest.class)
  public void test020() throws Exception {
    new RuntimeTestHelper(TEST020).compileAndRunTest(true);
  }

  @Test
  @Category(RuntimeRegressionTest.class)
  public void test021() throws Exception {
    new RuntimeTestHelper(TEST021).compileAndRunTest(true);
  }

  @Test
  @Category(RuntimeRegressionTest.class)
  public void test022() throws Exception {
    new RuntimeTestHelper(TEST022).compileAndRunTest();
  }

  @Test
  @Category(RuntimeRegressionTest.class)
  public void test023() throws Exception {
    new RuntimeTestHelper(TEST023).compileAndRunTest();
  }

  @Test
  @Category(RuntimeRegressionTest.class)
  public void test024() throws Exception {
    new RuntimeTestHelper(TEST024).compileAndRunTest();
  }

  @Test
  public void test025() throws Exception {
    IToolchain toolchain = AbstractTestTools.getCandidateToolchain();
    toolchain.addToClasspath(toolchain.getDefaultBootClasspath())
    .srcToExe(
        AbstractTestTools.createTempDir(),
        /* zipFile = */ false,
        AbstractTestTools.getTestRootDir("com.android.jack.inner.test025.jack"));
  }

  @Test
  @Category(RuntimeRegressionTest.class)
  public void test026() throws Exception {
    new RuntimeTestHelper(TEST026).compileAndRunTest();
  }

  @Test
  public void testCheckStructure20() throws Exception {
    //TODO: find out why debug info check fails
    checkStructure("test020");
  }

  @Test
  @Category(RedundantTests.class)
  public void testCompile21() throws Exception {
    checkStructure("test021");
  }

  private void checkStructure(@Nonnull String test) throws Exception {
    SourceToDexComparisonTestHelper helper = new CheckDexStructureTestHelper(
        AbstractTestTools.getTestRootDir("com.android.jack.inner." + test + ".jack"));
    helper.runTest(new ComparatorDex(helper.getReferenceDex(), helper.getCandidateDex()));
  }

  @Override
  protected void fillRtTestInfos() {
    rtTestInfos.add(TEST001);
    rtTestInfos.add(TEST002);
    rtTestInfos.add(TEST003);
    rtTestInfos.add(TEST004);
    rtTestInfos.add(TEST005);
    rtTestInfos.add(TEST006);
    rtTestInfos.add(TEST007);
    rtTestInfos.add(TEST008);
    rtTestInfos.add(TEST009);
    rtTestInfos.add(TEST010);
    rtTestInfos.add(TEST011);
    rtTestInfos.add(TEST012);
    rtTestInfos.add(TEST013);
    rtTestInfos.add(TEST014);
    rtTestInfos.add(TEST015);
    rtTestInfos.add(TEST016);
    rtTestInfos.add(TEST017);
    rtTestInfos.add(TEST018);
    rtTestInfos.add(TEST019);
    rtTestInfos.add(TEST020);
    rtTestInfos.add(TEST021);
    rtTestInfos.add(TEST022);
    rtTestInfos.add(TEST023);
    rtTestInfos.add(TEST024);
    rtTestInfos.add(TEST026);
  }
}