{"id":19022852,"url":"https://github.com/llvm-swift/lite","last_synced_at":"2025-08-03T08:13:51.693Z","repository":{"id":47208339,"uuid":"112877398","full_name":"llvm-swift/Lite","owner":"llvm-swift","description":"A test runner for compiler-like Swift projects","archived":false,"fork":false,"pushed_at":"2021-11-21T21:40:07.000Z","size":53,"stargazers_count":11,"open_issues_count":2,"forks_count":3,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-08-01T22:50:10.102Z","etag":null,"topics":["compiler","lit","llvm","swift","test"],"latest_commit_sha":null,"homepage":null,"language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/llvm-swift.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":".github/CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-12-02T21:16:28.000Z","updated_at":"2021-10-07T17:20:00.000Z","dependencies_parsed_at":"2022-09-16T14:23:25.231Z","dependency_job_id":null,"html_url":"https://github.com/llvm-swift/Lite","commit_stats":null,"previous_names":[],"tags_count":15,"template":false,"template_full_name":null,"purl":"pkg:github/llvm-swift/Lite","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/llvm-swift%2FLite","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/llvm-swift%2FLite/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/llvm-swift%2FLite/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/llvm-swift%2FLite/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/llvm-swift","download_url":"https://codeload.github.com/llvm-swift/Lite/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/llvm-swift%2FLite/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":268512159,"owners_count":24261887,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-03T02:00:12.545Z","response_time":2577,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["compiler","lit","llvm","swift","test"],"created_at":"2024-11-08T20:27:55.688Z","updated_at":"2025-08-03T08:13:51.615Z","avatar_url":"https://github.com/llvm-swift.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Lite\n\nLite is a test runner for compiler-like Swift programs. It is structured\nsimilarly to LLVM's [`lit`](https://llvm.org/docs/CommandGuide/lit.html) except\nwith way fewer configuration options. Its advantage is being easily usable from\na Swift project.\n\n## Usage\n\nTo use `lite` as a testing tool, you'll need to add `Lite` as a dependency in\nyour `Package.swift` file.\n\n```swift\n.package(url: \"https://github.com/silt-lang/Lite.git\", from: \"0.0.1\")\n```\n\nThen, you'll need to add a target called `lite` to your Package.swift that\ndepends on the Lite support library, `LiteSupport`.\n\n```swift\n.target(name: \"lite\", dependencies: [\"LiteSupport\"])\n```\n\n### Making a `lite` Target\n\nFrom that target's `main.swift`, make a call to\n`runLite(substitutions:pathExtensions:testDirPath:testLinePrefix:parallelismLevel:)`. This call\nis the main entry point to `lite`'s test running.\n\nIt takes 5 arguments:\n\n| Argument | Description |\n|----------|-------------|\n| `substitutions` | The mapping of substitutions to make inside each run line. A substitution looks for a string beginning with `'%'` and replaces that whole string with the substituted value. |\n| `pathExtensions` | The set of path extensions that Lite should search for when discovering tests. |\n| `testDirPath`  | The directory in which Lite should look for tests. Lite will perform a deep search through this directory for all files whose extension exists in `pathExtensions` and which have valid RUN lines. |\n| `testLinePrefix` | The prefix before `RUN:` in a file. This is almost always your specific langauge's line comment syntax. |\n| `parallelismLevel` | Specifies the amount of parallelism to apply to the test running process. Default value is `.none`, but you can provide `.automatic` to use the available machine cores, or `.explicit(n)` to specify an explicit number of parallel tests |\n\n\u003e Note: An example consumer of `Lite` exists in this repository as `lite-test`.\n\nOnce you've defined that, you're ready to start running your tester!\n\nYou can run it standalone or via CI using:\n\n```bash\nswift run lite\n```\n\n### Defining Tests\n\nLite tests are expressed as `bash` shell commands written inside comments\nin your source file (usually at the top).\n\nThese commands can be very simple:\n\n```\n// RUN: %my-prog %s\n```\n\nOr very complex:\n\n```\n// RUN: %my-prog %s --arg1 foo --directory %T --output-file %t \u0026\u0026 diff %T/foo.out %t\n```\n\nYou can also have multiple `RUN` lines in one file, which will all use the same\nset of substitutions.\n\nLite comes with 4 standard substitutions:\n\n| Substitution | Value |\n|--------------|-------|\n| `%s` | The current source file path, quoted. |\n| `%S` | The directory in which the current source file resides, quoted. |\n| `%T` | A temporary directory which will be created when substituted. |\n| `%t` | A temporary file (multiple `%t`s will reference the same file), in the directory specified with `%T`, quoted. |\n\n## Author\n\nHarlan Haskins ([@harlanhaskins](https://github.com/harlanhaskins))\n\nRobert Widmann ([@codafi](https://github.com/codafi))\n\n## License\n\nThis project is released under the MIT license, a copy of which is avaialable\nin this repository.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fllvm-swift%2Flite","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fllvm-swift%2Flite","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fllvm-swift%2Flite/lists"}