diff options
author | Yohann Roussel <yroussel@google.com> | 2015-04-09 16:07:13 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2015-04-09 16:07:14 +0000 |
commit | b43ce4219f1e7d9300c7a7f516220fee321ed7a6 (patch) | |
tree | 33d35f5b4941a31bea6a94c583a3af36f026d196 /jack-tests/tests | |
parent | aa24c76d197652125c36867b5523929f4d587275 (diff) | |
parent | e4de3c19c777e61c02b241108cf247797075df63 (diff) | |
download | toolchain_jack-b43ce4219f1e7d9300c7a7f516220fee321ed7a6.zip toolchain_jack-b43ce4219f1e7d9300c7a7f516220fee321ed7a6.tar.gz toolchain_jack-b43ce4219f1e7d9300c7a7f516220fee321ed7a6.tar.bz2 |
Merge changes I73ec2f53,I77e2d9d8 into ub-jack
* changes:
TypeDeclaration.binding may be null
Test duplicate classes compilation error
Diffstat (limited to 'jack-tests/tests')
4 files changed, 72 insertions, 2 deletions
diff --git a/jack-tests/tests/com/android/jack/frontend/DuplicateSourceTest.java b/jack-tests/tests/com/android/jack/frontend/DuplicateSourceTest.java index 205400d..efa4c4d 100644 --- a/jack-tests/tests/com/android/jack/frontend/DuplicateSourceTest.java +++ b/jack-tests/tests/com/android/jack/frontend/DuplicateSourceTest.java @@ -35,7 +35,6 @@ public class DuplicateSourceTest { * command line. */ @Test - @Category(KnownBugs.class) public void test001() throws Exception { File output = AbstractTestTools.createTempDir(); ByteArrayOutputStream errOut = new ByteArrayOutputStream(); diff --git a/jack-tests/tests/com/android/jack/frontend/FrontEndTests.java b/jack-tests/tests/com/android/jack/frontend/FrontEndTests.java index 8018ade..875a4b6 100644 --- a/jack-tests/tests/com/android/jack/frontend/FrontEndTests.java +++ b/jack-tests/tests/com/android/jack/frontend/FrontEndTests.java @@ -69,7 +69,6 @@ public class FrontEndTests { * Test that we do not crash and that we report the error. */ @Test - @Category(KnownBugs.class) public void testConflictingPackage001() throws Exception { File outDir = AbstractTestTools.createTempDir(); @@ -115,6 +114,36 @@ public class FrontEndTests { } /** + * Test that we do not crash and that we report the error. + */ + @Test + public void testDuplicated001() throws Exception { + File outDir = AbstractTestTools.createTempDir(); + + JackApiToolchainBase toolchain = + AbstractTestTools.getCandidateToolchain(JackApiToolchainBase.class); + ByteArrayOutputStream out = new ByteArrayOutputStream(); + ByteArrayOutputStream err = new ByteArrayOutputStream(); + toolchain.setOutputStream(out); + toolchain.setErrorStream(err); + + try { + toolchain.addToClasspath(toolchain.getDefaultBootClasspath()) + .srcToLib( + outDir, + /* zipFiles= */ false, + AbstractTestTools.getTestRootDir("com.android.jack.frontend.test016.jack")); + Assert.fail(); + } catch (FrontendCompilationException e) { + Assert.assertEquals(0, out.size()); + String errString = err.toString(); + Assert.assertTrue(errString.contains("ERROR:")); + Assert.assertTrue(errString.contains("Duplicated")); + } + } + + + /** * Test that Jack is neither failing nor dropping warnings while ecj frontend is subject to skip * the local classes. */ diff --git a/jack-tests/tests/com/android/jack/frontend/test016/jack/Duplicated.java b/jack-tests/tests/com/android/jack/frontend/test016/jack/Duplicated.java new file mode 100644 index 0000000..41858c9 --- /dev/null +++ b/jack-tests/tests/com/android/jack/frontend/test016/jack/Duplicated.java @@ -0,0 +1,21 @@ +/* + * Copyright (C) 2015 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.frontend.test016.jack; + +class Duplicated { + +} diff --git a/jack-tests/tests/com/android/jack/frontend/test016/jack/WithDuplicated.java b/jack-tests/tests/com/android/jack/frontend/test016/jack/WithDuplicated.java new file mode 100644 index 0000000..41858c9 --- /dev/null +++ b/jack-tests/tests/com/android/jack/frontend/test016/jack/WithDuplicated.java @@ -0,0 +1,21 @@ +/* + * Copyright (C) 2015 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.frontend.test016.jack; + +class Duplicated { + +} |