[swift-dev] How do you run individual tests?

Michael Buckley michael at buckleyisms.com
Sat Dec 5 18:56:07 CST 2015


Hi,

I have successfully run the swift test suites by passing the -T flag to
utils/build_script, and I am wondering if there is any way to run an
individual test by name, or even just run a single file.

Forgive me if the answer to this question is already documented somewhere.
I have read through all the documentation I could find in the git
repository, and checked out the lit documentation on llvm.org.

As a concrete example, let's say I added a test
to validation-test/stdlib/UnicodeTrie.swift.gyb, and I'm doing test-first
development, so I expect this test to fail until I implement the fix for
it. I now want to run just this test to ensure that it does indeed fail.

The lyt documentation seems to indicate that I can pass it a filename to
test, but when I point it to that file, it states that it can only test
files in a build directory, and I cannot find this file in the build
directory. Additionally, docs/Testing.rst mentions that tests can be run
using the check-swift* tools in the build directory, but I cannot find
these tools in the build directory.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-dev/attachments/20151205/cb70cdb6/attachment.html>


More information about the swift-dev mailing list