Skip to content

Commit

Permalink
Add a test feature 'swift_ast_verifier'
Browse files Browse the repository at this point in the history
  • Loading branch information
gribozavr committed Dec 1, 2015
1 parent e15132a commit 4f8773f
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 1 deletion.
4 changes: 3 additions & 1 deletion docs/Testing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,9 @@ use this pattern::
Features for ``REQUIRES`` and ``XFAIL``
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

FIXME: list.
FIXME: full list.

* ``swift_ast_verifier``: present if the AST verifier is enabled in this build.

When writing a test specific to x86, if possible, prefer ``REQUIRES:
CPU=i386_or_x86_64`` to ``REQUIRES: CPU=x86_64``.
Expand Down
1 change: 1 addition & 0 deletions test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@ if(PYTHONINTERP_FOUND)
# Normalize spelling of boolean values.
normalize_boolean_spelling(LLVM_ENABLE_ASSERTIONS)
normalize_boolean_spelling(SWIFT_STDLIB_ASSERTIONS)
normalize_boolean_spelling(SWIFT_AST_VERIFIER)
normalize_boolean_spelling(SWIFT_ASAN_BUILD)

# A directory where to put the xUnit-style XML test results.
Expand Down
3 changes: 3 additions & 0 deletions test/lit.site.cfg.in
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ if "@SWIFT_STDLIB_ASSERTIONS@" == "TRUE":
else:
config.available_features.add('swift_stdlib_no_asserts')

if "@SWIFT_AST_VERIFIER@" == "TRUE":
config.available_features.add('swift_ast_verifier')

if "@SWIFT_OPTIMIZED@" == "TRUE":
config.available_features.add("optimized_stdlib")

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
// RUN: not --crash %target-swift-frontend %s -parse

// This test fails in the AST verifier, which can be turned off.
// REQUIRES: swift_ast_verifier

// Distributed under the terms of the MIT license
// Test case submitted to project by https://github.com/practicalswift (practicalswift)
// Test case found by fuzzing
Expand Down

0 comments on commit 4f8773f

Please sign in to comment.