{"id":29122348,"url":"https://github.com/achanandhi-m/unit-test-generator","last_synced_at":"2026-04-16T03:33:18.968Z","repository":{"id":301689404,"uuid":"1010028983","full_name":"Achanandhi-M/unit-test-generator","owner":"Achanandhi-M","description":"Automagically generate Google Test unit tests for your C++ code with AI! This tool uses Ollama's AI models to create comprehensive test cases that actually compile and pass with good coverage.","archived":false,"fork":false,"pushed_at":"2025-06-28T07:47:36.000Z","size":0,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-06-28T08:30:42.169Z","etag":null,"topics":["cpp","golang","ollama","qwen2-5"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Achanandhi-M.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":null,"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,"zenodo":null}},"created_at":"2025-06-28T07:31:07.000Z","updated_at":"2025-06-28T07:47:39.000Z","dependencies_parsed_at":"2025-06-28T08:41:27.403Z","dependency_job_id":null,"html_url":"https://github.com/Achanandhi-M/unit-test-generator","commit_stats":null,"previous_names":["achanandhi-m/unit-test-generator"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Achanandhi-M/unit-test-generator","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Achanandhi-M%2Funit-test-generator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Achanandhi-M%2Funit-test-generator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Achanandhi-M%2Funit-test-generator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Achanandhi-M%2Funit-test-generator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Achanandhi-M","download_url":"https://codeload.github.com/Achanandhi-M/unit-test-generator/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Achanandhi-M%2Funit-test-generator/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262632336,"owners_count":23340218,"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":["cpp","golang","ollama","qwen2-5"],"created_at":"2025-06-29T17:12:40.729Z","updated_at":"2026-04-16T03:33:18.923Z","avatar_url":"https://github.com/Achanandhi-M.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Unit Test Generator\n\nA tool that automatically generates unit tests for C++ code using Ollama's AI models and Google Test framework.\n\n## Features\n\n- Generates Google Test unit tests for C++ code\n- Validates generated tests by compiling and running them\n- Measures code coverage and enforces minimum thresholds\n- Supports both header (.h) and implementation (.cpp) files\n- Works with Ollama's local AI models\n\n## Prerequisites\n\n- [Go](https://golang.org/dl/) (1.20+ recommended)\n- [Ollama](https://ollama.ai/) installed and running\n- C++ compiler (g++ or clang++)\n- Google Test installed\n- gcov for coverage analysis\n\n## Installation\n\n1. Clone this repository:\n   ```bash\n   git clone https://github.com/yourusername/unit-test-generator.git\n   cd unit-test-generator\n   ```\n\n2. Install dependencies:\n   ```bash\n   go mod download\n   ```\n\n3. Pull the required Ollama model:\n   ```bash\n   ollama pull qwen2.5-coder:7b\n   ```\n\n## Usage\n\n1. Place your C++ code in the `codebase` directory (both .h and .cpp files)\n\n2. Run the generator:\n   ```bash\n   go run main.go\n   ```\n\n3. Generated tests will be saved in the `tests` directory\n\n## Configuration\n\n### Environment Variables\n\n- `OLLAMA_HOST`: URL of Ollama server (default: `http://localhost:11434`)\n\n### Directory Structure\n\n```\nunit-test-generator/\n├── codebase/       # Your C++ source files go here\n├── tests/          # Generated unit tests will be saved here\n├── go.mod\n├── go.sum\n└── main.go         # Main application code\n```\n\n## Made with ❤️ and too much debugging\n\n## Demo\n\n\nhttps://github.com/user-attachments/assets/404a1573-6b6d-48e7-a7de-9e7c605aa3c2\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fachanandhi-m%2Funit-test-generator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fachanandhi-m%2Funit-test-generator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fachanandhi-m%2Funit-test-generator/lists"}