{"repo":"deftio/C-and-Cpp-Tests-with-CI-CD-Example","free":true,"listed":false,"github":"https://github.com/deftio/C-and-Cpp-Tests-with-CI-CD-Example","clone":"git clone https://github.com/deftio/C-and-Cpp-Tests-with-CI-CD-Example.git","description":"C/C++ example project for CI testing with Github Actions, Coverage, and Build badges","language":"C","stars":53,"topics":["badge","build-pipelines","continuous-integration","testing","testing-framework","unit-testing","cpp","c-plus-plus","c","cicd"],"license":"BSD-2-Clause","category":"deployment-docker-iac","readme_excerpt":"C/C++ Testing with CI/CD Example A quick overview of testing C/C++ code, covering basic unit tests to continuous integration. In this repo we'll go through concepts such as unit testing and coverage to CI with a simple working example. What's In This Repository This repository shows testing concepts using a simple C library. We'll explore: - Unit testing basics - Code coverage and what it tells us - Test-driven development concepts - Continuous integration with GitHub Actions - How these pieces fit together in practice Project Structure Getting Started with Testing Why Test? When we write a function, we usually run it a few times manually to check it works. Testing just formalizes this process. Instead of manual checks, we write code that does the checking for us. Testing helps us understand: - Does it work? - Does the code do what we intended? - Does it handle edge cases? - What about negative numbers? Zero? Maximum values? (or even more complex inputs) - Will it keep working? - When we change other code, did we break this? - Is it completely tested? - Did we miss any scenarios? A Simple Test Example Let's look at a basic test. In this repo we have a small math operations library. Here's one of our library functions: To test this, we write a function that calls our function in dedicated test program: This is a test! It's simple but powerful: - It calls the function with known inputs - It checks if the output is correct - It reports success or failure Chapter 3: Testing All P","default_branch":null,"files":null,"tree":[],"storefront":"/r/deftio","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/deftio/C-and-Cpp-Tests-with-CI-CD-Example/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}