diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 41b6450a0a79..e393cfec1bab 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -86,14 +86,6 @@ repos: language: python files: ^executable_semantics/syntax/parser.ypp$ pass_filenames: false - - id: executable-semantics-tests - name: Update list of executable_semantics tests - description: Updates executable_semantics/test_list.bzl - entry: executable_semantics/tests.py - language: python - files: ^executable_semantics/(test_list.bzl|testdata/.*\.carbon)$ - pass_filenames: false - args: ['--update_list', '--use_git_ls_files'] - id: proposal-list name: Update list of proposals description: Updates the list of proposals in proposals/README.md diff --git a/bazel/testing/BUILD b/bazel/testing/BUILD index 79f78bf76308..097d80dde97f 100644 --- a/bazel/testing/BUILD +++ b/bazel/testing/BUILD @@ -2,4 +2,4 @@ # Exceptions. See /LICENSE for license information. # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -exports_files(["golden_test.py"]) +exports_files(["lit_test.py"]) diff --git a/bazel/testing/golden_test.bzl b/bazel/testing/golden_test.bzl deleted file mode 100644 index 0d70c3ec80a9..000000000000 --- a/bazel/testing/golden_test.bzl +++ /dev/null @@ -1,33 +0,0 @@ -# Part of the Carbon Language project, under the Apache License v2.0 with LLVM -# Exceptions. See /LICENSE for license information. -# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception - -"""Rule for a golden test.""" - -def golden_test(name, golden, cmd, data, env = None, golden_is_subset = False, **kwargs): - """Compares two files. Passes if they are identical. - - Args: - name: Name of the build rule. - cmd: The command whose output is being tested. - golden: The golden file to be compared against the command output. - data: Data files. - env: Optional environment. - golden_is_subset: Set to True if the golden file should be a subset of - command output. - **kwargs: Any additional parameters for the generated py_test. - """ - args = ["$(location %s)" % golden, cmd] - if not env: - env = {} - if golden_is_subset: - args.append("--golden_is_subset") - native.py_test( - name = name, - srcs = ["//bazel/testing:golden_test.py"], - main = "//bazel/testing:golden_test.py", - args = args, - data = [golden] + data, - env = env, - **kwargs - ) diff --git a/bazel/testing/golden_test.py b/bazel/testing/golden_test.py deleted file mode 100644 index a3fd3d796db0..000000000000 --- a/bazel/testing/golden_test.py +++ /dev/null @@ -1,147 +0,0 @@ -#!/usr/bin/env python3 - -"""Compare a command's output against an expected "golden" output file. - -Usage: - -golden_test.py [--update] - - is the path to the golden file, and is -the command to run, including any arguments. If --update is specified, -the command will be run and its output stored in the golden file. -Otherwise, the command will be run and its output compared against -the contents of the golden file. - -For these purposes, the command's output consists of the interleaved -contents of stdout and stderr, as well as the command's exit code. Thus, -golden tests can provide coverage of cases where the command is expected -to fail, as well as cases where it's expected to succeed. - -This script is designed to be run by a `golden_test` Bazel rule, -and may not work when run outside that context. -""" - -__copyright__ = """ -Part of the Carbon Language project, under the Apache License v2.0 with LLVM -Exceptions. See /LICENSE for license information. -SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -""" - -import argparse -import difflib -import os -import subprocess -import sys - - -_ERROR_MESSAGE = """When running under: - {dir} -the golden contents of: - {golden_path} -do not match generated output of: - {subject_cmd_args} -""" - -_UPDATE_MESSAGE = """To update the golden file, run the following: - - bazel run {test_target} -- --update -""" - - -def _parse_args(): - """Parses command line arguments, returning the result.""" - arg_parser = argparse.ArgumentParser(description=__doc__) - arg_parser.add_argument("golden_path", help="The path to the golden file.") - arg_parser.add_argument( - "subject_command", help="The command line to compare output with." - ) - arg_parser.add_argument( - "--golden_is_subset", - action="store_true", - help="Indicates that the golden file will be a subset of output, " - "rather than full output.", - ) - arg_parser.add_argument( - "--update", - action="store_true", - help="Whether to update the golden file.", - ) - return arg_parser.parse_args() - - -def _get_subject_output(args): - """Returns output from the subject command.""" - subject_cmd = subprocess.run( - args=args.subject_command.split(), - stdout=subprocess.PIPE, # Capture stdout as a string - stderr=subprocess.STDOUT, # Send stderr to the same place as stdout - universal_newlines=True, - ) - - subject = subject_cmd.stdout - if subject_cmd.returncode != 0: - subject += "EXIT CODE: {0}\n".format(subject_cmd.returncode) - - return subject - - -def _check_diff(args, subject): - """Prints and checks the diff. Returns the appropriate exit code.""" - subject_lines = subject.splitlines(keepends=True) - with open(args.golden_path) as golden: - golden_lines = list(golden.readlines()) - if args.golden_is_subset: - golden_set = frozenset(golden_lines) - subject_lines = [line for line in subject_lines if line in golden_set] - context_diff = list( - difflib.context_diff( - subject_lines, golden_lines, fromfile="subject", tofile="golden" - ) - ) - if context_diff: - if args.golden_is_subset: - # Print subject output for context, because it may be useful in - # debugging. - print("=" * 80) - print("Subject output (including ignored lines)") - print("=" * 80) - print(subject) - print("=" * 80) - print("Output diff") - print("=" * 80) - sys.stdout.writelines(context_diff) - print("=" * 80) - print( - _ERROR_MESSAGE.format( - dir=os.getenv("TEST_SRCDIR"), - golden_path=args.golden_path, - subject_cmd_args=args.subject_command, - ) - ) - if not args.golden_is_subset: - print( - _UPDATE_MESSAGE.format( - test_target=os.getenv("TEST_TARGET"), - ) - ) - - return 1 - else: - print("PASS") - return 0 - - -def main(): - args = _parse_args() - subject = _get_subject_output(args) - - if args.update: - with open(args.golden_path, "w") as golden: - golden.write(subject) - return 0 - - return _check_diff(args, subject) - - -if __name__ == "__main__": - sys.exit(main()) diff --git a/bazel/testing/lit_test.bzl b/bazel/testing/lit_test.bzl new file mode 100644 index 000000000000..cc3c5b973f4e --- /dev/null +++ b/bazel/testing/lit_test.bzl @@ -0,0 +1,38 @@ +# Part of the Carbon Language project, under the Apache License v2.0 with LLVM +# Exceptions. See /LICENSE for license information. +# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception + +"""Rule for a lit test.""" + +def lit_test(name, test_dir, tools = None, **kwargs): + """Runs `lit` on test_dir. + + `lit` reference: + https://llvm.org/docs/CommandGuide/lit.html + + To pass flags to `lit`, use `--test_arg`. For example: + bazel test :lit_test --test_arg=-v + bazel test :lit_test --test_arg=--filter=REGEXP + + Args: + name: Name of the build rule. + test_dir: The directory with the lit tests. + tools: An optional list of tools to provide to the tests. These will be + aliased for execution. + **kwargs: Any additional parameters for the generated py_test. + """ + if not tools: + tools = [] + tools += [ + "@llvm-project//llvm:lit", + "@llvm-project//llvm:not", + "@llvm-project//llvm:FileCheck", + ] + native.py_test( + name = name, + srcs = ["//bazel/testing:lit_test.py"], + main = "//bazel/testing:lit_test.py", + data = tools + native.glob([test_dir + "/**"]), + args = ["--tool=%s" % t for t in tools] + [test_dir, "--"], + **kwargs + ) diff --git a/bazel/testing/lit_test.py b/bazel/testing/lit_test.py new file mode 100644 index 000000000000..44e2851de859 --- /dev/null +++ b/bazel/testing/lit_test.py @@ -0,0 +1,93 @@ +"""Runs `lit` for testing.""" + +__copyright__ = """ +Part of the Carbon Language project, under the Apache License v2.0 with LLVM +Exceptions. See /LICENSE for license information. +SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +""" + +import argparse +import os +import subprocess + +_PASSTHROUGH_FLAGS = ["filter", "filter-out"] + + +def _parse_args(): + """Parses command line arguments, returning the result.""" + arg_parser = argparse.ArgumentParser(description=__doc__) + arg_parser.add_argument( + "test_dir", help="The directory containing tests to run." + ) + arg_parser.add_argument( + "lit_args", nargs="*", help="Arguments to pass through to lit." + ) + arg_parser.add_argument( + "--tool", action="append", help="A tool to add to the PATH." + ) + return arg_parser.parse_args() + + +def _normalize(relative_base, target): + """Given a target, normalizes it to a relative path.""" + assert target + if target.startswith(":"): + # Local target; :foo -> my/dir/foo + return os.path.join(relative_base, target[1:]) + elif target[0].isalpha(): + # Local target; foo -> my/dir/foo + return os.path.join(relative_base, target) + + if ":" in target: + # Specified target; //foo:bar -> //foo/bar + target = target.replace(":", "/") + else: + # Default target; //foo -> //foo/foo + target = os.path.join(target, os.path.basename(target)) + + if target.startswith("@"): + return os.path.join("external/", target[1:]) + elif target.startswith("//"): + return target[2:] + else: + raise ValueError("Unhandled target path: %s" % target) + + +def main(): + parsed_args = _parse_args() + + # A symlink directory is added to the PATH so that commands like `lit` and + # `not` can use the versions in the path. + symlink_dir = os.environ["TEST_TMPDIR"] + + # Create symlinks to all the tools. + bin_dir = os.getcwd() + relative_base = os.path.dirname(_normalize("", os.environ["TEST_TARGET"])) + for tool in parsed_args.tool: + tool_path = _normalize(relative_base, tool) + symlink_loc = os.path.join(symlink_dir, os.path.basename(tool_path)) + symlinked_file = os.path.join(bin_dir, tool_path) + if not os.path.exists(symlinked_file): + raise ValueError("Missing file: %s" % symlinked_file) + os.symlink(symlinked_file, symlink_loc) + + # Figure out the actual path for the test_dir. + test_dir = os.path.join( + bin_dir, _normalize(relative_base, parsed_args.test_dir) + ) + + args = [ + os.path.join(symlink_dir, "lit"), + "--path=%s" % symlink_dir, + test_dir, + ] + + # Run lit. + p = subprocess.run(args=args + parsed_args.lit_args) + # Do this instead of check_call to hide stack traces. + if p.returncode != 0: + exit("lit failed, exit code %d" % p.returncode) + + +if __name__ == "__main__": + exit(main()) diff --git a/executable_semantics/BUILD b/executable_semantics/BUILD index 5a17f7d0e203..c69935958890 100644 --- a/executable_semantics/BUILD +++ b/executable_semantics/BUILD @@ -2,8 +2,7 @@ # Exceptions. See /LICENSE for license information. # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -load("//bazel/testing:golden_test.bzl", "golden_test") -load("test_list.bzl", "TEST_LIST") +load("//bazel/testing:lit_test.bzl", "lit_test") cc_binary( name = "executable_semantics", @@ -16,38 +15,8 @@ cc_binary( ], ) -[golden_test( - name = "%s_test" % e, - cmd = "'$(location executable_semantics) $(location testdata/%s.carbon)'" % e, - data = [ - ":executable_semantics", - "testdata/%s.carbon" % e, - ], - golden = "testdata/%s.golden" % e, -) for e in TEST_LIST] - -# Convenience suite for running golden tests. -test_suite( - name = "golden_tests", - tests = [":%s_test" % e for e in TEST_LIST], -) - -# Test --trace by expecting golden output to be a *subset* of trace output. Note -# the normal test must be used to update golden files. -[golden_test( - name = "%s_trace_test" % e, - cmd = "'$(location executable_semantics) --trace " + - "$(location testdata/%s.carbon)'" % e, - data = [ - ":executable_semantics", - "testdata/%s.carbon" % e, - ], - golden = "testdata/%s.golden" % e, - golden_is_subset = True, -) for e in TEST_LIST] - -# Convenience suite for running trace tests. -test_suite( - name = "trace_tests", - tests = [":%s_trace_test" % e for e in TEST_LIST], +lit_test( + name = "executable_semantics_lit_test", + test_dir = "testdata", + tools = [":executable_semantics"], ) diff --git a/executable_semantics/test_list.bzl b/executable_semantics/test_list.bzl deleted file mode 100644 index 3d0cfbb701b7..000000000000 --- a/executable_semantics/test_list.bzl +++ /dev/null @@ -1,115 +0,0 @@ -# Part of the Carbon Language project, under the Apache License v2.0 with LLVM -# Exceptions. See /LICENSE for license information. -# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception - -"""Auto-generated list of tests. Run `./tests.py --update_list` to update.""" - -TEST_LIST = [ - "assignment_copy1", - "assignment_copy2", - "block1", - "block2", - "break1", - "choice1", - "class1", - "class2", - "class3", - "class_field_access_mismatch", - "class_field_mismatch", - "class_field_missing", - "continue1", - "experimental_continuation1", - "experimental_continuation2", - "experimental_continuation3", - "experimental_continuation4", - "experimental_continuation5", - "experimental_continuation6", - "experimental_continuation7", - "experimental_continuation9", - "fun1", - "fun2", - "fun3", - "fun4", - "fun5", - "fun6_fail_type", - "fun_named_params", - "fun_named_params2", - "fun_recur", - "funptr1", - "generic_function1", - "generic_function2", - "generic_function3", - "generic_function_apply", - "generic_function_fail1", - "generic_function_fail2", - "generic_function_fail3", - "generic_function_swap", - "generic_function_tuple_map", - "global_variable1", - "global_variable2", - "global_variable3", - "global_variable4", - "global_variable5", - "global_variable6", - "global_variable7", - "global_variable8", - "if_else", - "if_else_if", - "if_else_if_else", - "if_false", - "if_nesting", - "if_true", - "ignored_parameter", - "import_late", - "import_nonexistent_library", - "import_nonexistent_package", - "invalid_char", - "match_any_int", - "match_int", - "match_int_default", - "match_placeholder", - "next", - "no_match", - "package_library", - "package_missing", - "pattern_init", - "pattern_variable_fail", - "placeholder_variable", - "print1", - "record1", - "return_auto", - "return_empty_explicit", - "return_empty_explicit_fail", - "return_empty_implicit1", - "return_empty_implicit2", - "return_empty_implicit_fail1", - "return_empty_implicit_fail2", - "star", - "string1", - "string2", - "string3", - "string_fail1", - "string_fail2", - "string_fail3", - "string_fail4", - "string_fail5", - "string_fail6", - "tuple1", - "tuple2", - "tuple3", - "tuple4", - "tuple5", - "tuple_assign", - "tuple_equality", - "tuple_equality2", - "tuple_equality3", - "tuple_match", - "tuple_match2", - "tuple_match3", - "type_compute", - "type_compute2", - "type_compute3", - "type_match", - "while1", - "zero", -] diff --git a/executable_semantics/testdata/assignment_copy1.carbon b/executable_semantics/testdata/assignment_copy1.carbon index 2ce230b44d70..1603da5569e6 100644 --- a/executable_semantics/testdata/assignment_copy1.carbon +++ b/executable_semantics/testdata/assignment_copy1.carbon @@ -1,6 +1,13 @@ // Part of the Carbon Language project, under the Apache License v2.0 with LLVM // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +// RUN: executable_semantics %s 2>&1 | \ +// RUN: FileCheck --match-full-lines --allow-unused-prefixes=false %s +// RUN: executable_semantics --trace %s 2>&1 | \ +// RUN: FileCheck --match-full-lines --allow-unused-prefixes %s +// AUTOUPDATE: executable_semantics %s +// CHECK: result: 0 package ExecutableSemanticsTest api; diff --git a/executable_semantics/testdata/assignment_copy1.golden b/executable_semantics/testdata/assignment_copy1.golden deleted file mode 100644 index 2db2755da426..000000000000 --- a/executable_semantics/testdata/assignment_copy1.golden +++ /dev/null @@ -1 +0,0 @@ -result: 0 diff --git a/executable_semantics/testdata/assignment_copy2.carbon b/executable_semantics/testdata/assignment_copy2.carbon index ea47574404db..f5ca262aa721 100644 --- a/executable_semantics/testdata/assignment_copy2.carbon +++ b/executable_semantics/testdata/assignment_copy2.carbon @@ -1,6 +1,13 @@ // Part of the Carbon Language project, under the Apache License v2.0 with LLVM // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +// RUN: executable_semantics %s 2>&1 | \ +// RUN: FileCheck --match-full-lines --allow-unused-prefixes=false %s +// RUN: executable_semantics --trace %s 2>&1 | \ +// RUN: FileCheck --match-full-lines --allow-unused-prefixes %s +// AUTOUPDATE: executable_semantics %s +// CHECK: result: 0 package ExecutableSemanticsTest api; diff --git a/executable_semantics/testdata/assignment_copy2.golden b/executable_semantics/testdata/assignment_copy2.golden deleted file mode 100644 index 2db2755da426..000000000000 --- a/executable_semantics/testdata/assignment_copy2.golden +++ /dev/null @@ -1 +0,0 @@ -result: 0 diff --git a/executable_semantics/testdata/block1.carbon b/executable_semantics/testdata/block1.carbon index 27014dc98af4..cbe9e1ec41a3 100644 --- a/executable_semantics/testdata/block1.carbon +++ b/executable_semantics/testdata/block1.carbon @@ -1,6 +1,13 @@ // Part of the Carbon Language project, under the Apache License v2.0 with LLVM // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +// RUN: executable_semantics %s 2>&1 | \ +// RUN: FileCheck --match-full-lines --allow-unused-prefixes=false %s +// RUN: executable_semantics --trace %s 2>&1 | \ +// RUN: FileCheck --match-full-lines --allow-unused-prefixes %s +// AUTOUPDATE: executable_semantics %s +// CHECK: result: 0 package ExecutableSemanticsTest api; diff --git a/executable_semantics/testdata/block1.golden b/executable_semantics/testdata/block1.golden deleted file mode 100644 index 2db2755da426..000000000000 --- a/executable_semantics/testdata/block1.golden +++ /dev/null @@ -1 +0,0 @@ -result: 0 diff --git a/executable_semantics/testdata/block2.carbon b/executable_semantics/testdata/block2.carbon index b3651b091dd9..5d4622d3f34a 100644 --- a/executable_semantics/testdata/block2.carbon +++ b/executable_semantics/testdata/block2.carbon @@ -1,6 +1,13 @@ // Part of the Carbon Language project, under the Apache License v2.0 with LLVM // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +// RUN: executable_semantics %s 2>&1 | \ +// RUN: FileCheck --match-full-lines --allow-unused-prefixes=false %s +// RUN: executable_semantics --trace %s 2>&1 | \ +// RUN: FileCheck --match-full-lines --allow-unused-prefixes %s +// AUTOUPDATE: executable_semantics %s +// CHECK: result: 0 package ExecutableSemanticsTest api; diff --git a/executable_semantics/testdata/block2.golden b/executable_semantics/testdata/block2.golden deleted file mode 100644 index 2db2755da426..000000000000 --- a/executable_semantics/testdata/block2.golden +++ /dev/null @@ -1 +0,0 @@ -result: 0 diff --git a/executable_semantics/testdata/break1.carbon b/executable_semantics/testdata/break1.carbon index 419179e1146e..cde9fb3be9eb 100644 --- a/executable_semantics/testdata/break1.carbon +++ b/executable_semantics/testdata/break1.carbon @@ -1,6 +1,13 @@ // Part of the Carbon Language project, under the Apache License v2.0 with LLVM // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +// RUN: executable_semantics %s 2>&1 | \ +// RUN: FileCheck --match-full-lines --allow-unused-prefixes=false %s +// RUN: executable_semantics --trace %s 2>&1 | \ +// RUN: FileCheck --match-full-lines --allow-unused-prefixes %s +// AUTOUPDATE: executable_semantics %s +// CHECK: result: 0 package ExecutableSemanticsTest api; diff --git a/executable_semantics/testdata/break1.golden b/executable_semantics/testdata/break1.golden deleted file mode 100644 index 2db2755da426..000000000000 --- a/executable_semantics/testdata/break1.golden +++ /dev/null @@ -1 +0,0 @@ -result: 0 diff --git a/executable_semantics/testdata/choice1.carbon b/executable_semantics/testdata/choice1.carbon index ca12a8a1b47a..05dd56bcbf1e 100644 --- a/executable_semantics/testdata/choice1.carbon +++ b/executable_semantics/testdata/choice1.carbon @@ -1,6 +1,13 @@ // Part of the Carbon Language project, under the Apache License v2.0 with LLVM // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +// RUN: executable_semantics %s 2>&1 | \ +// RUN: FileCheck --match-full-lines --allow-unused-prefixes=false %s +// RUN: executable_semantics --trace %s 2>&1 | \ +// RUN: FileCheck --match-full-lines --allow-unused-prefixes %s +// AUTOUPDATE: executable_semantics %s +// CHECK: result: 0 package ExecutableSemanticsTest api; diff --git a/executable_semantics/testdata/choice1.golden b/executable_semantics/testdata/choice1.golden deleted file mode 100644 index 2db2755da426..000000000000 --- a/executable_semantics/testdata/choice1.golden +++ /dev/null @@ -1 +0,0 @@ -result: 0 diff --git a/executable_semantics/testdata/class1.carbon b/executable_semantics/testdata/class1.carbon index 86ca039a0436..d3574e2ec11b 100644 --- a/executable_semantics/testdata/class1.carbon +++ b/executable_semantics/testdata/class1.carbon @@ -1,6 +1,13 @@ // Part of the Carbon Language project, under the Apache License v2.0 with LLVM // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +// RUN: executable_semantics %s 2>&1 | \ +// RUN: FileCheck --match-full-lines --allow-unused-prefixes=false %s +// RUN: executable_semantics --trace %s 2>&1 | \ +// RUN: FileCheck --match-full-lines --allow-unused-prefixes %s +// AUTOUPDATE: executable_semantics %s +// CHECK: result: 0 package ExecutableSemanticsTest api; diff --git a/executable_semantics/testdata/class1.golden b/executable_semantics/testdata/class1.golden deleted file mode 100644 index 2db2755da426..000000000000 --- a/executable_semantics/testdata/class1.golden +++ /dev/null @@ -1 +0,0 @@ -result: 0 diff --git a/executable_semantics/testdata/class2.carbon b/executable_semantics/testdata/class2.carbon index 838a9c65b978..0b0f0abc3aec 100644 --- a/executable_semantics/testdata/class2.carbon +++ b/executable_semantics/testdata/class2.carbon @@ -1,6 +1,13 @@ // Part of the Carbon Language project, under the Apache License v2.0 with LLVM // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +// RUN: executable_semantics %s 2>&1 | \ +// RUN: FileCheck --match-full-lines --allow-unused-prefixes=false %s +// RUN: executable_semantics --trace %s 2>&1 | \ +// RUN: FileCheck --match-full-lines --allow-unused-prefixes %s +// AUTOUPDATE: executable_semantics %s +// CHECK: result: 0 package ExecutableSemanticsTest api; diff --git a/executable_semantics/testdata/class2.golden b/executable_semantics/testdata/class2.golden deleted file mode 100644 index 2db2755da426..000000000000 --- a/executable_semantics/testdata/class2.golden +++ /dev/null @@ -1 +0,0 @@ -result: 0 diff --git a/executable_semantics/testdata/class3.carbon b/executable_semantics/testdata/class3.carbon index bf5a8ae7ba8c..7ceb047e3ee4 100644 --- a/executable_semantics/testdata/class3.carbon +++ b/executable_semantics/testdata/class3.carbon @@ -1,6 +1,13 @@ // Part of the Carbon Language project, under the Apache License v2.0 with LLVM // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +// RUN: executable_semantics %s 2>&1 | \ +// RUN: FileCheck --match-full-lines --allow-unused-prefixes=false %s +// RUN: executable_semantics --trace %s 2>&1 | \ +// RUN: FileCheck --match-full-lines --allow-unused-prefixes %s +// AUTOUPDATE: executable_semantics %s +// CHECK: result: 0 package ExecutableSemanticsTest api; diff --git a/executable_semantics/testdata/class3.golden b/executable_semantics/testdata/class3.golden deleted file mode 100644 index 2db2755da426..000000000000 --- a/executable_semantics/testdata/class3.golden +++ /dev/null @@ -1 +0,0 @@ -result: 0 diff --git a/executable_semantics/testdata/class_field_access_mismatch.carbon b/executable_semantics/testdata/class_field_access_mismatch.carbon index 5283b9a2fdfc..7c266a31b0aa 100644 --- a/executable_semantics/testdata/class_field_access_mismatch.carbon +++ b/executable_semantics/testdata/class_field_access_mismatch.carbon @@ -1,6 +1,14 @@ // Part of the Carbon Language project, under the Apache License v2.0 with LLVM // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +// RUN: not executable_semantics %s 2>&1 | \ +// RUN: FileCheck --match-full-lines --allow-unused-prefixes=false %s +// RUN: not executable_semantics --trace %s 2>&1 | \ +// RUN: FileCheck --match-full-lines --allow-unused-prefixes %s +// AUTOUPDATE: executable_semantics %s +// CHECK: COMPILATION ERROR: {{.*}}/class_field_access_mismatch.carbon:21: class Point does not have a field named z + package ExecutableSemanticsTest api; diff --git a/executable_semantics/testdata/class_field_access_mismatch.golden b/executable_semantics/testdata/class_field_access_mismatch.golden deleted file mode 100644 index 4e96bed3d862..000000000000 --- a/executable_semantics/testdata/class_field_access_mismatch.golden +++ /dev/null @@ -1,2 +0,0 @@ -COMPILATION ERROR: executable_semantics/testdata/class_field_access_mismatch.carbon:13: class Point does not have a field named z -EXIT CODE: 255 diff --git a/executable_semantics/testdata/class_field_mismatch.carbon b/executable_semantics/testdata/class_field_mismatch.carbon index c8dc5930163b..629d050b3e8c 100644 --- a/executable_semantics/testdata/class_field_mismatch.carbon +++ b/executable_semantics/testdata/class_field_mismatch.carbon @@ -1,6 +1,16 @@ // Part of the Carbon Language project, under the Apache License v2.0 with LLVM // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +// RUN: not executable_semantics %s 2>&1 | \ +// RUN: FileCheck --match-full-lines --allow-unused-prefixes=false %s +// RUN: not executable_semantics --trace %s 2>&1 | \ +// RUN: FileCheck --match-full-lines --allow-unused-prefixes %s +// AUTOUPDATE: executable_semantics %s +// CHECK: COMPILATION ERROR: {{.*}}/class_field_mismatch.carbon:23: type error in call +// CHECK: expected: (x = i32, y = i32) +// CHECK: actual: (x = i32, z = i32) + package ExecutableSemanticsTest api; diff --git a/executable_semantics/testdata/class_field_mismatch.golden b/executable_semantics/testdata/class_field_mismatch.golden deleted file mode 100644 index 66e557f97660..000000000000 --- a/executable_semantics/testdata/class_field_mismatch.golden +++ /dev/null @@ -1,4 +0,0 @@ -COMPILATION ERROR: executable_semantics/testdata/class_field_mismatch.carbon:13: type error in call -expected: (x = i32, y = i32) -actual: (x = i32, z = i32) -EXIT CODE: 255 diff --git a/executable_semantics/testdata/class_field_missing.carbon b/executable_semantics/testdata/class_field_missing.carbon index 3fc71fc0b61f..25d3e3f4694d 100644 --- a/executable_semantics/testdata/class_field_missing.carbon +++ b/executable_semantics/testdata/class_field_missing.carbon @@ -1,6 +1,16 @@ // Part of the Carbon Language project, under the Apache License v2.0 with LLVM // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +// RUN: not executable_semantics %s 2>&1 | \ +// RUN: FileCheck --match-full-lines --allow-unused-prefixes=false %s +// RUN: not executable_semantics --trace %s 2>&1 | \ +// RUN: FileCheck --match-full-lines --allow-unused-prefixes %s +// AUTOUPDATE: executable_semantics %s +// CHECK: COMPILATION ERROR: {{.*}}/class_field_missing.carbon:23: type error in call +// CHECK: expected: (x = i32, y = i32) +// CHECK: actual: (x = i32) + package ExecutableSemanticsTest api; diff --git a/executable_semantics/testdata/class_field_missing.golden b/executable_semantics/testdata/class_field_missing.golden deleted file mode 100644 index ab9861632476..000000000000 --- a/executable_semantics/testdata/class_field_missing.golden +++ /dev/null @@ -1,4 +0,0 @@ -COMPILATION ERROR: executable_semantics/testdata/class_field_missing.carbon:13: type error in call -expected: (x = i32, y = i32) -actual: (x = i32) -EXIT CODE: 255 diff --git a/executable_semantics/testdata/continue1.carbon b/executable_semantics/testdata/continue1.carbon index 75f6611d232b..968c03c28d6f 100644 --- a/executable_semantics/testdata/continue1.carbon +++ b/executable_semantics/testdata/continue1.carbon @@ -1,6 +1,13 @@ // Part of the Carbon Language project, under the Apache License v2.0 with LLVM // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +// RUN: executable_semantics %s 2>&1 | \ +// RUN: FileCheck --match-full-lines --allow-unused-prefixes=false %s +// RUN: executable_semantics --trace %s 2>&1 | \ +// RUN: FileCheck --match-full-lines --allow-unused-prefixes %s +// AUTOUPDATE: executable_semantics %s +// CHECK: result: 0 package ExecutableSemanticsTest api; diff --git a/executable_semantics/testdata/continue1.golden b/executable_semantics/testdata/continue1.golden deleted file mode 100644 index 2db2755da426..000000000000 --- a/executable_semantics/testdata/continue1.golden +++ /dev/null @@ -1 +0,0 @@ -result: 0 diff --git a/executable_semantics/testdata/experimental_continuation1.carbon b/executable_semantics/testdata/experimental_continuation1.carbon index 179814c5d3a5..ee0e8a3e00c7 100644 --- a/executable_semantics/testdata/experimental_continuation1.carbon +++ b/executable_semantics/testdata/experimental_continuation1.carbon @@ -1,6 +1,13 @@ // Part of the Carbon Language project, under the Apache License v2.0 with LLVM // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +// RUN: executable_semantics %s 2>&1 | \ +// RUN: FileCheck --match-full-lines --allow-unused-prefixes=false %s +// RUN: executable_semantics --trace %s 2>&1 | \ +// RUN: FileCheck --match-full-lines --allow-unused-prefixes %s +// AUTOUPDATE: executable_semantics %s +// CHECK: result: 0 package ExecutableSemanticsTest api; diff --git a/executable_semantics/testdata/experimental_continuation1.golden b/executable_semantics/testdata/experimental_continuation1.golden deleted file mode 100644 index 2db2755da426..000000000000 --- a/executable_semantics/testdata/experimental_continuation1.golden +++ /dev/null @@ -1 +0,0 @@ -result: 0 diff --git a/executable_semantics/testdata/experimental_continuation2.carbon b/executable_semantics/testdata/experimental_continuation2.carbon index a1a15302ad82..43bd505059bd 100644 --- a/executable_semantics/testdata/experimental_continuation2.carbon +++ b/executable_semantics/testdata/experimental_continuation2.carbon @@ -1,6 +1,13 @@ // Part of the Carbon Language project, under the Apache License v2.0 with LLVM // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +// RUN: executable_semantics %s 2>&1 | \ +// RUN: FileCheck --match-full-lines --allow-unused-prefixes=false %s +// RUN: executable_semantics --trace %s 2>&1 | \ +// RUN: FileCheck --match-full-lines --allow-unused-prefixes %s +// AUTOUPDATE: executable_semantics %s +// CHECK: result: 1 package ExecutableSemanticsTest api; diff --git a/executable_semantics/testdata/experimental_continuation2.golden b/executable_semantics/testdata/experimental_continuation2.golden deleted file mode 100644 index 0c204052cb21..000000000000 --- a/executable_semantics/testdata/experimental_continuation2.golden +++ /dev/null @@ -1 +0,0 @@ -result: 1 diff --git a/executable_semantics/testdata/experimental_continuation3.carbon b/executable_semantics/testdata/experimental_continuation3.carbon index 8d9483681da0..2bdacede6809 100644 --- a/executable_semantics/testdata/experimental_continuation3.carbon +++ b/executable_semantics/testdata/experimental_continuation3.carbon @@ -1,6 +1,13 @@ // Part of the Carbon Language project, under the Apache License v2.0 with LLVM // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +// RUN: executable_semantics %s 2>&1 | \ +// RUN: FileCheck --match-full-lines --allow-unused-prefixes=false %s +// RUN: executable_semantics --trace %s 2>&1 | \ +// RUN: FileCheck --match-full-lines --allow-unused-prefixes %s +// AUTOUPDATE: executable_semantics %s +// CHECK: result: 3 package ExecutableSemanticsTest api; diff --git a/executable_semantics/testdata/experimental_continuation3.golden b/executable_semantics/testdata/experimental_continuation3.golden deleted file mode 100644 index 18860b8659c0..000000000000 --- a/executable_semantics/testdata/experimental_continuation3.golden +++ /dev/null @@ -1 +0,0 @@ -result: 3 diff --git a/executable_semantics/testdata/experimental_continuation4.carbon b/executable_semantics/testdata/experimental_continuation4.carbon index 78baab3cfa4c..5399cc8750e7 100644 --- a/executable_semantics/testdata/experimental_continuation4.carbon +++ b/executable_semantics/testdata/experimental_continuation4.carbon @@ -1,6 +1,13 @@ // Part of the Carbon Language project, under the Apache License v2.0 with LLVM // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +// RUN: executable_semantics %s 2>&1 | \ +// RUN: FileCheck --match-full-lines --allow-unused-prefixes=false %s +// RUN: executable_semantics --trace %s 2>&1 | \ +// RUN: FileCheck --match-full-lines --allow-unused-prefixes %s +// AUTOUPDATE: executable_semantics %s +// CHECK: result: 3 package ExecutableSemanticsTest api; diff --git a/executable_semantics/testdata/experimental_continuation4.golden b/executable_semantics/testdata/experimental_continuation4.golden deleted file mode 100644 index 18860b8659c0..000000000000 --- a/executable_semantics/testdata/experimental_continuation4.golden +++ /dev/null @@ -1 +0,0 @@ -result: 3 diff --git a/executable_semantics/testdata/experimental_continuation5.carbon b/executable_semantics/testdata/experimental_continuation5.carbon index 07f24745d00b..4043a21d2a86 100644 --- a/executable_semantics/testdata/experimental_continuation5.carbon +++ b/executable_semantics/testdata/experimental_continuation5.carbon @@ -1,6 +1,13 @@ // Part of the Carbon Language project, under the Apache License v2.0 with LLVM // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +// RUN: executable_semantics %s 2>&1 | \ +// RUN: FileCheck --match-full-lines --allow-unused-prefixes=false %s +// RUN: executable_semantics --trace %s 2>&1 | \ +// RUN: FileCheck --match-full-lines --allow-unused-prefixes %s +// AUTOUPDATE: executable_semantics %s +// CHECK: result: 3 package ExecutableSemanticsTest api; diff --git a/executable_semantics/testdata/experimental_continuation5.golden b/executable_semantics/testdata/experimental_continuation5.golden deleted file mode 100644 index 18860b8659c0..000000000000 --- a/executable_semantics/testdata/experimental_continuation5.golden +++ /dev/null @@ -1 +0,0 @@ -result: 3 diff --git a/executable_semantics/testdata/experimental_continuation6.carbon b/executable_semantics/testdata/experimental_continuation6.carbon index ecd0b5a9b4fd..9d859baa6838 100644 --- a/executable_semantics/testdata/experimental_continuation6.carbon +++ b/executable_semantics/testdata/experimental_continuation6.carbon @@ -1,6 +1,13 @@ // Part of the Carbon Language project, under the Apache License v2.0 with LLVM // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +// RUN: executable_semantics %s 2>&1 | \ +// RUN: FileCheck --match-full-lines --allow-unused-prefixes=false %s +// RUN: executable_semantics --trace %s 2>&1 | \ +// RUN: FileCheck --match-full-lines --allow-unused-prefixes %s +// AUTOUPDATE: executable_semantics %s +// CHECK: result: 10 package ExecutableSemanticsTest api; diff --git a/executable_semantics/testdata/experimental_continuation6.golden b/executable_semantics/testdata/experimental_continuation6.golden deleted file mode 100644 index 0e0834d8b4da..000000000000 --- a/executable_semantics/testdata/experimental_continuation6.golden +++ /dev/null @@ -1 +0,0 @@ -result: 10 diff --git a/executable_semantics/testdata/experimental_continuation7.carbon b/executable_semantics/testdata/experimental_continuation7.carbon index 4c79aecf68ea..2da75da184fc 100644 --- a/executable_semantics/testdata/experimental_continuation7.carbon +++ b/executable_semantics/testdata/experimental_continuation7.carbon @@ -1,6 +1,13 @@ // Part of the Carbon Language project, under the Apache License v2.0 with LLVM // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +// RUN: executable_semantics %s 2>&1 | \ +// RUN: FileCheck --match-full-lines --allow-unused-prefixes=false %s +// RUN: executable_semantics --trace %s 2>&1 | \ +// RUN: FileCheck --match-full-lines --allow-unused-prefixes %s +// AUTOUPDATE: executable_semantics %s +// CHECK: result: 3 package ExecutableSemanticsTest api; diff --git a/executable_semantics/testdata/experimental_continuation7.golden b/executable_semantics/testdata/experimental_continuation7.golden deleted file mode 100644 index 18860b8659c0..000000000000 --- a/executable_semantics/testdata/experimental_continuation7.golden +++ /dev/null @@ -1 +0,0 @@ -result: 3 diff --git a/executable_semantics/testdata/experimental_continuation9.carbon b/executable_semantics/testdata/experimental_continuation9.carbon index ab1c6ec35356..2585d872d7d0 100644 --- a/executable_semantics/testdata/experimental_continuation9.carbon +++ b/executable_semantics/testdata/experimental_continuation9.carbon @@ -1,6 +1,14 @@ // Part of the Carbon Language project, under the Apache License v2.0 with LLVM // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +// RUN: not executable_semantics %s 2>&1 | \ +// RUN: FileCheck --match-full-lines --allow-unused-prefixes=false %s +// RUN: not executable_semantics --trace %s 2>&1 | \ +// RUN: FileCheck --match-full-lines --allow-unused-prefixes %s +// AUTOUPDATE: executable_semantics %s +// CHECK: RUNTIME ERROR: {{.*}}/experimental_continuation9.carbon:22: undefined behavior: access to dead value 1 + package ExecutableSemanticsTest api; diff --git a/executable_semantics/testdata/experimental_continuation9.golden b/executable_semantics/testdata/experimental_continuation9.golden deleted file mode 100644 index 6997e4f3914f..000000000000 --- a/executable_semantics/testdata/experimental_continuation9.golden +++ /dev/null @@ -1,2 +0,0 @@ -RUNTIME ERROR: executable_semantics/testdata/experimental_continuation9.carbon:14: undefined behavior: access to dead value 1 -EXIT CODE: 255 diff --git a/executable_semantics/testdata/fun1.carbon b/executable_semantics/testdata/fun1.carbon index 3fbbc11df351..14150b24b6be 100644 --- a/executable_semantics/testdata/fun1.carbon +++ b/executable_semantics/testdata/fun1.carbon @@ -1,6 +1,13 @@ // Part of the Carbon Language project, under the Apache License v2.0 with LLVM // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +// RUN: executable_semantics %s 2>&1 | \ +// RUN: FileCheck --match-full-lines --allow-unused-prefixes=false %s +// RUN: executable_semantics --trace %s 2>&1 | \ +// RUN: FileCheck --match-full-lines --allow-unused-prefixes %s +// AUTOUPDATE: executable_semantics %s +// CHECK: result: 0 package ExecutableSemanticsTest api; diff --git a/executable_semantics/testdata/fun1.golden b/executable_semantics/testdata/fun1.golden deleted file mode 100644 index 2db2755da426..000000000000 --- a/executable_semantics/testdata/fun1.golden +++ /dev/null @@ -1 +0,0 @@ -result: 0 diff --git a/executable_semantics/testdata/fun2.carbon b/executable_semantics/testdata/fun2.carbon index 14d05e157256..c789c6f35cf4 100644 --- a/executable_semantics/testdata/fun2.carbon +++ b/executable_semantics/testdata/fun2.carbon @@ -1,6 +1,13 @@ // Part of the Carbon Language project, under the Apache License v2.0 with LLVM // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +// RUN: executable_semantics %s 2>&1 | \ +// RUN: FileCheck --match-full-lines --allow-unused-prefixes=false %s +// RUN: executable_semantics --trace %s 2>&1 | \ +// RUN: FileCheck --match-full-lines --allow-unused-prefixes %s +// AUTOUPDATE: executable_semantics %s +// CHECK: result: 0 package ExecutableSemanticsTest api; diff --git a/executable_semantics/testdata/fun2.golden b/executable_semantics/testdata/fun2.golden deleted file mode 100644 index 2db2755da426..000000000000 --- a/executable_semantics/testdata/fun2.golden +++ /dev/null @@ -1 +0,0 @@ -result: 0 diff --git a/executable_semantics/testdata/fun3.carbon b/executable_semantics/testdata/fun3.carbon index 9fa23b4eb8ca..5a013a463cd5 100644 --- a/executable_semantics/testdata/fun3.carbon +++ b/executable_semantics/testdata/fun3.carbon @@ -1,6 +1,13 @@ // Part of the Carbon Language project, under the Apache License v2.0 with LLVM // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +// RUN: executable_semantics %s 2>&1 | \ +// RUN: FileCheck --match-full-lines --allow-unused-prefixes=false %s +// RUN: executable_semantics --trace %s 2>&1 | \ +// RUN: FileCheck --match-full-lines --allow-unused-prefixes %s +// AUTOUPDATE: executable_semantics %s +// CHECK: result: 0 package ExecutableSemanticsTest api; diff --git a/executable_semantics/testdata/fun3.golden b/executable_semantics/testdata/fun3.golden deleted file mode 100644 index 2db2755da426..000000000000 --- a/executable_semantics/testdata/fun3.golden +++ /dev/null @@ -1 +0,0 @@ -result: 0 diff --git a/executable_semantics/testdata/fun4.carbon b/executable_semantics/testdata/fun4.carbon index 332c84240b74..bcc64ebc5cee 100644 --- a/executable_semantics/testdata/fun4.carbon +++ b/executable_semantics/testdata/fun4.carbon @@ -1,6 +1,13 @@ // Part of the Carbon Language project, under the Apache License v2.0 with LLVM // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +// RUN: executable_semantics %s 2>&1 | \ +// RUN: FileCheck --match-full-lines --allow-unused-prefixes=false %s +// RUN: executable_semantics --trace %s 2>&1 | \ +// RUN: FileCheck --match-full-lines --allow-unused-prefixes %s +// AUTOUPDATE: executable_semantics %s +// CHECK: result: 0 package ExecutableSemanticsTest api; diff --git a/executable_semantics/testdata/fun4.golden b/executable_semantics/testdata/fun4.golden deleted file mode 100644 index 2db2755da426..000000000000 --- a/executable_semantics/testdata/fun4.golden +++ /dev/null @@ -1 +0,0 @@ -result: 0 diff --git a/executable_semantics/testdata/fun5.carbon b/executable_semantics/testdata/fun5.carbon index eced169d666e..233311ce2565 100644 --- a/executable_semantics/testdata/fun5.carbon +++ b/executable_semantics/testdata/fun5.carbon @@ -1,6 +1,13 @@ // Part of the Carbon Language project, under the Apache License v2.0 with LLVM // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +// RUN: executable_semantics %s 2>&1 | \ +// RUN: FileCheck --match-full-lines --allow-unused-prefixes=false %s +// RUN: executable_semantics --trace %s 2>&1 | \ +// RUN: FileCheck --match-full-lines --allow-unused-prefixes %s +// AUTOUPDATE: executable_semantics %s +// CHECK: result: 0 package ExecutableSemanticsTest api; diff --git a/executable_semantics/testdata/fun5.golden b/executable_semantics/testdata/fun5.golden deleted file mode 100644 index 2db2755da426..000000000000 --- a/executable_semantics/testdata/fun5.golden +++ /dev/null @@ -1 +0,0 @@ -result: 0 diff --git a/executable_semantics/testdata/fun6_fail_type.carbon b/executable_semantics/testdata/fun6_fail_type.carbon index 22123ee50a71..c9657798ce04 100644 --- a/executable_semantics/testdata/fun6_fail_type.carbon +++ b/executable_semantics/testdata/fun6_fail_type.carbon @@ -1,6 +1,16 @@ // Part of the Carbon Language project, under the Apache License v2.0 with LLVM // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +// RUN: not executable_semantics %s 2>&1 | \ +// RUN: FileCheck --match-full-lines --allow-unused-prefixes=false %s +// RUN: not executable_semantics --trace %s 2>&1 | \ +// RUN: FileCheck --match-full-lines --allow-unused-prefixes %s +// AUTOUPDATE: executable_semantics %s +// CHECK: COMPILATION ERROR: {{.*}}/fun6_fail_type.carbon:22: type error in call +// CHECK: expected: (0 = i32, 1 = i32) +// CHECK: actual: (0 = (0 = i32, 1 = i32)) + package ExecutableSemanticsTest api; diff --git a/executable_semantics/testdata/fun6_fail_type.golden b/executable_semantics/testdata/fun6_fail_type.golden deleted file mode 100644 index aa9005864c60..000000000000 --- a/executable_semantics/testdata/fun6_fail_type.golden +++ /dev/null @@ -1,4 +0,0 @@ -COMPILATION ERROR: executable_semantics/testdata/fun6_fail_type.carbon:12: type error in call -expected: (0 = i32, 1 = i32) -actual: (0 = (0 = i32, 1 = i32)) -EXIT CODE: 255 diff --git a/executable_semantics/testdata/fun_named_params.carbon b/executable_semantics/testdata/fun_named_params.carbon index f325ddff6eab..5fe6255a8810 100644 --- a/executable_semantics/testdata/fun_named_params.carbon +++ b/executable_semantics/testdata/fun_named_params.carbon @@ -1,6 +1,13 @@ // Part of the Carbon Language project, under the Apache License v2.0 with LLVM // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +// RUN: executable_semantics %s 2>&1 | \ +// RUN: FileCheck --match-full-lines --allow-unused-prefixes=false %s +// RUN: executable_semantics --trace %s 2>&1 | \ +// RUN: FileCheck --match-full-lines --allow-unused-prefixes %s +// AUTOUPDATE: executable_semantics %s +// CHECK: result: 0 package ExecutableSemanticsTest api; diff --git a/executable_semantics/testdata/fun_named_params.golden b/executable_semantics/testdata/fun_named_params.golden deleted file mode 100644 index 2db2755da426..000000000000 --- a/executable_semantics/testdata/fun_named_params.golden +++ /dev/null @@ -1 +0,0 @@ -result: 0 diff --git a/executable_semantics/testdata/fun_named_params2.carbon b/executable_semantics/testdata/fun_named_params2.carbon index 41b37a43b01b..888e6f0f4db5 100644 --- a/executable_semantics/testdata/fun_named_params2.carbon +++ b/executable_semantics/testdata/fun_named_params2.carbon @@ -1,6 +1,14 @@ // Part of the Carbon Language project, under the Apache License v2.0 with LLVM // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +// RUN: not executable_semantics %s 2>&1 | \ +// RUN: FileCheck --match-full-lines --allow-unused-prefixes=false %s +// RUN: not executable_semantics --trace %s 2>&1 | \ +// RUN: FileCheck --match-full-lines --allow-unused-prefixes %s +// AUTOUPDATE: executable_semantics %s +// CHECK: PROGRAM ERROR: {{.*}}/fun_named_params2.carbon:15: positional members must come before named members + package ExecutableSemanticsTest api; diff --git a/executable_semantics/testdata/fun_named_params2.golden b/executable_semantics/testdata/fun_named_params2.golden deleted file mode 100644 index 880c91ad4bc4..000000000000 --- a/executable_semantics/testdata/fun_named_params2.golden +++ /dev/null @@ -1,2 +0,0 @@ -PROGRAM ERROR: executable_semantics/testdata/fun_named_params2.carbon:7: positional members must come before named members -EXIT CODE: 255 diff --git a/executable_semantics/testdata/fun_recur.carbon b/executable_semantics/testdata/fun_recur.carbon index 2f515e065b60..02d022129083 100644 --- a/executable_semantics/testdata/fun_recur.carbon +++ b/executable_semantics/testdata/fun_recur.carbon @@ -1,6 +1,13 @@ // Part of the Carbon Language project, under the Apache License v2.0 with LLVM // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +// RUN: executable_semantics %s 2>&1 | \ +// RUN: FileCheck --match-full-lines --allow-unused-prefixes=false %s +// RUN: executable_semantics --trace %s 2>&1 | \ +// RUN: FileCheck --match-full-lines --allow-unused-prefixes %s +// AUTOUPDATE: executable_semantics %s +// CHECK: result: 0 package ExecutableSemanticsTest api; diff --git a/executable_semantics/testdata/fun_recur.golden b/executable_semantics/testdata/fun_recur.golden deleted file mode 100644 index 2db2755da426..000000000000 --- a/executable_semantics/testdata/fun_recur.golden +++ /dev/null @@ -1 +0,0 @@ -result: 0 diff --git a/executable_semantics/testdata/funptr1.carbon b/executable_semantics/testdata/funptr1.carbon index b1f4b423aaa0..e1179d81191d 100644 --- a/executable_semantics/testdata/funptr1.carbon +++ b/executable_semantics/testdata/funptr1.carbon @@ -1,6 +1,13 @@ // Part of the Carbon Language project, under the Apache License v2.0 with LLVM // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +// RUN: executable_semantics %s 2>&1 | \ +// RUN: FileCheck --match-full-lines --allow-unused-prefixes=false %s +// RUN: executable_semantics --trace %s 2>&1 | \ +// RUN: FileCheck --match-full-lines --allow-unused-prefixes %s +// AUTOUPDATE: executable_semantics %s +// CHECK: result: 0 package ExecutableSemanticsTest api; diff --git a/executable_semantics/testdata/funptr1.golden b/executable_semantics/testdata/funptr1.golden deleted file mode 100644 index 2db2755da426..000000000000 --- a/executable_semantics/testdata/funptr1.golden +++ /dev/null @@ -1 +0,0 @@ -result: 0 diff --git a/executable_semantics/testdata/generic_function1.carbon b/executable_semantics/testdata/generic_function1.carbon index a0fbd8b5107c..fccb8277b60e 100644 --- a/executable_semantics/testdata/generic_function1.carbon +++ b/executable_semantics/testdata/generic_function1.carbon @@ -1,6 +1,13 @@ // Part of the Carbon Language project, under the Apache License v2.0 with LLVM // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +// RUN: executable_semantics %s 2>&1 | \ +// RUN: FileCheck --match-full-lines --allow-unused-prefixes=false %s +// RUN: executable_semantics --trace %s 2>&1 | \ +// RUN: FileCheck --match-full-lines --allow-unused-prefixes %s +// AUTOUPDATE: executable_semantics %s +// CHECK: result: 0 package ExecutableSemanticsTest api; diff --git a/executable_semantics/testdata/generic_function1.golden b/executable_semantics/testdata/generic_function1.golden deleted file mode 100644 index 2db2755da426..000000000000 --- a/executable_semantics/testdata/generic_function1.golden +++ /dev/null @@ -1 +0,0 @@ -result: 0 diff --git a/executable_semantics/testdata/generic_function2.carbon b/executable_semantics/testdata/generic_function2.carbon index 4c4678079ece..74b43d5409d4 100644 --- a/executable_semantics/testdata/generic_function2.carbon +++ b/executable_semantics/testdata/generic_function2.carbon @@ -1,6 +1,13 @@ // Part of the Carbon Language project, under the Apache License v2.0 with LLVM // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +// RUN: executable_semantics %s 2>&1 | \ +// RUN: FileCheck --match-full-lines --allow-unused-prefixes=false %s +// RUN: executable_semantics --trace %s 2>&1 | \ +// RUN: FileCheck --match-full-lines --allow-unused-prefixes %s +// AUTOUPDATE: executable_semantics %s +// CHECK: result: 0 package ExecutableSemanticsTest api; diff --git a/executable_semantics/testdata/generic_function2.golden b/executable_semantics/testdata/generic_function2.golden deleted file mode 100644 index 2db2755da426..000000000000 --- a/executable_semantics/testdata/generic_function2.golden +++ /dev/null @@ -1 +0,0 @@ -result: 0 diff --git a/executable_semantics/testdata/generic_function3.carbon b/executable_semantics/testdata/generic_function3.carbon index b33c02f0f734..d71ef1e0fc01 100644 --- a/executable_semantics/testdata/generic_function3.carbon +++ b/executable_semantics/testdata/generic_function3.carbon @@ -1,6 +1,13 @@ // Part of the Carbon Language project, under the Apache License v2.0 with LLVM // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +// RUN: executable_semantics %s 2>&1 | \ +// RUN: FileCheck --match-full-lines --allow-unused-prefixes=false %s +// RUN: executable_semantics --trace %s 2>&1 | \ +// RUN: FileCheck --match-full-lines --allow-unused-prefixes %s +// AUTOUPDATE: executable_semantics %s +// CHECK: result: 1 package ExecutableSemanticsTest api; diff --git a/executable_semantics/testdata/generic_function3.golden b/executable_semantics/testdata/generic_function3.golden deleted file mode 100644 index 0c204052cb21..000000000000 --- a/executable_semantics/testdata/generic_function3.golden +++ /dev/null @@ -1 +0,0 @@ -result: 1 diff --git a/executable_semantics/testdata/generic_function_apply.carbon b/executable_semantics/testdata/generic_function_apply.carbon index b36f8614ca8a..d7e261e1296a 100644 --- a/executable_semantics/testdata/generic_function_apply.carbon +++ b/executable_semantics/testdata/generic_function_apply.carbon @@ -1,6 +1,13 @@ // Part of the Carbon Language project, under the Apache License v2.0 with LLVM // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +// RUN: executable_semantics %s 2>&1 | \ +// RUN: FileCheck --match-full-lines --allow-unused-prefixes=false %s +// RUN: executable_semantics --trace %s 2>&1 | \ +// RUN: FileCheck --match-full-lines --allow-unused-prefixes %s +// AUTOUPDATE: executable_semantics %s +// CHECK: result: -2 package ExecutableSemanticsTest api; diff --git a/executable_semantics/testdata/generic_function_apply.golden b/executable_semantics/testdata/generic_function_apply.golden deleted file mode 100644 index 49f08b507230..000000000000 --- a/executable_semantics/testdata/generic_function_apply.golden +++ /dev/null @@ -1 +0,0 @@ -result: -2 diff --git a/executable_semantics/testdata/generic_function_fail1.carbon b/executable_semantics/testdata/generic_function_fail1.carbon index e7f48cd91078..8a62cf7d026b 100644 --- a/executable_semantics/testdata/generic_function_fail1.carbon +++ b/executable_semantics/testdata/generic_function_fail1.carbon @@ -1,6 +1,16 @@ // Part of the Carbon Language project, under the Apache License v2.0 with LLVM // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +// RUN: not executable_semantics %s 2>&1 | \ +// RUN: FileCheck --match-full-lines --allow-unused-prefixes=false %s +// RUN: not executable_semantics --trace %s 2>&1 | \ +// RUN: FileCheck --match-full-lines --allow-unused-prefixes %s +// AUTOUPDATE: executable_semantics %s +// CHECK: COMPILATION ERROR: {{.*}}/generic_function_fail1.carbon:22: type error in argument deduction +// CHECK: expected: i32 +// CHECK: actual: Bool + package ExecutableSemanticsTest api; diff --git a/executable_semantics/testdata/generic_function_fail1.golden b/executable_semantics/testdata/generic_function_fail1.golden deleted file mode 100644 index 949f89c36e98..000000000000 --- a/executable_semantics/testdata/generic_function_fail1.golden +++ /dev/null @@ -1,4 +0,0 @@ -COMPILATION ERROR: executable_semantics/testdata/generic_function_fail1.carbon:12: type error in argument deduction -expected: i32 -actual: Bool -EXIT CODE: 255 diff --git a/executable_semantics/testdata/generic_function_fail2.carbon b/executable_semantics/testdata/generic_function_fail2.carbon index e82b36942148..3321bb8a210a 100644 --- a/executable_semantics/testdata/generic_function_fail2.carbon +++ b/executable_semantics/testdata/generic_function_fail2.carbon @@ -1,6 +1,14 @@ // Part of the Carbon Language project, under the Apache License v2.0 with LLVM // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +// RUN: not executable_semantics %s 2>&1 | \ +// RUN: FileCheck --match-full-lines --allow-unused-prefixes=false %s +// RUN: not executable_semantics --trace %s 2>&1 | \ +// RUN: FileCheck --match-full-lines --allow-unused-prefixes %s +// AUTOUPDATE: executable_semantics %s +// CHECK: COMPILATION ERROR: {{.*}}/generic_function_fail2.carbon:20: could not deduce type argument for type parameter T + package ExecutableSemanticsTest api; diff --git a/executable_semantics/testdata/generic_function_fail2.golden b/executable_semantics/testdata/generic_function_fail2.golden deleted file mode 100644 index aa238bc0f950..000000000000 --- a/executable_semantics/testdata/generic_function_fail2.golden +++ /dev/null @@ -1,2 +0,0 @@ -COMPILATION ERROR: executable_semantics/testdata/generic_function_fail2.carbon:12: could not deduce type argument for type parameter T -EXIT CODE: 255 diff --git a/executable_semantics/testdata/generic_function_fail3.carbon b/executable_semantics/testdata/generic_function_fail3.carbon index 352f48610b19..d347bd2f195e 100644 --- a/executable_semantics/testdata/generic_function_fail3.carbon +++ b/executable_semantics/testdata/generic_function_fail3.carbon @@ -1,6 +1,16 @@ // Part of the Carbon Language project, under the Apache License v2.0 with LLVM // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +// RUN: not executable_semantics %s 2>&1 | \ +// RUN: FileCheck --match-full-lines --allow-unused-prefixes=false %s +// RUN: not executable_semantics --trace %s 2>&1 | \ +// RUN: FileCheck --match-full-lines --allow-unused-prefixes %s +// AUTOUPDATE: executable_semantics %s +// CHECK: COMPILATION ERROR: {{.*}}/generic_function_fail3.carbon:18: type error in addition(1) +// CHECK: expected: i32 +// CHECK: actual: T + package ExecutableSemanticsTest api; diff --git a/executable_semantics/testdata/generic_function_fail3.golden b/executable_semantics/testdata/generic_function_fail3.golden deleted file mode 100644 index ec4fa10be89c..000000000000 --- a/executable_semantics/testdata/generic_function_fail3.golden +++ /dev/null @@ -1,4 +0,0 @@ -COMPILATION ERROR: executable_semantics/testdata/generic_function_fail3.carbon:8: type error in addition(1) -expected: i32 -actual: T -EXIT CODE: 255 diff --git a/executable_semantics/testdata/generic_function_swap.carbon b/executable_semantics/testdata/generic_function_swap.carbon index 10ef63101ffd..e6681a55b1dc 100644 --- a/executable_semantics/testdata/generic_function_swap.carbon +++ b/executable_semantics/testdata/generic_function_swap.carbon @@ -1,6 +1,13 @@ // Part of the Carbon Language project, under the Apache License v2.0 with LLVM // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +// RUN: executable_semantics %s 2>&1 | \ +// RUN: FileCheck --match-full-lines --allow-unused-prefixes=false %s +// RUN: executable_semantics --trace %s 2>&1 | \ +// RUN: FileCheck --match-full-lines --allow-unused-prefixes %s +// AUTOUPDATE: executable_semantics %s +// CHECK: result: 0 package ExecutableSemanticsTest api; diff --git a/executable_semantics/testdata/generic_function_swap.golden b/executable_semantics/testdata/generic_function_swap.golden deleted file mode 100644 index 2db2755da426..000000000000 --- a/executable_semantics/testdata/generic_function_swap.golden +++ /dev/null @@ -1 +0,0 @@ -result: 0 diff --git a/executable_semantics/testdata/generic_function_tuple_map.carbon b/executable_semantics/testdata/generic_function_tuple_map.carbon index 6fb929ea1b28..30dd7aebbb32 100644 --- a/executable_semantics/testdata/generic_function_tuple_map.carbon +++ b/executable_semantics/testdata/generic_function_tuple_map.carbon @@ -1,6 +1,13 @@ // Part of the Carbon Language project, under the Apache License v2.0 with LLVM // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +// RUN: executable_semantics %s 2>&1 | \ +// RUN: FileCheck --match-full-lines --allow-unused-prefixes=false %s +// RUN: executable_semantics --trace %s 2>&1 | \ +// RUN: FileCheck --match-full-lines --allow-unused-prefixes %s +// AUTOUPDATE: executable_semantics %s +// CHECK: result: 1 package ExecutableSemanticsTest api; diff --git a/executable_semantics/testdata/generic_function_tuple_map.golden b/executable_semantics/testdata/generic_function_tuple_map.golden deleted file mode 100644 index 0c204052cb21..000000000000 --- a/executable_semantics/testdata/generic_function_tuple_map.golden +++ /dev/null @@ -1 +0,0 @@ -result: 1 diff --git a/executable_semantics/testdata/global_variable1.carbon b/executable_semantics/testdata/global_variable1.carbon index c00ec72ae422..02f00de0f1ec 100644 --- a/executable_semantics/testdata/global_variable1.carbon +++ b/executable_semantics/testdata/global_variable1.carbon @@ -1,6 +1,13 @@ // Part of the Carbon Language project, under the Apache License v2.0 with LLVM // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +// RUN: executable_semantics %s 2>&1 | \ +// RUN: FileCheck --match-full-lines --allow-unused-prefixes=false %s +// RUN: executable_semantics --trace %s 2>&1 | \ +// RUN: FileCheck --match-full-lines --allow-unused-prefixes %s +// AUTOUPDATE: executable_semantics %s +// CHECK: result: 0 package ExecutableSemanticsTest api; diff --git a/executable_semantics/testdata/global_variable1.golden b/executable_semantics/testdata/global_variable1.golden deleted file mode 100644 index 2db2755da426..000000000000 --- a/executable_semantics/testdata/global_variable1.golden +++ /dev/null @@ -1 +0,0 @@ -result: 0 diff --git a/executable_semantics/testdata/global_variable2.carbon b/executable_semantics/testdata/global_variable2.carbon index 61ed5ad9db0f..3858438e39cc 100644 --- a/executable_semantics/testdata/global_variable2.carbon +++ b/executable_semantics/testdata/global_variable2.carbon @@ -1,6 +1,13 @@ // Part of the Carbon Language project, under the Apache License v2.0 with LLVM // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +// RUN: executable_semantics %s 2>&1 | \ +// RUN: FileCheck --match-full-lines --allow-unused-prefixes=false %s +// RUN: executable_semantics --trace %s 2>&1 | \ +// RUN: FileCheck --match-full-lines --allow-unused-prefixes %s +// AUTOUPDATE: executable_semantics %s +// CHECK: result: 0 package ExecutableSemanticsTest api; diff --git a/executable_semantics/testdata/global_variable2.golden b/executable_semantics/testdata/global_variable2.golden deleted file mode 100644 index 2db2755da426..000000000000 --- a/executable_semantics/testdata/global_variable2.golden +++ /dev/null @@ -1 +0,0 @@ -result: 0 diff --git a/executable_semantics/testdata/global_variable3.carbon b/executable_semantics/testdata/global_variable3.carbon index 1caf0e0db79c..0fb730d24cf3 100644 --- a/executable_semantics/testdata/global_variable3.carbon +++ b/executable_semantics/testdata/global_variable3.carbon @@ -1,6 +1,16 @@ // Part of the Carbon Language project, under the Apache License v2.0 with LLVM // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +// RUN: not executable_semantics %s 2>&1 | \ +// RUN: FileCheck --match-full-lines --allow-unused-prefixes=false %s +// RUN: not executable_semantics --trace %s 2>&1 | \ +// RUN: FileCheck --match-full-lines --allow-unused-prefixes %s +// AUTOUPDATE: executable_semantics %s +// CHECK: COMPILATION ERROR: {{.*}}/global_variable3.carbon:19: type error in initializer of variable +// CHECK: expected: i32 +// CHECK: actual: Bool + package ExecutableSemanticsTest api; diff --git a/executable_semantics/testdata/global_variable3.golden b/executable_semantics/testdata/global_variable3.golden deleted file mode 100644 index 1bcf3a8b007d..000000000000 --- a/executable_semantics/testdata/global_variable3.golden +++ /dev/null @@ -1,4 +0,0 @@ -COMPILATION ERROR: executable_semantics/testdata/global_variable3.carbon:9: type error in initializer of variable -expected: i32 -actual: Bool -EXIT CODE: 255 diff --git a/executable_semantics/testdata/global_variable4.carbon b/executable_semantics/testdata/global_variable4.carbon index 85547c23d1cf..744a0fe91c29 100644 --- a/executable_semantics/testdata/global_variable4.carbon +++ b/executable_semantics/testdata/global_variable4.carbon @@ -1,6 +1,13 @@ // Part of the Carbon Language project, under the Apache License v2.0 with LLVM // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +// RUN: executable_semantics %s 2>&1 | \ +// RUN: FileCheck --match-full-lines --allow-unused-prefixes=false %s +// RUN: executable_semantics --trace %s 2>&1 | \ +// RUN: FileCheck --match-full-lines --allow-unused-prefixes %s +// AUTOUPDATE: executable_semantics %s +// CHECK: result: 0 package ExecutableSemanticsTest api; diff --git a/executable_semantics/testdata/global_variable4.golden b/executable_semantics/testdata/global_variable4.golden deleted file mode 100644 index 2db2755da426..000000000000 --- a/executable_semantics/testdata/global_variable4.golden +++ /dev/null @@ -1 +0,0 @@ -result: 0 diff --git a/executable_semantics/testdata/global_variable5.carbon b/executable_semantics/testdata/global_variable5.carbon index cdfa9bbb78d1..11f4321a5d83 100644 --- a/executable_semantics/testdata/global_variable5.carbon +++ b/executable_semantics/testdata/global_variable5.carbon @@ -1,6 +1,16 @@ // Part of the Carbon Language project, under the Apache License v2.0 with LLVM // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +// RUN: not executable_semantics %s 2>&1 | \ +// RUN: FileCheck --match-full-lines --allow-unused-prefixes=false %s +// RUN: not executable_semantics --trace %s 2>&1 | \ +// RUN: FileCheck --match-full-lines --allow-unused-prefixes %s +// AUTOUPDATE: executable_semantics %s +// CHECK: COMPILATION ERROR: {{.*}}/global_variable5.carbon:22: type error in return +// CHECK: expected: () +// CHECK: actual: i32 + package ExecutableSemanticsTest api; diff --git a/executable_semantics/testdata/global_variable5.golden b/executable_semantics/testdata/global_variable5.golden deleted file mode 100644 index d120bd52d2a4..000000000000 --- a/executable_semantics/testdata/global_variable5.golden +++ /dev/null @@ -1,4 +0,0 @@ -COMPILATION ERROR: executable_semantics/testdata/global_variable5.carbon:12: type error in return -expected: () -actual: i32 -EXIT CODE: 255 diff --git a/executable_semantics/testdata/global_variable6.carbon b/executable_semantics/testdata/global_variable6.carbon index 893140a76c08..4e8faeb1ae32 100644 --- a/executable_semantics/testdata/global_variable6.carbon +++ b/executable_semantics/testdata/global_variable6.carbon @@ -1,6 +1,13 @@ // Part of the Carbon Language project, under the Apache License v2.0 with LLVM // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +// RUN: executable_semantics %s 2>&1 | \ +// RUN: FileCheck --match-full-lines --allow-unused-prefixes=false %s +// RUN: executable_semantics --trace %s 2>&1 | \ +// RUN: FileCheck --match-full-lines --allow-unused-prefixes %s +// AUTOUPDATE: executable_semantics %s +// CHECK: result: 0 package ExecutableSemanticsTest api; diff --git a/executable_semantics/testdata/global_variable6.golden b/executable_semantics/testdata/global_variable6.golden deleted file mode 100644 index 2db2755da426..000000000000 --- a/executable_semantics/testdata/global_variable6.golden +++ /dev/null @@ -1 +0,0 @@ -result: 0 diff --git a/executable_semantics/testdata/global_variable7.carbon b/executable_semantics/testdata/global_variable7.carbon index 5e1dd2843f34..8d19798ecdac 100644 --- a/executable_semantics/testdata/global_variable7.carbon +++ b/executable_semantics/testdata/global_variable7.carbon @@ -1,6 +1,13 @@ // Part of the Carbon Language project, under the Apache License v2.0 with LLVM // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +// RUN: executable_semantics %s 2>&1 | \ +// RUN: FileCheck --match-full-lines --allow-unused-prefixes=false %s +// RUN: executable_semantics --trace %s 2>&1 | \ +// RUN: FileCheck --match-full-lines --allow-unused-prefixes %s +// AUTOUPDATE: executable_semantics %s +// CHECK: result: 0 package ExecutableSemanticsTest api; diff --git a/executable_semantics/testdata/global_variable7.golden b/executable_semantics/testdata/global_variable7.golden deleted file mode 100644 index 2db2755da426..000000000000 --- a/executable_semantics/testdata/global_variable7.golden +++ /dev/null @@ -1 +0,0 @@ -result: 0 diff --git a/executable_semantics/testdata/global_variable8.carbon b/executable_semantics/testdata/global_variable8.carbon index 84bb66471679..e8de448604c4 100644 --- a/executable_semantics/testdata/global_variable8.carbon +++ b/executable_semantics/testdata/global_variable8.carbon @@ -1,6 +1,14 @@ // Part of the Carbon Language project, under the Apache License v2.0 with LLVM // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +// RUN: not executable_semantics %s 2>&1 | \ +// RUN: FileCheck --match-full-lines --allow-unused-prefixes=false %s +// RUN: not executable_semantics --trace %s 2>&1 | \ +// RUN: FileCheck --match-full-lines --allow-unused-prefixes %s +// AUTOUPDATE: executable_semantics %s +// CHECK: RUNTIME ERROR: {{.*}}/global_variable8.carbon:18: could not find `y` + package ExecutableSemanticsTest api; diff --git a/executable_semantics/testdata/global_variable8.golden b/executable_semantics/testdata/global_variable8.golden deleted file mode 100644 index e73ffd2d7204..000000000000 --- a/executable_semantics/testdata/global_variable8.golden +++ /dev/null @@ -1,2 +0,0 @@ -RUNTIME ERROR: executable_semantics/testdata/global_variable8.carbon:10: could not find `y` -EXIT CODE: 255 diff --git a/executable_semantics/testdata/if_else.carbon b/executable_semantics/testdata/if_else.carbon index d28979f7d947..d531d7be18f4 100644 --- a/executable_semantics/testdata/if_else.carbon +++ b/executable_semantics/testdata/if_else.carbon @@ -1,6 +1,13 @@ // Part of the Carbon Language project, under the Apache License v2.0 with LLVM // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +// RUN: executable_semantics %s 2>&1 | \ +// RUN: FileCheck --match-full-lines --allow-unused-prefixes=false %s +// RUN: executable_semantics --trace %s 2>&1 | \ +// RUN: FileCheck --match-full-lines --allow-unused-prefixes %s +// AUTOUPDATE: executable_semantics %s +// CHECK: result: 0 package ExecutableSemanticsTest api; diff --git a/executable_semantics/testdata/if_else.golden b/executable_semantics/testdata/if_else.golden deleted file mode 100644 index 2db2755da426..000000000000 --- a/executable_semantics/testdata/if_else.golden +++ /dev/null @@ -1 +0,0 @@ -result: 0 diff --git a/executable_semantics/testdata/if_else_if.carbon b/executable_semantics/testdata/if_else_if.carbon index 37b2a25600f4..3fd4d594eb93 100644 --- a/executable_semantics/testdata/if_else_if.carbon +++ b/executable_semantics/testdata/if_else_if.carbon @@ -1,6 +1,13 @@ // Part of the Carbon Language project, under the Apache License v2.0 with LLVM // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +// RUN: executable_semantics %s 2>&1 | \ +// RUN: FileCheck --match-full-lines --allow-unused-prefixes=false %s +// RUN: executable_semantics --trace %s 2>&1 | \ +// RUN: FileCheck --match-full-lines --allow-unused-prefixes %s +// AUTOUPDATE: executable_semantics %s +// CHECK: result: 0 package ExecutableSemanticsTest api; diff --git a/executable_semantics/testdata/if_else_if.golden b/executable_semantics/testdata/if_else_if.golden deleted file mode 100644 index 2db2755da426..000000000000 --- a/executable_semantics/testdata/if_else_if.golden +++ /dev/null @@ -1 +0,0 @@ -result: 0 diff --git a/executable_semantics/testdata/if_else_if_else.carbon b/executable_semantics/testdata/if_else_if_else.carbon index 1b549aeda330..f5769483cf71 100644 --- a/executable_semantics/testdata/if_else_if_else.carbon +++ b/executable_semantics/testdata/if_else_if_else.carbon @@ -1,6 +1,13 @@ // Part of the Carbon Language project, under the Apache License v2.0 with LLVM // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +// RUN: executable_semantics %s 2>&1 | \ +// RUN: FileCheck --match-full-lines --allow-unused-prefixes=false %s +// RUN: executable_semantics --trace %s 2>&1 | \ +// RUN: FileCheck --match-full-lines --allow-unused-prefixes %s +// AUTOUPDATE: executable_semantics %s +// CHECK: result: 0 package ExecutableSemanticsTest api; diff --git a/executable_semantics/testdata/if_else_if_else.golden b/executable_semantics/testdata/if_else_if_else.golden deleted file mode 100644 index 2db2755da426..000000000000 --- a/executable_semantics/testdata/if_else_if_else.golden +++ /dev/null @@ -1 +0,0 @@ -result: 0 diff --git a/executable_semantics/testdata/if_false.carbon b/executable_semantics/testdata/if_false.carbon index 822f11279d24..6971028c4050 100644 --- a/executable_semantics/testdata/if_false.carbon +++ b/executable_semantics/testdata/if_false.carbon @@ -1,6 +1,13 @@ // Part of the Carbon Language project, under the Apache License v2.0 with LLVM // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +// RUN: executable_semantics %s 2>&1 | \ +// RUN: FileCheck --match-full-lines --allow-unused-prefixes=false %s +// RUN: executable_semantics --trace %s 2>&1 | \ +// RUN: FileCheck --match-full-lines --allow-unused-prefixes %s +// AUTOUPDATE: executable_semantics %s +// CHECK: result: 0 package ExecutableSemanticsTest api; diff --git a/executable_semantics/testdata/if_false.golden b/executable_semantics/testdata/if_false.golden deleted file mode 100644 index 2db2755da426..000000000000 --- a/executable_semantics/testdata/if_false.golden +++ /dev/null @@ -1 +0,0 @@ -result: 0 diff --git a/executable_semantics/testdata/if_nesting.carbon b/executable_semantics/testdata/if_nesting.carbon index 42c064209b78..619a24ed56f6 100644 --- a/executable_semantics/testdata/if_nesting.carbon +++ b/executable_semantics/testdata/if_nesting.carbon @@ -1,6 +1,13 @@ // Part of the Carbon Language project, under the Apache License v2.0 with LLVM // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +// RUN: executable_semantics %s 2>&1 | \ +// RUN: FileCheck --match-full-lines --allow-unused-prefixes=false %s +// RUN: executable_semantics --trace %s 2>&1 | \ +// RUN: FileCheck --match-full-lines --allow-unused-prefixes %s +// AUTOUPDATE: executable_semantics %s +// CHECK: result: 0 package ExecutableSemanticsTest api; diff --git a/executable_semantics/testdata/if_nesting.golden b/executable_semantics/testdata/if_nesting.golden deleted file mode 100644 index 2db2755da426..000000000000 --- a/executable_semantics/testdata/if_nesting.golden +++ /dev/null @@ -1 +0,0 @@ -result: 0 diff --git a/executable_semantics/testdata/if_true.carbon b/executable_semantics/testdata/if_true.carbon index 44ebdf4247f7..979e2badec72 100644 --- a/executable_semantics/testdata/if_true.carbon +++ b/executable_semantics/testdata/if_true.carbon @@ -1,6 +1,13 @@ // Part of the Carbon Language project, under the Apache License v2.0 with LLVM // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +// RUN: executable_semantics %s 2>&1 | \ +// RUN: FileCheck --match-full-lines --allow-unused-prefixes=false %s +// RUN: executable_semantics --trace %s 2>&1 | \ +// RUN: FileCheck --match-full-lines --allow-unused-prefixes %s +// AUTOUPDATE: executable_semantics %s +// CHECK: result: 0 package ExecutableSemanticsTest api; diff --git a/executable_semantics/testdata/if_true.golden b/executable_semantics/testdata/if_true.golden deleted file mode 100644 index 2db2755da426..000000000000 --- a/executable_semantics/testdata/if_true.golden +++ /dev/null @@ -1 +0,0 @@ -result: 0 diff --git a/executable_semantics/testdata/ignored_parameter.carbon b/executable_semantics/testdata/ignored_parameter.carbon index a0b371add49a..42b14718873d 100644 --- a/executable_semantics/testdata/ignored_parameter.carbon +++ b/executable_semantics/testdata/ignored_parameter.carbon @@ -1,6 +1,13 @@ // Part of the Carbon Language project, under the Apache License v2.0 with LLVM // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +// RUN: executable_semantics %s 2>&1 | \ +// RUN: FileCheck --match-full-lines --allow-unused-prefixes=false %s +// RUN: executable_semantics --trace %s 2>&1 | \ +// RUN: FileCheck --match-full-lines --allow-unused-prefixes %s +// AUTOUPDATE: executable_semantics %s +// CHECK: result: 0 package ExecutableSemanticsTest api; diff --git a/executable_semantics/testdata/ignored_parameter.golden b/executable_semantics/testdata/ignored_parameter.golden deleted file mode 100644 index 2db2755da426..000000000000 --- a/executable_semantics/testdata/ignored_parameter.golden +++ /dev/null @@ -1 +0,0 @@ -result: 0 diff --git a/executable_semantics/testdata/import_late.carbon b/executable_semantics/testdata/import_late.carbon index 09d20e885c4c..d4dd763f75cf 100644 --- a/executable_semantics/testdata/import_late.carbon +++ b/executable_semantics/testdata/import_late.carbon @@ -1,6 +1,14 @@ // Part of the Carbon Language project, under the Apache License v2.0 with LLVM // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +// RUN: not executable_semantics %s 2>&1 | \ +// RUN: FileCheck --match-full-lines --allow-unused-prefixes=false %s +// RUN: not executable_semantics --trace %s 2>&1 | \ +// RUN: FileCheck --match-full-lines --allow-unused-prefixes %s +// AUTOUPDATE: executable_semantics %s +// CHECK: COMPILATION ERROR: {{.*}}/import_late.carbon:19: syntax error, unexpected IMPORT, expecting END_OF_FILE + package ExecutableSemanticsTest api; diff --git a/executable_semantics/testdata/import_late.golden b/executable_semantics/testdata/import_late.golden deleted file mode 100644 index a91a205e1caa..000000000000 --- a/executable_semantics/testdata/import_late.golden +++ /dev/null @@ -1,2 +0,0 @@ -COMPILATION ERROR: executable_semantics/testdata/import_late.carbon:11: syntax error, unexpected IMPORT, expecting END_OF_FILE -EXIT CODE: 255 diff --git a/executable_semantics/testdata/import_nonexistent_library.carbon b/executable_semantics/testdata/import_nonexistent_library.carbon index 787c0b15b929..44c6d2085320 100644 --- a/executable_semantics/testdata/import_nonexistent_library.carbon +++ b/executable_semantics/testdata/import_nonexistent_library.carbon @@ -1,6 +1,13 @@ // Part of the Carbon Language project, under the Apache License v2.0 with LLVM // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +// RUN: executable_semantics %s 2>&1 | \ +// RUN: FileCheck --match-full-lines --allow-unused-prefixes=false %s +// RUN: executable_semantics --trace %s 2>&1 | \ +// RUN: FileCheck --match-full-lines --allow-unused-prefixes %s +// AUTOUPDATE: executable_semantics %s +// CHECK: result: 0 package ExecutableSemanticsTest api; diff --git a/executable_semantics/testdata/import_nonexistent_library.golden b/executable_semantics/testdata/import_nonexistent_library.golden deleted file mode 100644 index 2db2755da426..000000000000 --- a/executable_semantics/testdata/import_nonexistent_library.golden +++ /dev/null @@ -1 +0,0 @@ -result: 0 diff --git a/executable_semantics/testdata/import_nonexistent_package.carbon b/executable_semantics/testdata/import_nonexistent_package.carbon index ebdad887f62b..eafa9359d2df 100644 --- a/executable_semantics/testdata/import_nonexistent_package.carbon +++ b/executable_semantics/testdata/import_nonexistent_package.carbon @@ -1,6 +1,13 @@ // Part of the Carbon Language project, under the Apache License v2.0 with LLVM // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +// RUN: executable_semantics %s 2>&1 | \ +// RUN: FileCheck --match-full-lines --allow-unused-prefixes=false %s +// RUN: executable_semantics --trace %s 2>&1 | \ +// RUN: FileCheck --match-full-lines --allow-unused-prefixes %s +// AUTOUPDATE: executable_semantics %s +// CHECK: result: 0 package ExecutableSemanticsTest api; diff --git a/executable_semantics/testdata/import_nonexistent_package.golden b/executable_semantics/testdata/import_nonexistent_package.golden deleted file mode 100644 index 2db2755da426..000000000000 --- a/executable_semantics/testdata/import_nonexistent_package.golden +++ /dev/null @@ -1 +0,0 @@ -result: 0 diff --git a/executable_semantics/testdata/invalid_char.carbon b/executable_semantics/testdata/invalid_char.carbon index 081c298f731f..a9d9f773de7b 100644 --- a/executable_semantics/testdata/invalid_char.carbon +++ b/executable_semantics/testdata/invalid_char.carbon @@ -1 +1,13 @@ -þ +// Part of the Carbon Language project, under the Apache License v2.0 with LLVM +// Exceptions. See /LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +// RUN: not executable_semantics %s 2>&1 | \ +// RUN: FileCheck --match-full-lines --allow-unused-prefixes=false %s +// RUN: not executable_semantics --trace %s 2>&1 | \ +// RUN: FileCheck --match-full-lines --allow-unused-prefixes %s +// AUTOUPDATE: executable_semantics %s +// CHECK: COMPILATION ERROR: {{.*}}/invalid_char.carbon:13: invalid character '\xEF' in source file. + + +� diff --git a/executable_semantics/testdata/invalid_char.golden b/executable_semantics/testdata/invalid_char.golden deleted file mode 100644 index 46c5219e3de6..000000000000 --- a/executable_semantics/testdata/invalid_char.golden +++ /dev/null @@ -1,2 +0,0 @@ -COMPILATION ERROR: executable_semantics/testdata/invalid_char.carbon:1: invalid character '\xFE' in source file. -EXIT CODE: 255 diff --git a/executable_semantics/testdata/lit.cfg b/executable_semantics/testdata/lit.cfg new file mode 100644 index 000000000000..77b1d1b010b4 --- /dev/null +++ b/executable_semantics/testdata/lit.cfg @@ -0,0 +1,9 @@ +# Part of the Carbon Language project, under the Apache License v2.0 with LLVM +# Exceptions. See /LICENSE for license information. +# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception + +import lit.formats + +config.name = 'lit' +config.suffixes = ['.carbon'] +config.test_format = lit.formats.ShTest() diff --git a/executable_semantics/testdata/match_any_int.carbon b/executable_semantics/testdata/match_any_int.carbon index 00dd65e3a35e..8f7b8fca1bca 100644 --- a/executable_semantics/testdata/match_any_int.carbon +++ b/executable_semantics/testdata/match_any_int.carbon @@ -1,6 +1,13 @@ // Part of the Carbon Language project, under the Apache License v2.0 with LLVM // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +// RUN: executable_semantics %s 2>&1 | \ +// RUN: FileCheck --match-full-lines --allow-unused-prefixes=false %s +// RUN: executable_semantics --trace %s 2>&1 | \ +// RUN: FileCheck --match-full-lines --allow-unused-prefixes %s +// AUTOUPDATE: executable_semantics %s +// CHECK: result: 0 package ExecutableSemanticsTest api; diff --git a/executable_semantics/testdata/match_any_int.golden b/executable_semantics/testdata/match_any_int.golden deleted file mode 100644 index 2db2755da426..000000000000 --- a/executable_semantics/testdata/match_any_int.golden +++ /dev/null @@ -1 +0,0 @@ -result: 0 diff --git a/executable_semantics/testdata/match_int.carbon b/executable_semantics/testdata/match_int.carbon index f31e4e275fa6..2917b461657b 100644 --- a/executable_semantics/testdata/match_int.carbon +++ b/executable_semantics/testdata/match_int.carbon @@ -1,6 +1,13 @@ // Part of the Carbon Language project, under the Apache License v2.0 with LLVM // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +// RUN: executable_semantics %s 2>&1 | \ +// RUN: FileCheck --match-full-lines --allow-unused-prefixes=false %s +// RUN: executable_semantics --trace %s 2>&1 | \ +// RUN: FileCheck --match-full-lines --allow-unused-prefixes %s +// AUTOUPDATE: executable_semantics %s +// CHECK: result: 0 package ExecutableSemanticsTest api; diff --git a/executable_semantics/testdata/match_int.golden b/executable_semantics/testdata/match_int.golden deleted file mode 100644 index 2db2755da426..000000000000 --- a/executable_semantics/testdata/match_int.golden +++ /dev/null @@ -1 +0,0 @@ -result: 0 diff --git a/executable_semantics/testdata/match_int_default.carbon b/executable_semantics/testdata/match_int_default.carbon index 274d6ee1fc45..6474e52f9b08 100644 --- a/executable_semantics/testdata/match_int_default.carbon +++ b/executable_semantics/testdata/match_int_default.carbon @@ -1,6 +1,13 @@ // Part of the Carbon Language project, under the Apache License v2.0 with LLVM // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +// RUN: executable_semantics %s 2>&1 | \ +// RUN: FileCheck --match-full-lines --allow-unused-prefixes=false %s +// RUN: executable_semantics --trace %s 2>&1 | \ +// RUN: FileCheck --match-full-lines --allow-unused-prefixes %s +// AUTOUPDATE: executable_semantics %s +// CHECK: result: 0 package ExecutableSemanticsTest api; diff --git a/executable_semantics/testdata/match_int_default.golden b/executable_semantics/testdata/match_int_default.golden deleted file mode 100644 index 2db2755da426..000000000000 --- a/executable_semantics/testdata/match_int_default.golden +++ /dev/null @@ -1 +0,0 @@ -result: 0 diff --git a/executable_semantics/testdata/match_placeholder.carbon b/executable_semantics/testdata/match_placeholder.carbon index e86732e12269..02317c92c5d4 100644 --- a/executable_semantics/testdata/match_placeholder.carbon +++ b/executable_semantics/testdata/match_placeholder.carbon @@ -1,6 +1,13 @@ // Part of the Carbon Language project, under the Apache License v2.0 with LLVM // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +// RUN: executable_semantics %s 2>&1 | \ +// RUN: FileCheck --match-full-lines --allow-unused-prefixes=false %s +// RUN: executable_semantics --trace %s 2>&1 | \ +// RUN: FileCheck --match-full-lines --allow-unused-prefixes %s +// AUTOUPDATE: executable_semantics %s +// CHECK: result: 0 package ExecutableSemanticsTest api; diff --git a/executable_semantics/testdata/match_placeholder.golden b/executable_semantics/testdata/match_placeholder.golden deleted file mode 100644 index 2db2755da426..000000000000 --- a/executable_semantics/testdata/match_placeholder.golden +++ /dev/null @@ -1 +0,0 @@ -result: 0 diff --git a/executable_semantics/testdata/next.carbon b/executable_semantics/testdata/next.carbon index cb2452b85162..91df326eace6 100644 --- a/executable_semantics/testdata/next.carbon +++ b/executable_semantics/testdata/next.carbon @@ -1,6 +1,13 @@ // Part of the Carbon Language project, under the Apache License v2.0 with LLVM // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +// RUN: executable_semantics %s 2>&1 | \ +// RUN: FileCheck --match-full-lines --allow-unused-prefixes=false %s +// RUN: executable_semantics --trace %s 2>&1 | \ +// RUN: FileCheck --match-full-lines --allow-unused-prefixes %s +// AUTOUPDATE: executable_semantics %s +// CHECK: result: 0 package ExecutableSemanticsTest api; diff --git a/executable_semantics/testdata/next.golden b/executable_semantics/testdata/next.golden deleted file mode 100644 index 2db2755da426..000000000000 --- a/executable_semantics/testdata/next.golden +++ /dev/null @@ -1 +0,0 @@ -result: 0 diff --git a/executable_semantics/testdata/no_match.carbon b/executable_semantics/testdata/no_match.carbon index f05a6e8f2f5d..cdd7b57082e0 100644 --- a/executable_semantics/testdata/no_match.carbon +++ b/executable_semantics/testdata/no_match.carbon @@ -1,6 +1,13 @@ // Part of the Carbon Language project, under the Apache License v2.0 with LLVM // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +// RUN: executable_semantics %s 2>&1 | \ +// RUN: FileCheck --match-full-lines --allow-unused-prefixes=false %s +// RUN: executable_semantics --trace %s 2>&1 | \ +// RUN: FileCheck --match-full-lines --allow-unused-prefixes %s +// AUTOUPDATE: executable_semantics %s +// CHECK: result: 0 package ExecutableSemanticsTest api; diff --git a/executable_semantics/testdata/no_match.golden b/executable_semantics/testdata/no_match.golden deleted file mode 100644 index 2db2755da426..000000000000 --- a/executable_semantics/testdata/no_match.golden +++ /dev/null @@ -1 +0,0 @@ -result: 0 diff --git a/executable_semantics/testdata/package_library.carbon b/executable_semantics/testdata/package_library.carbon index 9572e7fc52d6..eefd54770721 100644 --- a/executable_semantics/testdata/package_library.carbon +++ b/executable_semantics/testdata/package_library.carbon @@ -1,6 +1,13 @@ // Part of the Carbon Language project, under the Apache License v2.0 with LLVM // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +// RUN: executable_semantics %s 2>&1 | \ +// RUN: FileCheck --match-full-lines --allow-unused-prefixes=false %s +// RUN: executable_semantics --trace %s 2>&1 | \ +// RUN: FileCheck --match-full-lines --allow-unused-prefixes %s +// AUTOUPDATE: executable_semantics %s +// CHECK: result: 0 package ExecutableSemanticsTest library "Foo" api; diff --git a/executable_semantics/testdata/package_library.golden b/executable_semantics/testdata/package_library.golden deleted file mode 100644 index 2db2755da426..000000000000 --- a/executable_semantics/testdata/package_library.golden +++ /dev/null @@ -1 +0,0 @@ -result: 0 diff --git a/executable_semantics/testdata/package_missing.carbon b/executable_semantics/testdata/package_missing.carbon index 7a87538724c8..b8e1e1af644f 100644 --- a/executable_semantics/testdata/package_missing.carbon +++ b/executable_semantics/testdata/package_missing.carbon @@ -1,6 +1,14 @@ // Part of the Carbon Language project, under the Apache License v2.0 with LLVM // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +// RUN: not executable_semantics %s 2>&1 | \ +// RUN: FileCheck --match-full-lines --allow-unused-prefixes=false %s +// RUN: not executable_semantics --trace %s 2>&1 | \ +// RUN: FileCheck --match-full-lines --allow-unused-prefixes %s +// AUTOUPDATE: executable_semantics %s +// CHECK: COMPILATION ERROR: {{.*}}/package_missing.carbon:13: syntax error, unexpected FN, expecting PACKAGE + fn main() -> i32 { return 0; diff --git a/executable_semantics/testdata/package_missing.golden b/executable_semantics/testdata/package_missing.golden deleted file mode 100644 index e3f0427ec0c9..000000000000 --- a/executable_semantics/testdata/package_missing.golden +++ /dev/null @@ -1,2 +0,0 @@ -COMPILATION ERROR: executable_semantics/testdata/package_missing.carbon:5: syntax error, unexpected FN, expecting PACKAGE -EXIT CODE: 255 diff --git a/executable_semantics/testdata/pattern_init.carbon b/executable_semantics/testdata/pattern_init.carbon index d563802a303c..57eba5ca85ed 100644 --- a/executable_semantics/testdata/pattern_init.carbon +++ b/executable_semantics/testdata/pattern_init.carbon @@ -1,6 +1,13 @@ // Part of the Carbon Language project, under the Apache License v2.0 with LLVM // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +// RUN: executable_semantics %s 2>&1 | \ +// RUN: FileCheck --match-full-lines --allow-unused-prefixes=false %s +// RUN: executable_semantics --trace %s 2>&1 | \ +// RUN: FileCheck --match-full-lines --allow-unused-prefixes %s +// AUTOUPDATE: executable_semantics %s +// CHECK: result: 0 package ExecutableSemanticsTest api; diff --git a/executable_semantics/testdata/pattern_init.golden b/executable_semantics/testdata/pattern_init.golden deleted file mode 100644 index 2db2755da426..000000000000 --- a/executable_semantics/testdata/pattern_init.golden +++ /dev/null @@ -1 +0,0 @@ -result: 0 diff --git a/executable_semantics/testdata/pattern_variable_fail.carbon b/executable_semantics/testdata/pattern_variable_fail.carbon index ef7d063cb93c..8bf5c0b538bf 100644 --- a/executable_semantics/testdata/pattern_variable_fail.carbon +++ b/executable_semantics/testdata/pattern_variable_fail.carbon @@ -1,6 +1,14 @@ // Part of the Carbon Language project, under the Apache License v2.0 with LLVM // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +// RUN: not executable_semantics %s 2>&1 | \ +// RUN: FileCheck --match-full-lines --allow-unused-prefixes=false %s +// RUN: not executable_semantics --trace %s 2>&1 | \ +// RUN: FileCheck --match-full-lines --allow-unused-prefixes %s +// AUTOUPDATE: executable_semantics %s +// CHECK: COMPILATION ERROR: {{.*}}/pattern_variable_fail.carbon:17: syntax error, unexpected COLON + package ExecutableSemanticsTest api; diff --git a/executable_semantics/testdata/pattern_variable_fail.golden b/executable_semantics/testdata/pattern_variable_fail.golden deleted file mode 100644 index da738c81abb5..000000000000 --- a/executable_semantics/testdata/pattern_variable_fail.golden +++ /dev/null @@ -1,2 +0,0 @@ -COMPILATION ERROR: executable_semantics/testdata/pattern_variable_fail.carbon:9: syntax error, unexpected COLON -EXIT CODE: 255 diff --git a/executable_semantics/testdata/placeholder_variable.carbon b/executable_semantics/testdata/placeholder_variable.carbon index 3f3afbc442b0..c1256ee39352 100644 --- a/executable_semantics/testdata/placeholder_variable.carbon +++ b/executable_semantics/testdata/placeholder_variable.carbon @@ -1,6 +1,13 @@ // Part of the Carbon Language project, under the Apache License v2.0 with LLVM // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +// RUN: executable_semantics %s 2>&1 | \ +// RUN: FileCheck --match-full-lines --allow-unused-prefixes=false %s +// RUN: executable_semantics --trace %s 2>&1 | \ +// RUN: FileCheck --match-full-lines --allow-unused-prefixes %s +// AUTOUPDATE: executable_semantics %s +// CHECK: result: 0 package ExecutableSemanticsTest api; diff --git a/executable_semantics/testdata/placeholder_variable.golden b/executable_semantics/testdata/placeholder_variable.golden deleted file mode 100644 index 2db2755da426..000000000000 --- a/executable_semantics/testdata/placeholder_variable.golden +++ /dev/null @@ -1 +0,0 @@ -result: 0 diff --git a/executable_semantics/testdata/print1.carbon b/executable_semantics/testdata/print1.carbon index 2ef1d7e53ba1..ce9093cee83a 100644 --- a/executable_semantics/testdata/print1.carbon +++ b/executable_semantics/testdata/print1.carbon @@ -1,6 +1,14 @@ // Part of the Carbon Language project, under the Apache License v2.0 with LLVM // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +// RUN: executable_semantics %s 2>&1 | \ +// RUN: FileCheck --match-full-lines --allow-unused-prefixes=false %s +// RUN: executable_semantics --trace %s 2>&1 | \ +// RUN: FileCheck --match-full-lines --allow-unused-prefixes %s +// AUTOUPDATE: executable_semantics %s +// CHECK: Hello world! +// CHECK: result: 0 package ExecutableSemanticsTest api; diff --git a/executable_semantics/testdata/print1.golden b/executable_semantics/testdata/print1.golden deleted file mode 100644 index f701bed11cfa..000000000000 --- a/executable_semantics/testdata/print1.golden +++ /dev/null @@ -1,2 +0,0 @@ -Hello world! -result: 0 diff --git a/executable_semantics/testdata/record1.carbon b/executable_semantics/testdata/record1.carbon index 827d555f6b77..c571f639a657 100644 --- a/executable_semantics/testdata/record1.carbon +++ b/executable_semantics/testdata/record1.carbon @@ -1,6 +1,13 @@ // Part of the Carbon Language project, under the Apache License v2.0 with LLVM // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +// RUN: executable_semantics %s 2>&1 | \ +// RUN: FileCheck --match-full-lines --allow-unused-prefixes=false %s +// RUN: executable_semantics --trace %s 2>&1 | \ +// RUN: FileCheck --match-full-lines --allow-unused-prefixes %s +// AUTOUPDATE: executable_semantics %s +// CHECK: result: 0 package ExecutableSemanticsTest api; diff --git a/executable_semantics/testdata/record1.golden b/executable_semantics/testdata/record1.golden deleted file mode 100644 index 2db2755da426..000000000000 --- a/executable_semantics/testdata/record1.golden +++ /dev/null @@ -1 +0,0 @@ -result: 0 diff --git a/executable_semantics/testdata/return_auto.carbon b/executable_semantics/testdata/return_auto.carbon index 7da2486a862e..7ba06582a02b 100644 --- a/executable_semantics/testdata/return_auto.carbon +++ b/executable_semantics/testdata/return_auto.carbon @@ -1,6 +1,14 @@ // Part of the Carbon Language project, under the Apache License v2.0 with LLVM // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +// RUN: not executable_semantics %s 2>&1 | \ +// RUN: FileCheck --match-full-lines --allow-unused-prefixes=false %s +// RUN: not executable_semantics --trace %s 2>&1 | \ +// RUN: FileCheck --match-full-lines --allow-unused-prefixes %s +// AUTOUPDATE: executable_semantics %s +// CHECK: COMPILATION ERROR: {{.*}}/return_auto.carbon:15: syntax error, unexpected AUTO + package ExecutableSemanticsTest api; diff --git a/executable_semantics/testdata/return_auto.golden b/executable_semantics/testdata/return_auto.golden deleted file mode 100644 index 535e5ceca5a3..000000000000 --- a/executable_semantics/testdata/return_auto.golden +++ /dev/null @@ -1,2 +0,0 @@ -COMPILATION ERROR: executable_semantics/testdata/return_auto.carbon:7: syntax error, unexpected AUTO -EXIT CODE: 255 diff --git a/executable_semantics/testdata/return_empty_explicit.carbon b/executable_semantics/testdata/return_empty_explicit.carbon index d2ef7ef3c791..51646f2d9178 100644 --- a/executable_semantics/testdata/return_empty_explicit.carbon +++ b/executable_semantics/testdata/return_empty_explicit.carbon @@ -1,6 +1,13 @@ // Part of the Carbon Language project, under the Apache License v2.0 with LLVM // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +// RUN: executable_semantics %s 2>&1 | \ +// RUN: FileCheck --match-full-lines --allow-unused-prefixes=false %s +// RUN: executable_semantics --trace %s 2>&1 | \ +// RUN: FileCheck --match-full-lines --allow-unused-prefixes %s +// AUTOUPDATE: executable_semantics %s +// CHECK: result: 0 package ExecutableSemanticsTest api; diff --git a/executable_semantics/testdata/return_empty_explicit.golden b/executable_semantics/testdata/return_empty_explicit.golden deleted file mode 100644 index 2db2755da426..000000000000 --- a/executable_semantics/testdata/return_empty_explicit.golden +++ /dev/null @@ -1 +0,0 @@ -result: 0 diff --git a/executable_semantics/testdata/return_empty_explicit_fail.carbon b/executable_semantics/testdata/return_empty_explicit_fail.carbon index 9132bdd44be2..24972f5ffb10 100644 --- a/executable_semantics/testdata/return_empty_explicit_fail.carbon +++ b/executable_semantics/testdata/return_empty_explicit_fail.carbon @@ -1,6 +1,14 @@ // Part of the Carbon Language project, under the Apache License v2.0 with LLVM // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +// RUN: not executable_semantics %s 2>&1 | \ +// RUN: FileCheck --match-full-lines --allow-unused-prefixes=false %s +// RUN: not executable_semantics --trace %s 2>&1 | \ +// RUN: FileCheck --match-full-lines --allow-unused-prefixes %s +// AUTOUPDATE: executable_semantics %s +// CHECK: COMPILATION ERROR: {{.*}}/return_empty_explicit_fail.carbon:16: return (); should not provide a return value, to match the function's signature. + package ExecutableSemanticsTest api; diff --git a/executable_semantics/testdata/return_empty_explicit_fail.golden b/executable_semantics/testdata/return_empty_explicit_fail.golden deleted file mode 100644 index c06187d107f6..000000000000 --- a/executable_semantics/testdata/return_empty_explicit_fail.golden +++ /dev/null @@ -1,2 +0,0 @@ -COMPILATION ERROR: executable_semantics/testdata/return_empty_explicit_fail.carbon:8: return (); should not provide a return value, to match the function's signature. -EXIT CODE: 255 diff --git a/executable_semantics/testdata/return_empty_implicit1.carbon b/executable_semantics/testdata/return_empty_implicit1.carbon index 33d120730f00..03add62bea5e 100644 --- a/executable_semantics/testdata/return_empty_implicit1.carbon +++ b/executable_semantics/testdata/return_empty_implicit1.carbon @@ -1,6 +1,13 @@ // Part of the Carbon Language project, under the Apache License v2.0 with LLVM // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +// RUN: executable_semantics %s 2>&1 | \ +// RUN: FileCheck --match-full-lines --allow-unused-prefixes=false %s +// RUN: executable_semantics --trace %s 2>&1 | \ +// RUN: FileCheck --match-full-lines --allow-unused-prefixes %s +// AUTOUPDATE: executable_semantics %s +// CHECK: result: 0 package ExecutableSemanticsTest api; diff --git a/executable_semantics/testdata/return_empty_implicit1.golden b/executable_semantics/testdata/return_empty_implicit1.golden deleted file mode 100644 index 2db2755da426..000000000000 --- a/executable_semantics/testdata/return_empty_implicit1.golden +++ /dev/null @@ -1 +0,0 @@ -result: 0 diff --git a/executable_semantics/testdata/return_empty_implicit2.carbon b/executable_semantics/testdata/return_empty_implicit2.carbon index 5bb27d7df2ab..619e51368f04 100644 --- a/executable_semantics/testdata/return_empty_implicit2.carbon +++ b/executable_semantics/testdata/return_empty_implicit2.carbon @@ -1,6 +1,13 @@ // Part of the Carbon Language project, under the Apache License v2.0 with LLVM // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +// RUN: executable_semantics %s 2>&1 | \ +// RUN: FileCheck --match-full-lines --allow-unused-prefixes=false %s +// RUN: executable_semantics --trace %s 2>&1 | \ +// RUN: FileCheck --match-full-lines --allow-unused-prefixes %s +// AUTOUPDATE: executable_semantics %s +// CHECK: result: 0 package ExecutableSemanticsTest api; diff --git a/executable_semantics/testdata/return_empty_implicit2.golden b/executable_semantics/testdata/return_empty_implicit2.golden deleted file mode 100644 index 2db2755da426..000000000000 --- a/executable_semantics/testdata/return_empty_implicit2.golden +++ /dev/null @@ -1 +0,0 @@ -result: 0 diff --git a/executable_semantics/testdata/return_empty_implicit_fail1.carbon b/executable_semantics/testdata/return_empty_implicit_fail1.carbon index 613543fe756b..5dff75012eda 100644 --- a/executable_semantics/testdata/return_empty_implicit_fail1.carbon +++ b/executable_semantics/testdata/return_empty_implicit_fail1.carbon @@ -1,6 +1,14 @@ // Part of the Carbon Language project, under the Apache License v2.0 with LLVM // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +// RUN: not executable_semantics %s 2>&1 | \ +// RUN: FileCheck --match-full-lines --allow-unused-prefixes=false %s +// RUN: not executable_semantics --trace %s 2>&1 | \ +// RUN: FileCheck --match-full-lines --allow-unused-prefixes %s +// AUTOUPDATE: executable_semantics %s +// CHECK: COMPILATION ERROR: {{.*}}/return_empty_implicit_fail1.carbon:16: control-flow reaches end of function that provides a `->` return type without reaching a return statement + package ExecutableSemanticsTest api; diff --git a/executable_semantics/testdata/return_empty_implicit_fail1.golden b/executable_semantics/testdata/return_empty_implicit_fail1.golden deleted file mode 100644 index 1b758dc4c992..000000000000 --- a/executable_semantics/testdata/return_empty_implicit_fail1.golden +++ /dev/null @@ -1,2 +0,0 @@ -COMPILATION ERROR: executable_semantics/testdata/return_empty_implicit_fail1.carbon:8: control-flow reaches end of function that provides a `->` return type without reaching a return statement -EXIT CODE: 255 diff --git a/executable_semantics/testdata/return_empty_implicit_fail2.carbon b/executable_semantics/testdata/return_empty_implicit_fail2.carbon index f9971ef96d76..a8f825e7cba7 100644 --- a/executable_semantics/testdata/return_empty_implicit_fail2.carbon +++ b/executable_semantics/testdata/return_empty_implicit_fail2.carbon @@ -1,6 +1,14 @@ // Part of the Carbon Language project, under the Apache License v2.0 with LLVM // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +// RUN: not executable_semantics %s 2>&1 | \ +// RUN: FileCheck --match-full-lines --allow-unused-prefixes=false %s +// RUN: not executable_semantics --trace %s 2>&1 | \ +// RUN: FileCheck --match-full-lines --allow-unused-prefixes %s +// AUTOUPDATE: executable_semantics %s +// CHECK: COMPILATION ERROR: {{.*}}/return_empty_implicit_fail2.carbon:16: return; should provide a return value, to match the function's signature. + package ExecutableSemanticsTest api; diff --git a/executable_semantics/testdata/return_empty_implicit_fail2.golden b/executable_semantics/testdata/return_empty_implicit_fail2.golden deleted file mode 100644 index ffddb39c077e..000000000000 --- a/executable_semantics/testdata/return_empty_implicit_fail2.golden +++ /dev/null @@ -1,2 +0,0 @@ -COMPILATION ERROR: executable_semantics/testdata/return_empty_implicit_fail2.carbon:8: return; should provide a return value, to match the function's signature. -EXIT CODE: 255 diff --git a/executable_semantics/testdata/star.carbon b/executable_semantics/testdata/star.carbon index c1bdd09d3ac3..26a8f1ebff8d 100644 --- a/executable_semantics/testdata/star.carbon +++ b/executable_semantics/testdata/star.carbon @@ -1,6 +1,13 @@ // Part of the Carbon Language project, under the Apache License v2.0 with LLVM // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +// RUN: executable_semantics %s 2>&1 | \ +// RUN: FileCheck --match-full-lines --allow-unused-prefixes=false %s +// RUN: executable_semantics --trace %s 2>&1 | \ +// RUN: FileCheck --match-full-lines --allow-unused-prefixes %s +// AUTOUPDATE: executable_semantics %s +// CHECK: result: 0 package ExecutableSemanticsTest api; diff --git a/executable_semantics/testdata/star.golden b/executable_semantics/testdata/star.golden deleted file mode 100644 index 2db2755da426..000000000000 --- a/executable_semantics/testdata/star.golden +++ /dev/null @@ -1 +0,0 @@ -result: 0 diff --git a/executable_semantics/testdata/string1.carbon b/executable_semantics/testdata/string1.carbon index 4405fe85fae8..8b352ea703a6 100644 --- a/executable_semantics/testdata/string1.carbon +++ b/executable_semantics/testdata/string1.carbon @@ -1,6 +1,13 @@ // Part of the Carbon Language project, under the Apache License v2.0 with LLVM // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +// RUN: executable_semantics %s 2>&1 | \ +// RUN: FileCheck --match-full-lines --allow-unused-prefixes=false %s +// RUN: executable_semantics --trace %s 2>&1 | \ +// RUN: FileCheck --match-full-lines --allow-unused-prefixes %s +// AUTOUPDATE: executable_semantics %s +// CHECK: result: 0 package ExecutableSemanticsTest api; diff --git a/executable_semantics/testdata/string1.golden b/executable_semantics/testdata/string1.golden deleted file mode 100644 index 2db2755da426..000000000000 --- a/executable_semantics/testdata/string1.golden +++ /dev/null @@ -1 +0,0 @@ -result: 0 diff --git a/executable_semantics/testdata/string2.carbon b/executable_semantics/testdata/string2.carbon index 449c7aa2b903..6cab9df48610 100644 --- a/executable_semantics/testdata/string2.carbon +++ b/executable_semantics/testdata/string2.carbon @@ -1,6 +1,13 @@ // Part of the Carbon Language project, under the Apache License v2.0 with LLVM // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +// RUN: executable_semantics %s 2>&1 | \ +// RUN: FileCheck --match-full-lines --allow-unused-prefixes=false %s +// RUN: executable_semantics --trace %s 2>&1 | \ +// RUN: FileCheck --match-full-lines --allow-unused-prefixes %s +// AUTOUPDATE: executable_semantics %s +// CHECK: result: 0 package ExecutableSemanticsTest api; diff --git a/executable_semantics/testdata/string2.golden b/executable_semantics/testdata/string2.golden deleted file mode 100644 index 2db2755da426..000000000000 --- a/executable_semantics/testdata/string2.golden +++ /dev/null @@ -1 +0,0 @@ -result: 0 diff --git a/executable_semantics/testdata/string3.carbon b/executable_semantics/testdata/string3.carbon index 36b91c496592..b816872446cf 100644 --- a/executable_semantics/testdata/string3.carbon +++ b/executable_semantics/testdata/string3.carbon @@ -1,6 +1,13 @@ // Part of the Carbon Language project, under the Apache License v2.0 with LLVM // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +// RUN: executable_semantics %s 2>&1 | \ +// RUN: FileCheck --match-full-lines --allow-unused-prefixes=false %s +// RUN: executable_semantics --trace %s 2>&1 | \ +// RUN: FileCheck --match-full-lines --allow-unused-prefixes %s +// AUTOUPDATE: executable_semantics %s +// CHECK: result: 0 package ExecutableSemanticsTest api; diff --git a/executable_semantics/testdata/string3.golden b/executable_semantics/testdata/string3.golden deleted file mode 100644 index 2db2755da426..000000000000 --- a/executable_semantics/testdata/string3.golden +++ /dev/null @@ -1 +0,0 @@ -result: 0 diff --git a/executable_semantics/testdata/string_fail1.carbon b/executable_semantics/testdata/string_fail1.carbon index 67eed54704d9..040ff097f577 100644 --- a/executable_semantics/testdata/string_fail1.carbon +++ b/executable_semantics/testdata/string_fail1.carbon @@ -1,6 +1,14 @@ // Part of the Carbon Language project, under the Apache License v2.0 with LLVM // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +// RUN: not executable_semantics %s 2>&1 | \ +// RUN: FileCheck --match-full-lines --allow-unused-prefixes=false %s +// RUN: not executable_semantics --trace %s 2>&1 | \ +// RUN: FileCheck --match-full-lines --allow-unused-prefixes %s +// AUTOUPDATE: executable_semantics %s +// CHECK: COMPILATION ERROR: {{.*}}/string_fail1.carbon:16: Invalid escaping in string: "str\e" + package ExecutableSemanticsTest api; diff --git a/executable_semantics/testdata/string_fail1.golden b/executable_semantics/testdata/string_fail1.golden deleted file mode 100644 index 80e4740bbc87..000000000000 --- a/executable_semantics/testdata/string_fail1.golden +++ /dev/null @@ -1,2 +0,0 @@ -COMPILATION ERROR: executable_semantics/testdata/string_fail1.carbon:8: Invalid escaping in string: "str\e" -EXIT CODE: 255 diff --git a/executable_semantics/testdata/string_fail2.carbon b/executable_semantics/testdata/string_fail2.carbon index ee59b401aab0..c214552ae9bf 100644 --- a/executable_semantics/testdata/string_fail2.carbon +++ b/executable_semantics/testdata/string_fail2.carbon @@ -1,6 +1,14 @@ // Part of the Carbon Language project, under the Apache License v2.0 with LLVM // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +// RUN: not executable_semantics %s 2>&1 | \ +// RUN: FileCheck --match-full-lines --allow-unused-prefixes=false %s +// RUN: not executable_semantics --trace %s 2>&1 | \ +// RUN: FileCheck --match-full-lines --allow-unused-prefixes %s +// AUTOUPDATE: executable_semantics %s +// CHECK: COMPILATION ERROR: {{.*}}/string_fail2.carbon:16: Invalid escaping in string: "str\x" + package ExecutableSemanticsTest api; diff --git a/executable_semantics/testdata/string_fail2.golden b/executable_semantics/testdata/string_fail2.golden deleted file mode 100644 index 082579f4e8f9..000000000000 --- a/executable_semantics/testdata/string_fail2.golden +++ /dev/null @@ -1,2 +0,0 @@ -COMPILATION ERROR: executable_semantics/testdata/string_fail2.carbon:8: Invalid escaping in string: "str\x" -EXIT CODE: 255 diff --git a/executable_semantics/testdata/string_fail3.carbon b/executable_semantics/testdata/string_fail3.carbon index 1d29b32ef7a2..b77ffba067bd 100644 --- a/executable_semantics/testdata/string_fail3.carbon +++ b/executable_semantics/testdata/string_fail3.carbon @@ -1,6 +1,14 @@ // Part of the Carbon Language project, under the Apache License v2.0 with LLVM // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +// RUN: not executable_semantics %s 2>&1 | \ +// RUN: FileCheck --match-full-lines --allow-unused-prefixes=false %s +// RUN: not executable_semantics --trace %s 2>&1 | \ +// RUN: FileCheck --match-full-lines --allow-unused-prefixes %s +// AUTOUPDATE: executable_semantics %s +// CHECK: COMPILATION ERROR: {{.*}}/string_fail3.carbon:16: Invalid escaping in string: "str\xaa" + package ExecutableSemanticsTest api; diff --git a/executable_semantics/testdata/string_fail3.golden b/executable_semantics/testdata/string_fail3.golden deleted file mode 100644 index ab8183d12496..000000000000 --- a/executable_semantics/testdata/string_fail3.golden +++ /dev/null @@ -1,2 +0,0 @@ -COMPILATION ERROR: executable_semantics/testdata/string_fail3.carbon:8: Invalid escaping in string: "str\xaa" -EXIT CODE: 255 diff --git a/executable_semantics/testdata/string_fail4.carbon b/executable_semantics/testdata/string_fail4.carbon index db1679afe72e..163627f25c9c 100644 --- a/executable_semantics/testdata/string_fail4.carbon +++ b/executable_semantics/testdata/string_fail4.carbon @@ -1,6 +1,14 @@ // Part of the Carbon Language project, under the Apache License v2.0 with LLVM // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +// RUN: not executable_semantics %s 2>&1 | \ +// RUN: FileCheck --match-full-lines --allow-unused-prefixes=false %s +// RUN: not executable_semantics --trace %s 2>&1 | \ +// RUN: FileCheck --match-full-lines --allow-unused-prefixes %s +// AUTOUPDATE: executable_semantics %s +// CHECK: COMPILATION ERROR: {{.*}}/string_fail4.carbon:16: Invalid escaping in string: "str\01" + package ExecutableSemanticsTest api; diff --git a/executable_semantics/testdata/string_fail4.golden b/executable_semantics/testdata/string_fail4.golden deleted file mode 100644 index e6a4890ca300..000000000000 --- a/executable_semantics/testdata/string_fail4.golden +++ /dev/null @@ -1,2 +0,0 @@ -COMPILATION ERROR: executable_semantics/testdata/string_fail4.carbon:8: Invalid escaping in string: "str\01" -EXIT CODE: 255 diff --git a/executable_semantics/testdata/string_fail5.carbon b/executable_semantics/testdata/string_fail5.carbon index 7d22e729deae..fb092a9a249d 100644 --- a/executable_semantics/testdata/string_fail5.carbon +++ b/executable_semantics/testdata/string_fail5.carbon @@ -1,6 +1,14 @@ // Part of the Carbon Language project, under the Apache License v2.0 with LLVM // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +// RUN: not executable_semantics %s 2>&1 | \ +// RUN: FileCheck --match-full-lines --allow-unused-prefixes=false %s +// RUN: not executable_semantics --trace %s 2>&1 | \ +// RUN: FileCheck --match-full-lines --allow-unused-prefixes %s +// AUTOUPDATE: executable_semantics %s +// CHECK: COMPILATION ERROR: {{.*}}/string_fail5.carbon:16: invalid character '\x22' in source file. + package ExecutableSemanticsTest api; diff --git a/executable_semantics/testdata/string_fail5.golden b/executable_semantics/testdata/string_fail5.golden deleted file mode 100644 index 2fb63e7df106..000000000000 --- a/executable_semantics/testdata/string_fail5.golden +++ /dev/null @@ -1,2 +0,0 @@ -COMPILATION ERROR: executable_semantics/testdata/string_fail5.carbon:8: invalid character '\x22' in source file. -EXIT CODE: 255 diff --git a/executable_semantics/testdata/string_fail6.carbon b/executable_semantics/testdata/string_fail6.carbon index b418a5c6c6dd..152a0d92c7eb 100644 --- a/executable_semantics/testdata/string_fail6.carbon +++ b/executable_semantics/testdata/string_fail6.carbon @@ -1,6 +1,14 @@ // Part of the Carbon Language project, under the Apache License v2.0 with LLVM // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +// RUN: not executable_semantics %s 2>&1 | \ +// RUN: FileCheck --match-full-lines --allow-unused-prefixes=false %s +// RUN: not executable_semantics --trace %s 2>&1 | \ +// RUN: FileCheck --match-full-lines --allow-unused-prefixes %s +// AUTOUPDATE: executable_semantics %s +// CHECK: COMPILATION ERROR: {{.*}}/string_fail6.carbon:16: Invalid escaping in string: "new line" + package ExecutableSemanticsTest api; diff --git a/executable_semantics/testdata/string_fail6.golden b/executable_semantics/testdata/string_fail6.golden deleted file mode 100644 index 25467b3a874a..000000000000 --- a/executable_semantics/testdata/string_fail6.golden +++ /dev/null @@ -1,2 +0,0 @@ -COMPILATION ERROR: executable_semantics/testdata/string_fail6.carbon:8: Invalid escaping in string: "new line" -EXIT CODE: 255 diff --git a/executable_semantics/testdata/tuple1.carbon b/executable_semantics/testdata/tuple1.carbon index 1cf887a99e9b..6d1c5c062d17 100644 --- a/executable_semantics/testdata/tuple1.carbon +++ b/executable_semantics/testdata/tuple1.carbon @@ -1,6 +1,13 @@ // Part of the Carbon Language project, under the Apache License v2.0 with LLVM // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +// RUN: executable_semantics %s 2>&1 | \ +// RUN: FileCheck --match-full-lines --allow-unused-prefixes=false %s +// RUN: executable_semantics --trace %s 2>&1 | \ +// RUN: FileCheck --match-full-lines --allow-unused-prefixes %s +// AUTOUPDATE: executable_semantics %s +// CHECK: result: 0 package ExecutableSemanticsTest api; diff --git a/executable_semantics/testdata/tuple1.golden b/executable_semantics/testdata/tuple1.golden deleted file mode 100644 index 2db2755da426..000000000000 --- a/executable_semantics/testdata/tuple1.golden +++ /dev/null @@ -1 +0,0 @@ -result: 0 diff --git a/executable_semantics/testdata/tuple2.carbon b/executable_semantics/testdata/tuple2.carbon index d306a662a69f..74af0289ca53 100644 --- a/executable_semantics/testdata/tuple2.carbon +++ b/executable_semantics/testdata/tuple2.carbon @@ -1,6 +1,13 @@ // Part of the Carbon Language project, under the Apache License v2.0 with LLVM // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +// RUN: executable_semantics %s 2>&1 | \ +// RUN: FileCheck --match-full-lines --allow-unused-prefixes=false %s +// RUN: executable_semantics --trace %s 2>&1 | \ +// RUN: FileCheck --match-full-lines --allow-unused-prefixes %s +// AUTOUPDATE: executable_semantics %s +// CHECK: result: 0 package ExecutableSemanticsTest api; diff --git a/executable_semantics/testdata/tuple2.golden b/executable_semantics/testdata/tuple2.golden deleted file mode 100644 index 2db2755da426..000000000000 --- a/executable_semantics/testdata/tuple2.golden +++ /dev/null @@ -1 +0,0 @@ -result: 0 diff --git a/executable_semantics/testdata/tuple3.carbon b/executable_semantics/testdata/tuple3.carbon index 92e2f79942cc..c1cbc542555a 100644 --- a/executable_semantics/testdata/tuple3.carbon +++ b/executable_semantics/testdata/tuple3.carbon @@ -1,6 +1,13 @@ // Part of the Carbon Language project, under the Apache License v2.0 with LLVM // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +// RUN: executable_semantics %s 2>&1 | \ +// RUN: FileCheck --match-full-lines --allow-unused-prefixes=false %s +// RUN: executable_semantics --trace %s 2>&1 | \ +// RUN: FileCheck --match-full-lines --allow-unused-prefixes %s +// AUTOUPDATE: executable_semantics %s +// CHECK: result: 0 package ExecutableSemanticsTest api; diff --git a/executable_semantics/testdata/tuple3.golden b/executable_semantics/testdata/tuple3.golden deleted file mode 100644 index 2db2755da426..000000000000 --- a/executable_semantics/testdata/tuple3.golden +++ /dev/null @@ -1 +0,0 @@ -result: 0 diff --git a/executable_semantics/testdata/tuple4.carbon b/executable_semantics/testdata/tuple4.carbon index 81e357402677..832b8628a5aa 100644 --- a/executable_semantics/testdata/tuple4.carbon +++ b/executable_semantics/testdata/tuple4.carbon @@ -1,6 +1,13 @@ // Part of the Carbon Language project, under the Apache License v2.0 with LLVM // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +// RUN: not executable_semantics %s 2>&1 | \ +// RUN: FileCheck --match-full-lines --allow-unused-prefixes=false %s +// RUN: not executable_semantics --trace %s 2>&1 | \ +// RUN: FileCheck --match-full-lines --allow-unused-prefixes %s +// AUTOUPDATE: executable_semantics %s +// CHECK: PROGRAM ERROR: {{.*}}/tuple4.carbon:15: positional members must come before named members package ExecutableSemanticsTest api; diff --git a/executable_semantics/testdata/tuple4.golden b/executable_semantics/testdata/tuple4.golden deleted file mode 100644 index f65afac4c2ea..000000000000 --- a/executable_semantics/testdata/tuple4.golden +++ /dev/null @@ -1,2 +0,0 @@ -PROGRAM ERROR: executable_semantics/testdata/tuple4.carbon:8: positional members must come before named members -EXIT CODE: 255 diff --git a/executable_semantics/testdata/tuple5.carbon b/executable_semantics/testdata/tuple5.carbon index e9b5ee2d9fdd..53eba00a67c1 100644 --- a/executable_semantics/testdata/tuple5.carbon +++ b/executable_semantics/testdata/tuple5.carbon @@ -1,6 +1,13 @@ // Part of the Carbon Language project, under the Apache License v2.0 with LLVM // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +// RUN: not executable_semantics %s 2>&1 | \ +// RUN: FileCheck --match-full-lines --allow-unused-prefixes=false %s +// RUN: not executable_semantics --trace %s 2>&1 | \ +// RUN: FileCheck --match-full-lines --allow-unused-prefixes %s +// AUTOUPDATE: executable_semantics %s +// CHECK: PROGRAM ERROR: {{.*}}/tuple5.carbon:17: Tuple field name 'y' does not match pattern field name 'x' package ExecutableSemanticsTest api; diff --git a/executable_semantics/testdata/tuple5.golden b/executable_semantics/testdata/tuple5.golden deleted file mode 100644 index fcb8cdbc1969..000000000000 --- a/executable_semantics/testdata/tuple5.golden +++ /dev/null @@ -1,2 +0,0 @@ -PROGRAM ERROR: executable_semantics/testdata/tuple5.carbon:10: Tuple field name 'y' does not match pattern field name 'x' -EXIT CODE: 255 diff --git a/executable_semantics/testdata/tuple_assign.carbon b/executable_semantics/testdata/tuple_assign.carbon index 2d9af23520b0..0598c59737cc 100644 --- a/executable_semantics/testdata/tuple_assign.carbon +++ b/executable_semantics/testdata/tuple_assign.carbon @@ -1,6 +1,13 @@ // Part of the Carbon Language project, under the Apache License v2.0 with LLVM // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +// RUN: executable_semantics %s 2>&1 | \ +// RUN: FileCheck --match-full-lines --allow-unused-prefixes=false %s +// RUN: executable_semantics --trace %s 2>&1 | \ +// RUN: FileCheck --match-full-lines --allow-unused-prefixes %s +// AUTOUPDATE: executable_semantics %s +// CHECK: result: 0 package ExecutableSemanticsTest api; diff --git a/executable_semantics/testdata/tuple_assign.golden b/executable_semantics/testdata/tuple_assign.golden deleted file mode 100644 index 2db2755da426..000000000000 --- a/executable_semantics/testdata/tuple_assign.golden +++ /dev/null @@ -1 +0,0 @@ -result: 0 diff --git a/executable_semantics/testdata/tuple_equality.carbon b/executable_semantics/testdata/tuple_equality.carbon index b77b5ac6dbce..55f8eace112f 100644 --- a/executable_semantics/testdata/tuple_equality.carbon +++ b/executable_semantics/testdata/tuple_equality.carbon @@ -1,6 +1,13 @@ // Part of the Carbon Language project, under the Apache License v2.0 with LLVM // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +// RUN: executable_semantics %s 2>&1 | \ +// RUN: FileCheck --match-full-lines --allow-unused-prefixes=false %s +// RUN: executable_semantics --trace %s 2>&1 | \ +// RUN: FileCheck --match-full-lines --allow-unused-prefixes %s +// AUTOUPDATE: executable_semantics %s +// CHECK: result: 0 package ExecutableSemanticsTest api; diff --git a/executable_semantics/testdata/tuple_equality.golden b/executable_semantics/testdata/tuple_equality.golden deleted file mode 100644 index 2db2755da426..000000000000 --- a/executable_semantics/testdata/tuple_equality.golden +++ /dev/null @@ -1 +0,0 @@ -result: 0 diff --git a/executable_semantics/testdata/tuple_equality2.carbon b/executable_semantics/testdata/tuple_equality2.carbon index be5821bef8c3..124f67ca0d6b 100644 --- a/executable_semantics/testdata/tuple_equality2.carbon +++ b/executable_semantics/testdata/tuple_equality2.carbon @@ -1,6 +1,13 @@ // Part of the Carbon Language project, under the Apache License v2.0 with LLVM // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +// RUN: executable_semantics %s 2>&1 | \ +// RUN: FileCheck --match-full-lines --allow-unused-prefixes=false %s +// RUN: executable_semantics --trace %s 2>&1 | \ +// RUN: FileCheck --match-full-lines --allow-unused-prefixes %s +// AUTOUPDATE: executable_semantics %s +// CHECK: result: 0 package ExecutableSemanticsTest api; diff --git a/executable_semantics/testdata/tuple_equality2.golden b/executable_semantics/testdata/tuple_equality2.golden deleted file mode 100644 index 2db2755da426..000000000000 --- a/executable_semantics/testdata/tuple_equality2.golden +++ /dev/null @@ -1 +0,0 @@ -result: 0 diff --git a/executable_semantics/testdata/tuple_equality3.carbon b/executable_semantics/testdata/tuple_equality3.carbon index 0f7b119d67f6..c86edb49b810 100644 --- a/executable_semantics/testdata/tuple_equality3.carbon +++ b/executable_semantics/testdata/tuple_equality3.carbon @@ -1,6 +1,8 @@ // Part of the Carbon Language project, under the Apache License v2.0 with LLVM // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +// RUN: not executable_semantics %s 2>&1 2>&1 | FileCheck %s package ExecutableSemanticsTest api; @@ -13,3 +15,8 @@ fn main() -> i32 { return 0; } } + +// AUTOUPDATE: executable_semantics %s +// CHECK: COMPILATION ERROR: {{.*}}/tuple_equality3.carbon:12: type error in == +// CHECK: expected: (0 = i32, 1 = i32) +// CHECK: actual: (0 = i32) diff --git a/executable_semantics/testdata/tuple_equality3.golden b/executable_semantics/testdata/tuple_equality3.golden deleted file mode 100644 index 2b6f0679e047..000000000000 --- a/executable_semantics/testdata/tuple_equality3.golden +++ /dev/null @@ -1,4 +0,0 @@ -COMPILATION ERROR: executable_semantics/testdata/tuple_equality3.carbon:10: type error in == -expected: (0 = i32, 1 = i32) -actual: (0 = i32) -EXIT CODE: 255 diff --git a/executable_semantics/testdata/tuple_match.carbon b/executable_semantics/testdata/tuple_match.carbon index c3d558b4d2c7..4860c591a061 100644 --- a/executable_semantics/testdata/tuple_match.carbon +++ b/executable_semantics/testdata/tuple_match.carbon @@ -1,6 +1,13 @@ // Part of the Carbon Language project, under the Apache License v2.0 with LLVM // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +// RUN: executable_semantics %s 2>&1 | \ +// RUN: FileCheck --match-full-lines --allow-unused-prefixes=false %s +// RUN: executable_semantics --trace %s 2>&1 | \ +// RUN: FileCheck --match-full-lines --allow-unused-prefixes %s +// AUTOUPDATE: executable_semantics %s +// CHECK: result: 0 package ExecutableSemanticsTest api; diff --git a/executable_semantics/testdata/tuple_match.golden b/executable_semantics/testdata/tuple_match.golden deleted file mode 100644 index 2db2755da426..000000000000 --- a/executable_semantics/testdata/tuple_match.golden +++ /dev/null @@ -1 +0,0 @@ -result: 0 diff --git a/executable_semantics/testdata/tuple_match2.carbon b/executable_semantics/testdata/tuple_match2.carbon index 1179d06bde78..4408f8a7b1f3 100644 --- a/executable_semantics/testdata/tuple_match2.carbon +++ b/executable_semantics/testdata/tuple_match2.carbon @@ -1,6 +1,13 @@ // Part of the Carbon Language project, under the Apache License v2.0 with LLVM // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +// RUN: executable_semantics %s 2>&1 | \ +// RUN: FileCheck --match-full-lines --allow-unused-prefixes=false %s +// RUN: executable_semantics --trace %s 2>&1 | \ +// RUN: FileCheck --match-full-lines --allow-unused-prefixes %s +// AUTOUPDATE: executable_semantics %s +// CHECK: result: 0 package ExecutableSemanticsTest api; diff --git a/executable_semantics/testdata/tuple_match2.golden b/executable_semantics/testdata/tuple_match2.golden deleted file mode 100644 index 2db2755da426..000000000000 --- a/executable_semantics/testdata/tuple_match2.golden +++ /dev/null @@ -1 +0,0 @@ -result: 0 diff --git a/executable_semantics/testdata/tuple_match3.carbon b/executable_semantics/testdata/tuple_match3.carbon index 00529664b0fa..b63826b06351 100644 --- a/executable_semantics/testdata/tuple_match3.carbon +++ b/executable_semantics/testdata/tuple_match3.carbon @@ -1,6 +1,13 @@ // Part of the Carbon Language project, under the Apache License v2.0 with LLVM // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +// RUN: executable_semantics %s 2>&1 | \ +// RUN: FileCheck --match-full-lines --allow-unused-prefixes=false %s +// RUN: executable_semantics --trace %s 2>&1 | \ +// RUN: FileCheck --match-full-lines --allow-unused-prefixes %s +// AUTOUPDATE: executable_semantics %s +// CHECK: result: 0 package ExecutableSemanticsTest api; diff --git a/executable_semantics/testdata/tuple_match3.golden b/executable_semantics/testdata/tuple_match3.golden deleted file mode 100644 index 2db2755da426..000000000000 --- a/executable_semantics/testdata/tuple_match3.golden +++ /dev/null @@ -1 +0,0 @@ -result: 0 diff --git a/executable_semantics/testdata/type_compute.carbon b/executable_semantics/testdata/type_compute.carbon index 7d8fe94715fc..953ae01196e8 100644 --- a/executable_semantics/testdata/type_compute.carbon +++ b/executable_semantics/testdata/type_compute.carbon @@ -1,6 +1,13 @@ // Part of the Carbon Language project, under the Apache License v2.0 with LLVM // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +// RUN: executable_semantics %s 2>&1 | \ +// RUN: FileCheck --match-full-lines --allow-unused-prefixes=false %s +// RUN: executable_semantics --trace %s 2>&1 | \ +// RUN: FileCheck --match-full-lines --allow-unused-prefixes %s +// AUTOUPDATE: executable_semantics %s +// CHECK: result: 0 package ExecutableSemanticsTest api; diff --git a/executable_semantics/testdata/type_compute.golden b/executable_semantics/testdata/type_compute.golden deleted file mode 100644 index 2db2755da426..000000000000 --- a/executable_semantics/testdata/type_compute.golden +++ /dev/null @@ -1 +0,0 @@ -result: 0 diff --git a/executable_semantics/testdata/type_compute2.carbon b/executable_semantics/testdata/type_compute2.carbon index 6336d982cea8..04495543eaa7 100644 --- a/executable_semantics/testdata/type_compute2.carbon +++ b/executable_semantics/testdata/type_compute2.carbon @@ -1,6 +1,13 @@ // Part of the Carbon Language project, under the Apache License v2.0 with LLVM // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +// RUN: executable_semantics %s 2>&1 | \ +// RUN: FileCheck --match-full-lines --allow-unused-prefixes=false %s +// RUN: executable_semantics --trace %s 2>&1 | \ +// RUN: FileCheck --match-full-lines --allow-unused-prefixes %s +// AUTOUPDATE: executable_semantics %s +// CHECK: result: 0 package ExecutableSemanticsTest api; diff --git a/executable_semantics/testdata/type_compute2.golden b/executable_semantics/testdata/type_compute2.golden deleted file mode 100644 index 2db2755da426..000000000000 --- a/executable_semantics/testdata/type_compute2.golden +++ /dev/null @@ -1 +0,0 @@ -result: 0 diff --git a/executable_semantics/testdata/type_compute3.carbon b/executable_semantics/testdata/type_compute3.carbon index 4125272eec91..1aee168da663 100644 --- a/executable_semantics/testdata/type_compute3.carbon +++ b/executable_semantics/testdata/type_compute3.carbon @@ -1,6 +1,13 @@ // Part of the Carbon Language project, under the Apache License v2.0 with LLVM // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +// RUN: executable_semantics %s 2>&1 | \ +// RUN: FileCheck --match-full-lines --allow-unused-prefixes=false %s +// RUN: executable_semantics --trace %s 2>&1 | \ +// RUN: FileCheck --match-full-lines --allow-unused-prefixes %s +// AUTOUPDATE: executable_semantics %s +// CHECK: result: 0 package ExecutableSemanticsTest api; diff --git a/executable_semantics/testdata/type_compute3.golden b/executable_semantics/testdata/type_compute3.golden deleted file mode 100644 index 2db2755da426..000000000000 --- a/executable_semantics/testdata/type_compute3.golden +++ /dev/null @@ -1 +0,0 @@ -result: 0 diff --git a/executable_semantics/testdata/type_match.carbon b/executable_semantics/testdata/type_match.carbon index 2b838ac1f8bd..d14b60c4bfa8 100644 --- a/executable_semantics/testdata/type_match.carbon +++ b/executable_semantics/testdata/type_match.carbon @@ -1,6 +1,13 @@ // Part of the Carbon Language project, under the Apache License v2.0 with LLVM // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +// RUN: executable_semantics %s 2>&1 | \ +// RUN: FileCheck --match-full-lines --allow-unused-prefixes=false %s +// RUN: executable_semantics --trace %s 2>&1 | \ +// RUN: FileCheck --match-full-lines --allow-unused-prefixes %s +// AUTOUPDATE: executable_semantics %s +// CHECK: result: 0 package ExecutableSemanticsTest api; diff --git a/executable_semantics/testdata/type_match.golden b/executable_semantics/testdata/type_match.golden deleted file mode 100644 index 2db2755da426..000000000000 --- a/executable_semantics/testdata/type_match.golden +++ /dev/null @@ -1 +0,0 @@ -result: 0 diff --git a/executable_semantics/testdata/while1.carbon b/executable_semantics/testdata/while1.carbon index fd42d3aa4e2d..fe2ac8739c0f 100644 --- a/executable_semantics/testdata/while1.carbon +++ b/executable_semantics/testdata/while1.carbon @@ -1,6 +1,13 @@ // Part of the Carbon Language project, under the Apache License v2.0 with LLVM // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +// RUN: executable_semantics %s 2>&1 | \ +// RUN: FileCheck --match-full-lines --allow-unused-prefixes=false %s +// RUN: executable_semantics --trace %s 2>&1 | \ +// RUN: FileCheck --match-full-lines --allow-unused-prefixes %s +// AUTOUPDATE: executable_semantics %s +// CHECK: result: 0 package ExecutableSemanticsTest api; diff --git a/executable_semantics/testdata/while1.golden b/executable_semantics/testdata/while1.golden deleted file mode 100644 index 2db2755da426..000000000000 --- a/executable_semantics/testdata/while1.golden +++ /dev/null @@ -1 +0,0 @@ -result: 0 diff --git a/executable_semantics/testdata/zero.carbon b/executable_semantics/testdata/zero.carbon index 2cf5bf104a42..fe24e4a58a10 100644 --- a/executable_semantics/testdata/zero.carbon +++ b/executable_semantics/testdata/zero.carbon @@ -1,6 +1,13 @@ // Part of the Carbon Language project, under the Apache License v2.0 with LLVM // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +// RUN: executable_semantics %s 2>&1 | \ +// RUN: FileCheck --match-full-lines --allow-unused-prefixes=false %s +// RUN: executable_semantics --trace %s 2>&1 | \ +// RUN: FileCheck --match-full-lines --allow-unused-prefixes %s +// AUTOUPDATE: executable_semantics %s +// CHECK: result: 0 package ExecutableSemanticsTest api; diff --git a/executable_semantics/testdata/zero.golden b/executable_semantics/testdata/zero.golden deleted file mode 100644 index 2db2755da426..000000000000 --- a/executable_semantics/testdata/zero.golden +++ /dev/null @@ -1 +0,0 @@ -result: 0 diff --git a/executable_semantics/tests.py b/executable_semantics/tests.py deleted file mode 100755 index 2406f6eb0417..000000000000 --- a/executable_semantics/tests.py +++ /dev/null @@ -1,170 +0,0 @@ -#!/usr/bin/env python3 - -"""Helps manage tests.""" - -__copyright__ = """ -Part of the Carbon Language project, under the Apache License v2.0 with LLVM -Exceptions. See /LICENSE for license information. -SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -""" - -import argparse -from concurrent import futures -import os -import re -import subprocess -import sys - -_BINDIR = "./bazel-bin/executable_semantics" -_TESTDATA = "executable_semantics/testdata" -_TEST_LIST_BZL = "executable_semantics/test_list.bzl" - -_TEST_LIST_HEADER = """ -# Part of the Carbon Language project, under the Apache License v2.0 with LLVM -# Exceptions. See /LICENSE for license information. -# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception - -\"""Auto-generated list of tests. Run `./tests.py --update_list` to update.\""" - -TEST_LIST = [ -""" - -_TEST_LIST_FOOTER = """ -] -""" - - -def _parse_args(args=None): - """Parses command-line arguments and flags.""" - parser = argparse.ArgumentParser(description=__doc__) - group = parser.add_mutually_exclusive_group(required=True) - group.add_argument( - "--update_all", - action="store_true", - help="Runs all updates.", - ) - group.add_argument( - "--update_goldens", - action="store_true", - help="Updates golden files by running executable_semantics.", - ) - group.add_argument( - "--update_list", action="store_true", help="Updates test_list.bzl." - ) - parser.add_argument( - "--use_git_ls_files", - action="store_true", - help="Uses `git ls-files` when gathering files for --update_list.", - ) - parsed_args = parser.parse_args(args=args) - if parsed_args.use_git_ls_files and not ( - parsed_args.update_list or parsed_args.update_all - ): - parser.error("--use_git_ls_files requires --update_list") - return parsed_args - - -def _update_list(use_git_state): - """Updates test_list.bzl.""" - # Get the list of tests and goldens from the filesystem. - tests = set() - goldens = set() - if use_git_state: - ls_files = subprocess.check_output(["git", "ls-files", _TESTDATA]) - files = ls_files.decode("utf-8").splitlines() - else: - files = list(os.listdir(_TESTDATA)) - for path in files: - f = os.path.basename(path) - basename, ext = os.path.splitext(f) - if ext == ".carbon": - tests.add(basename) - elif ext == ".golden": - goldens.add(basename) - else: - sys.exit("Unrecognized file type in testdata: %s" % f) - - # Update test_list.bzl if needed, creating any missing golden files too. - test_list = _TEST_LIST_HEADER.lstrip("\n") - for test in sorted(tests): - test_list += ' "%s",\n' % test - if test not in goldens: - print("Creating empty golden '%s.golden' for test." % test) - open(os.path.join(_TESTDATA, "%s.golden" % test), "w").close() - test_list += _TEST_LIST_FOOTER.lstrip("\n") - bzl_content = open(_TEST_LIST_BZL).read() - if bzl_content != test_list: - print("Updating test_list.bzl") - with open(_TEST_LIST_BZL, "w") as bzl: - bzl.write(test_list) - else: - print("test_list.bzl is up-to-date") - - # Garbage collect unnecessary golden files. - for golden in sorted(goldens): - if golden not in tests: - filename = "%s.golden" % golden - print("Removing golden '%s' because it has no test." % filename) - os.unlink(os.path.join(_TESTDATA, filename)) - - -def _update_golden(test): - """Updates the golden file for `test` by running executable_semantics.""" - # Invoke the test update directly in order to allow parallel execution - # (`bazel run` will serialize). - p = subprocess.run( - [ - "%s/%s_test" % (_BINDIR, test), - "%s/%s.golden" % (_TESTDATA, test), - "%s/executable_semantics %s/%s.carbon" % (_BINDIR, _TESTDATA, test), - "--update", - ], - stdout=subprocess.PIPE, - stderr=subprocess.STDOUT, - ) - if p.returncode != 0: - out = p.stdout.decode("utf-8") - print(out, file=sys.stderr, end="") - sys.exit("ERROR: Updating test '%s' failed" % test) - print(".", end="", flush=True) - - -def _update_goldens(): - """Runs bazel to update golden files.""" - # Load tests from the bzl file. This isn't done through os.listdir because - # building new tests requires --update_list. - bzl_content = open(_TEST_LIST_BZL).read() - tests = re.findall(r'"(\w+)",', bzl_content) - - # Build all tests at once in order to allow parallel updates. - print("Building tests...") - subprocess.check_call( - [ - "bazel", - "build", - "//executable_semantics:golden_tests", - ], - ) - - print("Updating %d goldens..." % len(tests)) - with futures.ThreadPoolExecutor() as exec: - # list() iterates to propagate exceptions. - list([exec.map(_update_golden, tests)]) - # Each golden indicates progress with a dot without a newline, so put a - # newline to wrap. - print("\nUpdated goldens.") - - -def main(): - # Go to the repository root so that paths will match bazel's view. - os.chdir(os.path.join(os.path.dirname(__file__), "..")) - - parsed_args = _parse_args() - if parsed_args.update_all or parsed_args.update_list: - _update_list(parsed_args.use_git_ls_files) - if parsed_args.update_all or parsed_args.update_goldens: - _update_goldens() - - -if __name__ == "__main__": - main() diff --git a/executable_semantics/update_checks.py b/executable_semantics/update_checks.py new file mode 100755 index 000000000000..e88a8705dc14 --- /dev/null +++ b/executable_semantics/update_checks.py @@ -0,0 +1,103 @@ +#!/usr/bin/env python3 + +"""Updates the CHECK: lines in lit tests based on the AUTOUPDATE line.""" + +__copyright__ = """ +Part of the Carbon Language project, under the Apache License v2.0 with LLVM +Exceptions. See /LICENSE for license information. +SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +""" + +from concurrent import futures +import os +import subprocess +import sys + +_BINDIR = "./bazel-bin/executable_semantics" +_TESTDATA = "executable_semantics/testdata" + +# TODO: Right now this is a static string used. In theory maybe we should use +# the command; it's included for that flexibility. +_AUTOUPDATE_MARKER = "// AUTOUPDATE: executable_semantics %s\n" + + +def _get_tests(): + """Get the list of tests from the filesystem.""" + tests = set() + for path in list(os.listdir(_TESTDATA)): + f = os.path.basename(path) + if f == "lit.cfg": + # Ignore the lit config. + continue + basename, ext = os.path.splitext(f) + if ext == ".carbon": + tests.add(basename) + else: + sys.exit("Unrecognized file type in testdata: %s" % f) + return tests + + +def _update_check(test): + """Updates the CHECK: lines for `test` by running executable_semantics.""" + test_file = "%s/%s.carbon" % (_TESTDATA, test) + with open(test_file) as f: + orig_lines = f.readlines() + if _AUTOUPDATE_MARKER not in orig_lines: + raise ValueError("No autoupdate marker in %s" % test_file) + # Run executable_semantics to general output. + # (`bazel run` would serialize) + p = subprocess.run( + ["%s/executable_semantics" % _BINDIR, test_file], + stdout=subprocess.PIPE, + stderr=subprocess.STDOUT, + ) + out = p.stdout.decode("utf-8") + + # `lit` uses full paths to the test file, so use a regex to ignore paths + # when used. + # TODO: Maybe revisit and see if lit can be convinced to give a + # root-relative path. + out = out.replace(test_file, "{{.*}}/%s.carbon" % test) + + # Remove old OUT. + lines_without_check = [ + x for x in orig_lines if not x.startswith("// CHECK:") + ] + autoupdate_index = lines_without_check.index(_AUTOUPDATE_MARKER) + assert autoupdate_index >= 0 + with open(test_file, "w") as f: + f.writelines(lines_without_check[: autoupdate_index + 1]) + f.writelines(["// CHECK: %s\n" % x for x in out.splitlines()]) + f.writelines(lines_without_check[autoupdate_index + 1 :]) + + print(".", end="", flush=True) + + +def _update_checks(): + """Runs bazel to update CHECK: lines in lit tests.""" + # TODO: It may be helpful if a list of tests can be passed in args; would + # want to use argparse for this. + tests = _get_tests() + + # Build all tests at once in order to allow parallel updates. + print("Building executable_semantics...") + subprocess.check_call(["bazel", "build", "//executable_semantics"]) + + print("Updating %d lit tests..." % len(tests)) + with futures.ThreadPoolExecutor() as exec: + # list() iterates to propagate exceptions. + list(exec.map(_update_check, tests)) + # Each update call indicates progress with a dot without a newline, so put a + # newline to wrap. + print("\nUpdated lit tests.") + + +def main(): + # Go to the repository root so that paths will match bazel's view. + os.chdir(os.path.join(os.path.dirname(__file__), "..")) + + _update_checks() + + +if __name__ == "__main__": + main()