Remove/skip invalid mirror tests.

-class of 1 is not required to declare int as an interface
-owner of members of mixin applications is the mixin
-MirrorsUsed does not have a semantics

R=gbracha@google.com

Review URL: https://codereview.chromium.org//706793002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41540 260f80e4-7a28-3924-810f-c04153c831b5
This commit is contained in:
rmacnak@google.com
2014-11-06 01:10:33 +00:00
parent d4cdb228f9
commit 77adbe5bca
6 changed files with 12 additions and 87 deletions
+5 -11
View File
@@ -73,7 +73,7 @@ mirrors/method_mirror_location_test: RuntimeError # Issue 6490
mirrors/mirrors_test: RuntimeError # TODO(ahe): I'm working on fixing this. When removing this line please change the "endsWith" to "/mirrors_test.dart".
mirrors/mirrors_nsm_test/dart2js: RuntimeError # Issue 19353
mirrors/mixin_test: RuntimeError # Issue 12464
mirrors/mixin_application_test/none: RuntimeError # Issue 12464
mirrors/mixin_application_test: RuntimeError # Issue 12464
mirrors/parameter_test/none: RuntimeError # Issue 6490
mirrors/parameter_of_mixin_app_constructor_test: RuntimeError # Issue 6490
mirrors/private_symbol_test: CompileTimeError # Issue 13597
@@ -89,7 +89,7 @@ mirrors/relation_subtype_test: RuntimeError # Issue 6490
mirrors/repeated_private_anon_mixin_app_test: RuntimeError # Issue 14670
mirrors/symbol_validation_test/01: RuntimeError # Issue 13597
mirrors/static_members_test: RuntimeError # Issue 14633, Issue 12164
mirrors/typedef_test/none: RuntimeError # http://dartbug.com/6490
mirrors/typedef_test: RuntimeError # http://dartbug.com/6490
mirrors/typedef_metadata_test: RuntimeError # Issue 12785
mirrors/typedef_reflected_type_test/01: RuntimeError # Issue 12607
mirrors/typevariable_mirror_metadata_test: CompileTimeError # Issue 10905
@@ -225,19 +225,13 @@ async/timer_test: Fail, Pass
async/timer_not_available_test: Fail, OK
mirrors/native_class_test: Fail, OK # This test is meant to run in a browser.
[ $compiler == none ]
mirrors/hierarchy_test: Fail # TODO(ahe): This test is slightly broken. http://dartbug.com/12464
mirrors/mixin_application_test/01: Fail, OK # TODO(ahe): Slight broken test to ensure test coverage on dart2js.
mirrors/intercepted_object_test: Fail, OK # TODO(ahe): Slight broken test to ensure test coverage on dart2js.
mirrors/typedef_test/01: Fail, OK # Incorrect dart2js behavior.
[ $compiler == none ]
async/timer_not_available_test: SkipByDesign # only meant to test when there is no way to implement timer (currently only in d8)
mirrors/generic_local_function_test: RuntimeError # Issue 14913
mirrors/symbol_validation_test: RuntimeError # Issue 13596
mirrors/mirrors_used_inheritance_test: RuntimeError # Issue 16048
async/timer_not_available_test: SkipByDesign # only meant to test when there is no way to implement timer (currently only in d8)
mirrors/typedef_declaration_test/01: Fail # dartbug.com/16048. Remove multitest marker when it passes.
mirrors/mirrors_used*: Skip # Invalid tests.
[ $compiler == none && ( $runtime == drt || $runtime == dartium || $runtime == ContentShellOnAndroid) ]
async/schedule_microtask6_test: Fail # Issue 10910
-55
View File
@@ -1,55 +0,0 @@
// Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
library hierarchy_test;
@MirrorsUsed(targets: 'hierarchy_test, Object')
import 'dart:mirrors';
import 'package:expect/expect.dart';
class FooMixin {
foo() => print('foo');
}
class Qux {
qux() => print('qux');
}
class Bar extends Qux implements FooMixin {
bar() => print('bar');
foo() => print('foo');
}
class Baz extends Qux with FooMixin {
bar() => print('bar');
}
stringifyHierarchy(mirror) {
var sb = new StringBuffer();
for (var type = mirror.type; type != null; type = type.superclass) {
sb.write('> ${MirrorSystem.getName(type.qualifiedName)}\n');
for (var i in type.superinterfaces) {
sb.write(' + ${MirrorSystem.getName(i.qualifiedName)}\n');
}
}
return '$sb';
}
main() {
Expect.stringEquals('''
> hierarchy_test.Bar
+ hierarchy_test.FooMixin
> hierarchy_test.Qux
> dart.core.Object
''', stringifyHierarchy(reflect(new Bar()..foo()..bar()..qux())));
Expect.stringEquals('''
> hierarchy_test.Baz
> hierarchy_test.Qux with hierarchy_test.FooMixin
+ hierarchy_test.FooMixin
> hierarchy_test.Qux
> dart.core.Object
''', stringifyHierarchy(reflect(new Baz()..foo()..bar()..qux())));
}
@@ -25,6 +25,12 @@ checkImplements(object, String name) {
return;
}
}
// A class implements itself, even if not explicitly declared.
if (symName == stringify(cls.simpleName)) {
checkClassMirrorMethods(cls);
return;
}
// TODO(floitsch): use correct fail
expect(name, "super interface not found");
@@ -118,7 +118,6 @@ testMixinApplication() {
]);
String owner = 'Mixin';
owner = 'MixinApplication'; /// 01: ok
expect(
'{i: Variable(s(i) in s($owner)),'
' m: Method(s(m) in s($owner))}',
@@ -132,9 +131,7 @@ testMixinApplication() {
}
testMixinApplicationA() {
// TODO(ahe): I don't think an anonymous mixin has an owner.
String owner = ' in s(test.mixin_application_test)';
owner = ''; /// 01: ok
checkClass(MixinApplicationA, [
'Class(s(MixinApplicationA)'
' in s(test.mixin_application_test), top-level)',
@@ -147,7 +144,6 @@ testMixinApplicationA() {
]);
owner = 'Mixin2';
owner = 'MixinApplicationA'; /// 01: ok
expect(
'{i2: Variable(s(i2) in s($owner)),'
' m2: Method(s(m2) in s($owner))}',
@@ -164,7 +160,6 @@ testMixinApplicationA() {
membersOf(reflectClass(MixinApplicationA).superclass));
String name = 'test.model.C with test.mixin_application_test.Mixin';
name = 'Mixin'; /// 01: ok
expect(
'{$name:'
' Method(s($name)'
@@ -187,7 +182,6 @@ testUnusedMixinApplication() {
]);
String owner = 'Mixin';
owner = 'UnusedMixinApplication'; /// 01: ok
expect(
'{i: Variable(s(i) in s($owner)),'
' m: Method(s(m) in s($owner))}',
@@ -203,7 +197,6 @@ testUnusedMixinApplication() {
testSubclass() {
String owner = ' in s(test.mixin_application_test)';
owner = ''; /// 01: ok
checkClass(Subclass, [
'Class(s(Subclass) in s(test.mixin_application_test), top-level)',
'Class(s(test.model.C with test.mixin_application_test.Mixin)'
@@ -228,7 +221,6 @@ testSubclass() {
membersOf(reflectClass(Subclass).superclass));
String name = 'test.model.C with test.mixin_application_test.Mixin';
name = 'Mixin'; /// 01: ok
expect(
'{$name:'
' Method(s($name)'
@@ -264,9 +256,7 @@ testSubclass2() {
}
testSubclassA() {
// TODO(ahe): I don't think an anonymous mixin has an owner.
String owner = ' in s(test.mixin_application_test)';
owner = ''; /// 01: ok
checkClass(SubclassA, [
'Class(s(SubclassA) in s(test.mixin_application_test), top-level)',
'Class(s(test.model.C with test.mixin_application_test.Mixin,'
@@ -295,7 +285,6 @@ testSubclassA() {
String name =
'test.model.C with test.mixin_application_test.Mixin,'
' test.mixin_application_test.Mixin2';
name = 'Mixin2'; /// 01: ok
expect(
'{$name: Method(s($name) in s($name), constructor)}',
constructorsOf(reflectClass(SubclassA).superclass));
@@ -306,7 +295,6 @@ testSubclassA() {
membersOf(reflectClass(SubclassA).superclass.superclass));
name = 'test.model.C with test.mixin_application_test.Mixin';
name = 'Mixin'; /// 01: ok
expect(
'{$name:'
' Method(s($name)'
@@ -319,9 +307,7 @@ testSubclassA() {
}
testSubclass2A() {
// TODO(ahe): I don't think an anonymous mixin has an owner.
String owner = ' in s(test.mixin_application_test)';
owner = ''; /// 01: ok
checkClass(Subclass2A, [
'Class(s(Subclass2A) in s(test.mixin_application_test), top-level)',
'Class(s(MixinApplicationA) in s(test.mixin_application_test),'
+1 -7
View File
@@ -43,19 +43,13 @@ check(t) {
// Return "$args -> $ret".
ft(args, ret) {
return '$args -> $ret'
// TODO(ahe): dart2js doesn't fully qualify type names.
.replaceAll('dart.core.', '') /// 01: ok
;
return '$args -> $ret';
}
void main() {
String x = 'x';
String y = 'y';
String z = 'z';
x = 'argument0'; /// 01: ok
y = 'argument1'; /// 01: ok
z = 'argument2'; /// 01: ok
Expect.stringEquals(
"""