{"id":17053700,"url":"https://github.com/kareman/testcommit","last_synced_at":"2026-04-16T18:08:33.770Z","repository":{"id":66894305,"uuid":"87336493","full_name":"kareman/testcommit","owner":"kareman","description":"Locally test the latest commit to a software project. Supports Swift Package Manager and make.","archived":false,"fork":false,"pushed_at":"2017-04-28T17:59:23.000Z","size":22,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-23T05:26:10.387Z","etag":null,"topics":["command-line-tool","swift","swift3","testing-tools"],"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/kareman.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-04-05T17:16:09.000Z","updated_at":"2021-04-11T05:49:30.000Z","dependencies_parsed_at":"2023-05-13T02:30:31.575Z","dependency_job_id":null,"html_url":"https://github.com/kareman/testcommit","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/kareman/testcommit","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kareman%2Ftestcommit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kareman%2Ftestcommit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kareman%2Ftestcommit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kareman%2Ftestcommit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kareman","download_url":"https://codeload.github.com/kareman/testcommit/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kareman%2Ftestcommit/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265871991,"owners_count":23842113,"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","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":["command-line-tool","swift","swift3","testing-tools"],"created_at":"2024-10-14T10:13:01.040Z","updated_at":"2026-04-16T18:08:28.734Z","avatar_url":"https://github.com/kareman.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"![Platforms](https://img.shields.io/badge/platforms-macOS%20%7C%20Linux-lightgrey.svg)\n\n# testcommit\n\nLocally test the latest commit to a software project. Supports Swift Package Manager and `make`.\n\nThis is mostly made as a demonstration of how to use [SwiftShell](https://github.com/kareman/SwiftShell) and [FileSmith](https://github.com/kareman/FileSmith). Especially this part:\n\n```swift\nif testdir.contains(\"Package.swift\") {\n\t// Use the version of Swift defined in \".swift-version\".\n\t// If that file does not exist, or that version is not installed, use the system default.\n\tlet dotversion = cleanctx.run(\"cat\", \".swift-version\").stdout\n\tlet fullversion = dotversion.characters.count \u003e 8 ? dotversion : dotversion + \"-RELEASE\"\n\tcleanctx.env[\"TOOLCHAINS\"] = (\n\t\tcleanctx.run(\"defaults\", \"read\", \"/Library/Developer/Toolchains/swift-\\(fullversion).xctoolchain/Info\", \"CFBundleIdentifier\")\n\t\t|| cleanctx.run(\"echo\", \"swift\")\n\t\t).stdout\n\n\ttry cleanctx.runAndPrint(\"swift\",\"build\")\n\n\t// If there are any unit tests, run them.\n\tlet packagedescription = cleanctx.run(\"swift\", \"package\", \"describe\")\n\tif packagedescription.succeeded {\n\t\tif packagedescription.stdout.contains(\"Test module: true\") {\n\t\t\ttry cleanctx.runAndPrint(\"swift\", \"test\")\n\t\t}\n\t} else { // Swift \u003c 3.1\n\t\tlet runtests = cleanctx.run(\"swift\", \"test\")\n\t\tif let error = runtests.error {\n\t\t\tif !runtests.stderror.contains(\"no tests found to execute\") {\n\t\t\t\tmain.stderror.write(runtests.stderror) // \"swift test\" prints results to stderror.\n\t\t\t\tthrow error\n\t\t\t}\n\t\t} else {\n\t\t\tmain.stderror.write(runtests.stderror)\n\t\t}\n\t}\n}\n```\n\n## Installation\n\n```bash\ngit clone https://github.com/kareman/testcommit\ncd testcommit\nswift build -c release\ncp .build/release/testcommit /usr/local/bin/testcommit\n```\n\n## License\n\nReleased under the MIT License (MIT), http://opensource.org/licenses/MIT\n\nKåre Morstøl, [NotTooBad Software](http://nottoobadsoftware.com)\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkareman%2Ftestcommit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkareman%2Ftestcommit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkareman%2Ftestcommit/lists"}