[kernel] Start setting up test suite for round-trip serialization

Change-Id: I00920c41a5eaa99a7cc3eececff1caac94b1c1c9
Reviewed-on: https://dart-review.googlesource.com/c/88184
Commit-Queue: Dmitry Stefantsov <dmitryas@google.com>
Reviewed-by: Peter von der Ahé <ahe@google.com>
diff --git a/pkg/front_end/test/fasta/text_serialization_test.dart b/pkg/front_end/test/fasta/text_serialization_test.dart
new file mode 100644
index 0000000..205e9ab
--- /dev/null
+++ b/pkg/front_end/test/fasta/text_serialization_test.dart
@@ -0,0 +1,18 @@
+// Copyright (c) 2019, 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.md file.
+
+library fasta.test.text_serialization_test;
+
+import 'dart:async' show Future;
+
+import 'testing/suite.dart';
+
+Future<FastaContext> createContext(
+    Chain suite, Map<String, String> environment) {
+  environment[ENABLE_FULL_COMPILE] = "";
+  return FastaContext.create(suite, environment);
+}
+
+main([List<String> arguments = const []]) =>
+    runMe(arguments, createContext, "../../testing.json");
diff --git a/pkg/front_end/testcases/text_serialization.status b/pkg/front_end/testcases/text_serialization.status
new file mode 100644
index 0000000..5e30091
--- /dev/null
+++ b/pkg/front_end/testcases/text_serialization.status
@@ -0,0 +1,151 @@
+# Copyright (c) 2019, 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.md file.
+
+# Status file for the text_serialization_test.dart test suite. This is testing
+# the round trip for Kernel textual serialization where the initial binary
+# Kernel files are produced by compiling Dart code via Fasta.
+
+accessors: RuntimeError
+ambiguous_exports: RuntimeError # Expected, this file exports two main methods.
+argument_mismatch: InstrumentationMismatch # Test assumes Dart 1.0 semantics
+bug21938: TypeCheckError
+bug30695: TypeCheckError
+bug31124: RuntimeError # Test has no main method (and we shouldn't add one).
+bug32629: InstrumentationMismatch # Test has an intentional error
+call: TypeCheckError
+cascade: RuntimeError
+constructor_initializer_invalid: RuntimeError # Fails execution after recovery
+covariant_generic: RuntimeError
+duplicated_declarations: TypeCheckError
+duplicated_field_initializer: RuntimeError
+dynamic_and_void: InstrumentationMismatch # Test assumes Dart 1.0 semantics
+expressions: RuntimeError
+external_import: RuntimeError # The native extension to import doesn't exist. This is ok.
+fallthrough: ExpectationFileMismatch
+for_in_without_declaration: TypeCheckError
+incomplete_field_formal_parameter: RuntimeError
+inference/abstract_class_instantiation: InstrumentationMismatch # Issue #30040
+inference/conflicts_can_happen: TypeCheckError
+inference/conflicts_can_happen2: TypeCheckError
+inference/constructors_infer_from_arguments_argument_not_assignable: TypeCheckError
+inference/constructors_too_many_positional_arguments: InstrumentationMismatch # Issue #30040
+inference/do_not_infer_overridden_fields_that_explicitly_say_dynamic_infer: TypeCheckError
+inference/downwards_inference_annotations_type_variable: InstrumentationMismatch # Issue 28981
+inference/downwards_inference_on_function_of_t_using_the_t: InstrumentationMismatch # Issue #29798
+inference/downwards_inference_on_list_literals_infer_downwards: RuntimeError
+inference/future_then_explicit_future: InstrumentationMismatch # Issue #30040
+inference/future_then_upwards: RuntimeError
+inference/future_then_upwards_2: RuntimeError
+inference/generic_functions_return_typedef: InstrumentationMismatch # Issue #29798
+inference/generic_methods_correctly_recognize_generic_upper_bound: TypeCheckError
+inference/generic_methods_do_not_infer_invalid_override_of_generic_method: TypeCheckError
+inference/generic_methods_handle_override_of_non_generic_with_generic: TypeCheckError
+inference/generic_methods_infer_js_builtin: InstrumentationMismatch # Issue #30029
+inference/infer_field_override_multiple: TypeCheckError
+inference/infer_method_missing_params: TypeCheckError
+inference/infer_type_regardless_of_declaration_order_or_cycles: RuntimeError
+inference/infer_types_on_generic_instantiations_4: RuntimeError
+inference/infer_types_on_generic_instantiations_infer: TypeCheckError
+inference/instantiate_tearoff_of_call: TypeCheckError # Issue #31746
+inference/instantiate_to_bounds_generic_has_bound_defined_after transform: RuntimeError
+inference/mixin_inference_outwards_3: TypeCheckError
+inference/mixin_inference_outwards_4: TypeCheckError
+inference/mixin_inference_unification_1: TypeCheckError
+inference/mixin_inference_unification_2: TypeCheckError
+inference/override_equals: RuntimeError
+inference/unresolved_super: TypeCheckError
+inference/unsafe_block_closure_inference_function_call_explicit_dynamic_param_via_expr1: InstrumentationMismatch # Issue #25824
+inference/unsafe_block_closure_inference_function_call_explicit_dynamic_param_via_expr2: InstrumentationMismatch # Issue #25824
+inference/unsafe_block_closure_inference_function_call_explicit_type_param_via_expr1: InstrumentationMismatch # Issue #25824
+inference/unsafe_block_closure_inference_function_call_explicit_type_param_via_expr2: InstrumentationMismatch # Issue #25824
+inference_new/infer_assign_to_index_super_upwards: TypeCheckError
+inference_new/infer_assign_to_index_this_upwards: TypeCheckError
+inference_new/infer_assign_to_index_upwards: TypeCheckError
+inference_new/infer_assign_to_property_custom: TypeCheckError
+inference_new/infer_field_getter_setter_mismatch: TypeCheckError
+inference_new/infer_field_override_getter_overrides_setter: TypeCheckError
+inference_new/invalid_assignment_during_toplevel_inference: TypeCheckError
+instantiate_to_bound/non_simple_generic_function_in_bound_regress: RuntimeError # Expected
+instantiate_to_bound/non_simple_class_parametrized_typedef_cycle: RuntimeError # Expected
+invalid_type: TypeCheckError
+invocations: RuntimeError
+issue34899: TypeCheckError
+micro: RuntimeError
+mixin_application_override: TypeCheckError
+optional: TypeCheckError
+override_check_accessor_after_inference: TypeCheckError # Issue #31620
+override_check_accessor_basic: TypeCheckError # Issue #31620
+override_check_accessor_with_covariant_modifier: TypeCheckError # Issue #31620
+override_check_after_inference: TypeCheckError # Issue #31620
+override_check_basic: TypeCheckError # Issue #31620
+override_check_with_covariant_modifier: TypeCheckError # Issue #31620
+rasta/abstract_constructor: RuntimeError
+rasta/bad_constructor_redirection: RuntimeError
+rasta/bad_continue: RuntimeError
+rasta/bad_default_constructor: VerificationError
+rasta/bad_explicit_super_constructor: RuntimeError
+rasta/bad_implicit_super_constructor: RuntimeError
+rasta/bad_interpolation: RuntimeError
+rasta/bad_redirection: RuntimeError
+rasta/bad_setter_initializer: RuntimeError
+rasta/breaking_bad: RuntimeError
+rasta/class_hierarchy: RuntimeError
+rasta/class_member: RuntimeError
+rasta/constant_get_and_invoke: RuntimeError
+rasta/duplicated_mixin: RuntimeError # Expected, this file has no main method.
+rasta/export: RuntimeError # Expected, this file has no main method.
+rasta/foo: RuntimeError # Expected, this file has no main method.
+rasta/generic_factory: RuntimeError
+rasta/issue_000001: RuntimeError
+rasta/issue_000031: RuntimeError
+rasta/issue_000032: RuntimeError
+rasta/issue_000034: RuntimeError
+rasta/issue_000036: RuntimeError
+rasta/issue_000039: VerificationError
+rasta/issue_000041: RuntimeError
+rasta/issue_000042: RuntimeError
+rasta/issue_000043: RuntimeError
+rasta/issue_000044: RuntimeError
+rasta/issue_000046: RuntimeError
+rasta/issue_000081: RuntimeError
+rasta/malformed_const_constructor: RuntimeError
+rasta/malformed_function: RuntimeError
+rasta/mixin_library: TypeCheckError
+rasta/native_is_illegal: RuntimeError
+rasta/parser_error: RuntimeError
+rasta/static: RuntimeError
+rasta/super: TypeCheckError
+rasta/super_initializer: RuntimeError
+rasta/super_mixin: TypeCheckError
+rasta/super_operator: TypeCheckError
+rasta/type_literals: Crash
+rasta/typedef: Crash
+rasta/unresolved: RuntimeError
+rasta/unresolved_constructor: RuntimeError
+rasta/unresolved_for_in: RuntimeError
+rasta/unresolved_recovery: TypeCheckError
+regress/issue_29976: RuntimeError # Tests runtime behavior of error recovery.
+regress/issue_29982: RuntimeError # Tests runtime behavior of error recovery.
+regress/issue_30836: RuntimeError # Issue 30836.
+regress/issue_31299: TypeCheckError
+regress/issue_32200: RuntimeError # Invalid type.
+regress/issue_32972: TypeCheckError
+regress/issue_33452: RuntimeError # Test has an intentional error
+regress/issue_34225: RuntimeError
+regress/issue_34563: RuntimeError # Test execution after recovery
+regress/issue_35177: RuntimeError
+regress/issue_35258: RuntimeError # Expected
+regress/issue_35259: RuntimeError # Expected
+regress/issue_35260: RuntimeError # Expected
+regress/issue_35266: RuntimeError # Expected
+reject_generic_function_types_in_bounds: RuntimeError # Expected
+runtime_checks_new/contravariant_generic_return_with_compound_assign_implicit_downcast: RuntimeError
+runtime_checks_new/mixin_forwarding_stub_field: TypeCheckError
+runtime_checks_new/mixin_forwarding_stub_getter: TypeCheckError
+runtime_checks_new/mixin_forwarding_stub_setter: TypeCheckError
+statements: Crash
+type_variable_as_super: RuntimeError
+type_variable_prefix: RuntimeError
+void_methods: ExpectationFileMismatch
+warn_unresolved_sends: InstrumentationMismatch # Test assumes Dart 1.0 semantics
diff --git a/pkg/front_end/testing.json b/pkg/front_end/testing.json
index a63d66f..6ad3fa1 100644
--- a/pkg/front_end/testing.json
+++ b/pkg/front_end/testing.json
@@ -123,6 +123,24 @@
     },
 
     {
+      "name": "text_serialization",
+      "kind": "Chain",
+      "source": "test/fasta/text_serialization_test.dart",
+      "path": "testcases/",
+      "status": "testcases/text_serialization.status",
+      "pattern": [
+        "\\.dart$"
+      ],
+      "exclude": [
+        "/testcases/.*_part[0-9]*\\.dart$",
+        "/testcases/.*_lib[0-9]*\\.dart$",
+        "/testcases/dartino/",
+        "/testcases/shaker/",
+        "/testcases/expression/"
+      ]
+    },
+
+    {
       "name": "incremental",
       "kind": "Chain",
       "source": "test/fasta/incremental_test.dart",
diff --git a/pkg/pkg.status b/pkg/pkg.status
index b610fc1..47cc165 100644
--- a/pkg/pkg.status
+++ b/pkg/pkg.status
@@ -37,6 +37,7 @@
 front_end/test/fasta/sdk_test: SkipByDesign # sdk_test would take too long to complete, and should be run in a different way.
 front_end/test/fasta/shaker_test: Skip # Issue http://dartbug.com/32531
 front_end/test/fasta/strong_test: Pass, ExtraSlow
+front_end/test/fasta/text_serialization_test: Pass, ExtraSlow
 front_end/test/minimal_incremental_kernel_generator_test: Slow, Pass
 front_end/test/whole_program_test: Slow, Pass
 front_end/testcases/*: Skip # These are not tests but input for tests.
@@ -138,6 +139,7 @@
 front_end/test/fasta/ast_builder_test: Pass, Slow, Timeout
 front_end/test/fasta/bootstrap_test: Skip # Issue 31902
 front_end/test/fasta/strong_test: Pass, Slow, Timeout
+front_end/test/fasta/text_serialization_test: Pass, Slow, Timeout
 front_end/test/incremental_dart2js_load_from_dill_test: Pass, Slow
 front_end/test/whole_program_test: Skip # Issue 31902