mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-05 22:02:55 +01:00
Automate the addition of RUN and simplify RUN lines (#2292)
This was an offshoot of the discussion about how much boilerplate we could remove. lit requires RUN lines be there, everything else is optional.
This commit is contained in:
+2
-2
@@ -2,8 +2,8 @@
|
||||
// Exceptions. See /LICENSE for license information.
|
||||
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
||||
//
|
||||
// RUN: %{carbon} dump parse-tree %s | %{FileCheck-strict} %s
|
||||
// AUTOUPDATE: %{carbon} dump parse-tree %s
|
||||
// AUTOUPDATE
|
||||
// RUN: %{carbon-run-parser}
|
||||
// CHECK:STDOUT: [
|
||||
// CHECK:STDOUT: {node_index: 0, kind: 'FileEnd', text: ''},
|
||||
// CHECK:STDOUT: ]
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
// Exceptions. See /LICENSE for license information.
|
||||
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
||||
//
|
||||
// RUN: %{carbon} dump parse-tree %s | %{FileCheck-strict} %s
|
||||
// AUTOUPDATE: %{carbon} dump parse-tree %s
|
||||
// AUTOUPDATE
|
||||
// RUN: %{carbon-run-parser}
|
||||
// CHECK:STDOUT: [
|
||||
// CHECK:STDOUT: {node_index: 0, kind: 'EmptyDeclaration', text: ';'},
|
||||
// CHECK:STDOUT: {node_index: 1, kind: 'FileEnd', text: ''},
|
||||
|
||||
+5
-5
@@ -2,8 +2,8 @@
|
||||
// Exceptions. See /LICENSE for license information.
|
||||
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
||||
//
|
||||
// RUN: %{not} %{carbon} dump parse-tree %s | %{FileCheck-strict} %s
|
||||
// AUTOUPDATE: %{carbon} dump parse-tree %s
|
||||
// AUTOUPDATE
|
||||
// RUN: %{not} %{carbon-run-parser}
|
||||
// CHECK:STDOUT: [
|
||||
// CHECK:STDOUT: {node_index: 15, kind: 'FunctionDeclaration', text: 'fn', subtree_size: 16, children: [
|
||||
// CHECK:STDOUT: {node_index: 0, kind: 'DeclaredName', text: 'F'},
|
||||
@@ -26,10 +26,10 @@
|
||||
|
||||
// NOTE: Move to its own directory when more tests are added.
|
||||
fn F() {
|
||||
// CHECK:STDERR: {{.*}}/toolchain/parser/testdata/basics/invalid_designators.carbon:[[@LINE+1]]:5: Expected identifier after `.`.
|
||||
// CHECK:STDERR: {{.*}}/toolchain/parser/testdata/basics/fail_invalid_designators.carbon:[[@LINE+1]]:5: Expected identifier after `.`.
|
||||
a.;
|
||||
// CHECK:STDERR: {{.*}}/toolchain/parser/testdata/basics/invalid_designators.carbon:[[@LINE+1]]:5: Expected identifier after `.`.
|
||||
// CHECK:STDERR: {{.*}}/toolchain/parser/testdata/basics/fail_invalid_designators.carbon:[[@LINE+1]]:5: Expected identifier after `.`.
|
||||
a.fn;
|
||||
// CHECK:STDERR: {{.*}}/toolchain/parser/testdata/basics/invalid_designators.carbon:[[@LINE+1]]:5: Expected identifier after `.`.
|
||||
// CHECK:STDERR: {{.*}}/toolchain/parser/testdata/basics/fail_invalid_designators.carbon:[[@LINE+1]]:5: Expected identifier after `.`.
|
||||
a.42;
|
||||
}
|
||||
+3
-3
@@ -2,12 +2,12 @@
|
||||
// Exceptions. See /LICENSE for license information.
|
||||
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
||||
//
|
||||
// RUN: %{not} %{carbon} dump parse-tree %s | %{FileCheck-strict} %s
|
||||
// AUTOUPDATE: %{carbon} dump parse-tree %s
|
||||
// AUTOUPDATE
|
||||
// RUN: %{not} %{carbon-run-parser}
|
||||
// CHECK:STDOUT: [
|
||||
// CHECK:STDOUT: {node_index: 0, kind: 'EmptyDeclaration', text: ';', has_error: yes},
|
||||
// CHECK:STDOUT: {node_index: 1, kind: 'FileEnd', text: ''},
|
||||
// CHECK:STDOUT: ]
|
||||
|
||||
// CHECK:STDERR: {{.*}}/toolchain/parser/testdata/basics/no_intro_with_semi.carbon:[[@LINE+1]]:1: Unrecognized declaration introducer.
|
||||
// CHECK:STDERR: {{.*}}/toolchain/parser/testdata/basics/fail_no_intro_with_semi.carbon:[[@LINE+1]]:1: Unrecognized declaration introducer.
|
||||
foo;
|
||||
+3
-3
@@ -2,11 +2,11 @@
|
||||
// Exceptions. See /LICENSE for license information.
|
||||
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
||||
//
|
||||
// RUN: %{not} %{carbon} dump parse-tree %s | %{FileCheck-strict} %s
|
||||
// AUTOUPDATE: %{carbon} dump parse-tree %s
|
||||
// AUTOUPDATE
|
||||
// RUN: %{not} %{carbon-run-parser}
|
||||
// CHECK:STDOUT: [
|
||||
// CHECK:STDOUT: {node_index: 0, kind: 'FileEnd', text: ''},
|
||||
// CHECK:STDOUT: ]
|
||||
|
||||
// CHECK:STDERR: {{.*}}/toolchain/parser/testdata/basics/no_intro_without_semi.carbon:[[@LINE+1]]:1: Unrecognized declaration introducer.
|
||||
// CHECK:STDERR: {{.*}}/toolchain/parser/testdata/basics/fail_no_intro_without_semi.carbon:[[@LINE+1]]:1: Unrecognized declaration introducer.
|
||||
foo bar baz
|
||||
+5
-5
@@ -2,8 +2,8 @@
|
||||
// Exceptions. See /LICENSE for license information.
|
||||
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
||||
//
|
||||
// RUN: %{not} %{carbon} dump parse-tree %s | %{FileCheck-strict} %s
|
||||
// AUTOUPDATE: %{carbon} dump parse-tree %s
|
||||
// AUTOUPDATE
|
||||
// RUN: %{not} %{carbon-run-parser}
|
||||
// CHECK:STDOUT: [
|
||||
// CHECK:STDOUT: {node_index: 4, kind: 'VariableDeclaration', text: 'var', has_error: yes, subtree_size: 5, children: [
|
||||
// CHECK:STDOUT: {node_index: 3, kind: 'VariableInitializer', text: '=', subtree_size: 4, children: [
|
||||
@@ -13,7 +13,7 @@
|
||||
// CHECK:STDOUT: {node_index: 5, kind: 'FileEnd', text: ''},
|
||||
// CHECK:STDOUT: ]
|
||||
|
||||
// CHECK:STDERR: {{.*}}/toolchain/parser/testdata/basics/paren_match_regression.carbon:[[@LINE+3]]:5: Expected pattern in `var` declaration.
|
||||
// CHECK:STDERR: {{.*}}/toolchain/parser/testdata/basics/paren_match_regression.carbon:[[@LINE+2]]:12: Expected `,` or `)`.
|
||||
// CHECK:STDERR: {{.*}}/toolchain/parser/testdata/basics/paren_match_regression.carbon:[[@LINE+1]]:15: Expected `;` after expression.
|
||||
// CHECK:STDERR: {{.*}}/toolchain/parser/testdata/basics/fail_paren_match_regression.carbon:[[@LINE+3]]:5: Expected pattern in `var` declaration.
|
||||
// CHECK:STDERR: {{.*}}/toolchain/parser/testdata/basics/fail_paren_match_regression.carbon:[[@LINE+2]]:12: Expected `,` or `)`.
|
||||
// CHECK:STDERR: {{.*}}/toolchain/parser/testdata/basics/fail_paren_match_regression.carbon:[[@LINE+1]]:15: Expected `;` after expression.
|
||||
var = (foo {})
|
||||
+2
-2
@@ -2,8 +2,8 @@
|
||||
// Exceptions. See /LICENSE for license information.
|
||||
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
||||
//
|
||||
// RUN: %{carbon} dump parse-tree %s | %{FileCheck-strict} %s
|
||||
// AUTOUPDATE: %{carbon} dump parse-tree %s
|
||||
// AUTOUPDATE
|
||||
// RUN: %{carbon-run-parser}
|
||||
// CHECK:STDOUT: [
|
||||
// CHECK:STDOUT: {node_index: 24, kind: 'FunctionDeclaration', text: 'fn', subtree_size: 25, children: [
|
||||
// CHECK:STDOUT: {node_index: 0, kind: 'DeclaredName', text: 'F'},
|
||||
|
||||
+2
-2
@@ -2,8 +2,8 @@
|
||||
// Exceptions. See /LICENSE for license information.
|
||||
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
||||
//
|
||||
// RUN: %{carbon} dump parse-tree %s | %{FileCheck-strict} %s
|
||||
// AUTOUPDATE: %{carbon} dump parse-tree %s
|
||||
// AUTOUPDATE
|
||||
// RUN: %{carbon-run-parser}
|
||||
// CHECK:STDOUT: [
|
||||
// CHECK:STDOUT: {node_index: 3, kind: 'PackageDirective', text: 'package', subtree_size: 4, children: [
|
||||
// CHECK:STDOUT: {node_index: 0, kind: 'DeclaredName', text: 'Geometry'},
|
||||
|
||||
+2
-2
@@ -2,8 +2,8 @@
|
||||
// Exceptions. See /LICENSE for license information.
|
||||
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
||||
//
|
||||
// RUN: %{carbon} dump parse-tree %s | %{FileCheck-strict} %s
|
||||
// AUTOUPDATE: %{carbon} dump parse-tree %s
|
||||
// AUTOUPDATE
|
||||
// RUN: %{carbon-run-parser}
|
||||
// CHECK:STDOUT: [
|
||||
// CHECK:STDOUT: {node_index: 13, kind: 'FunctionDeclaration', text: 'fn', subtree_size: 14, children: [
|
||||
// CHECK:STDOUT: {node_index: 0, kind: 'DeclaredName', text: 'F'},
|
||||
|
||||
+2
-2
@@ -2,8 +2,8 @@
|
||||
// Exceptions. See /LICENSE for license information.
|
||||
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
||||
//
|
||||
// RUN: %{carbon} dump parse-tree %s | %{FileCheck-strict} %s
|
||||
// AUTOUPDATE: %{carbon} dump parse-tree %s
|
||||
// AUTOUPDATE
|
||||
// RUN: %{carbon-run-parser}
|
||||
// CHECK:STDOUT: [
|
||||
// CHECK:STDOUT: {node_index: 26, kind: 'VariableDeclaration', text: 'var', subtree_size: 27, children: [
|
||||
// CHECK:STDOUT: {node_index: 12, kind: 'PatternBinding', text: ':', subtree_size: 13, children: [
|
||||
|
||||
+2
-2
@@ -2,8 +2,8 @@
|
||||
// Exceptions. See /LICENSE for license information.
|
||||
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
||||
//
|
||||
// RUN: %{carbon} dump parse-tree %s | %{FileCheck-strict} %s
|
||||
// AUTOUPDATE: %{carbon} dump parse-tree %s
|
||||
// AUTOUPDATE
|
||||
// RUN: %{carbon-run-parser}
|
||||
// CHECK:STDOUT: [
|
||||
// CHECK:STDOUT: {node_index: 14, kind: 'VariableDeclaration', text: 'var', subtree_size: 15, children: [
|
||||
// CHECK:STDOUT: {node_index: 6, kind: 'PatternBinding', text: ':', subtree_size: 7, children: [
|
||||
|
||||
+2
-2
@@ -2,8 +2,8 @@
|
||||
// Exceptions. See /LICENSE for license information.
|
||||
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
||||
//
|
||||
// RUN: %{carbon} dump parse-tree %s | %{FileCheck-strict} %s
|
||||
// AUTOUPDATE: %{carbon} dump parse-tree %s
|
||||
// AUTOUPDATE
|
||||
// RUN: %{carbon-run-parser}
|
||||
// CHECK:STDOUT: [
|
||||
// CHECK:STDOUT: {node_index: 6, kind: 'VariableDeclaration', text: 'var', subtree_size: 7, children: [
|
||||
// CHECK:STDOUT: {node_index: 2, kind: 'PatternBinding', text: ':', subtree_size: 3, children: [
|
||||
|
||||
Reference in New Issue
Block a user