Hello, I'm Kobe from South Korea, studying Swift and iOS.
I would like to run and test the swift/test/SILGen/closure.swift file.
I am curious about how I can test this file.
Thank you.
With sincerity, Kobe from Korea.
Hello, I'm Kobe from South Korea, studying Swift and iOS.
I would like to run and test the swift/test/SILGen/closure.swift file.
I am curious about how I can test this file.
Thank you.
With sincerity, Kobe from Korea.
Swift uses a test-suite utility from LLVM called lit
. The build sets things up so that lit
will pretend that the test directories in your source tree are overlaid on top of the corresponding directories in your build tree. That is, you can just pass lit
the path of a "file" in your build tree, and it will actually look for that test file in your source tree.
So:
$srcroot
; this is the directory with the swift
, llvm-project
, etc. subdirectories. There should be a subdirectory something like build/Ninja-ReleaseAssert/swift-macosx-x86_64
inside that; it might be slightly different depending on your system and how you've configured your build. That directory is your Swift build directory.lit
. This will be something like alias lit='$srcroot/llvm-project/llvm/utils/lit/lit.py'
.cd
into your Swift build directory.lit test-macosx-x86_64/SILGen/closure.swift
.Hello John, I'm Kobe.
I'm profoundly touched by your kind and detailed explanation.
Furthermore, I am delighted that your response resolved my issue.
I didn't expect such a detailed and friendly answer, but your genuine and comprehensive response has made my journey in studying iOS and Swift here a joyous experience.
I sincerely wish every day brings you happiness.
Thank you very much for your response.
With heartfelt thanks from Korea.
-Kobe-