Giter Club home page Giter Club logo

patatedu609 / clarity Goto Github PK

View Code? Open in Web Editor NEW
0.0 0.0 0.0 17 KB

CLarity is a lightweight unit testing library for C and C++ projects, designed to be easy to use and cross-platform. It provides a simple and intuitive API for defining and running tests, and supports both static and shared library builds. CLarity is perfect for any project looking to implement unit testing, regardless of its size or complexity.

CMake 4.79% C 95.21%

clarity's Introduction

Hi there ๐Ÿ‘‹

LinkedIn

  • ๐Ÿ”ญ Iโ€™m currently working as a Backend Developer
  • ๐ŸŒฑ Iโ€™m currently improving my skills in C
  • ๐Ÿ“ซ How to reach me: [email protected]

Github Streak

clarity's People

Contributors

patatedu609 avatar

Watchers

 avatar

clarity's Issues

Create library for managing processes

Create a library to manage multiple processes for executing test suites. This library should provide the following features:

  • Spawn processes to execute test suites
  • Manage process groups to execute multiple test suites concurrently
  • Proper signal handling for interrupting and terminating processes
  • Manage process output to redirect test outputs to the main process to print them all at once

Tasks

  • Design the API for the library
  • Implement the API for spawning processes and managing process groups
  • Implement signal handling
  • Implement process output management
  • Write tests to ensure the library works as expected
  • Document the library and provide examples for usage

Initialize project and set up basic directory structure

As a developer, I want to create a basic project structure for the CLarity library and set up the necessary directories for source files, include files, tests, and build artifacts. This will allow me to start writing the code for the library and the test suite.

Tasks

  • Create the project in CLion
  • Create a basic directory structure for the project
  • Initialize a git repository and make the first commit
  • Push the initial commit to the remote repository on GitHub

Implement basic test cases

This issue involves creating a set of basic test cases that can be used to test the functionality of the test runner. The test cases should cover basic scenarios, such as testing simple arithmetic operations or testing the behavior of basic data structures.

Tasks

  • Create a set of basic test cases
  • Ensure the test cases cover basic scenarios
  • Ensure the test cases can be loaded and run by the test runner

Implement basic test runner

This issue involves creating a basic test runner that can load and run simple test cases. The test runner should be able to report on the number of tests run, the number of successful tests, and the number of failed tests.

Tasks

  • Implement a basic test runner that can load and run simple test cases
  • Implement output to report on the number of tests run, the number of successful tests, and the number of failed tests

Implement Multi-Process Suite Runner

This issue aims to implement the multi-process suite runner for the test framework. This will allow the test runner to run tests in multiple processes in order to speed up the testing process.

Tasks

  • Implement the multi-process suite runner
  • Add support for configuration options to specify the number of processes to use
  • Implement a mechanism to manage test results from multiple processes
  • Ensure that test results are reported correctly even when tests are run in multiple processes

Acceptance Criteria

  • The multi-process suite runner is implemented and functional
  • The test framework can run tests in multiple processes
  • The number of processes can be configured using a configuration option
  • Test results from multiple processes are managed correctly and reported accurately

Implement argument parsing from command line

Currently, Clarity only supports running all test suites at once. However, it would be useful to be able to run a single test suite or a single test case from the command line.

Expected Behavior

Users should be able to specify a single test suite or a single test case to run from the command line. For example, the following command should run the my_suite test suite:

./out --suite my_suite

And the following command should run the my_test test case within the my_suite test suite:

./out --suite my_suite --case my_test

Proposed Solution

To implement this feature, we will add support for specifying a test suite or a test case as a command line argument. If a test suite is specified, we will run all the tests in that suite. If a test case is specified, we will only run that test case.

To specify a test suite or a test case, users can provide the name of the suite or case as a command line argument. To avoid conflicts with other command line arguments, we will use a special syntax for specifying test suites and test cases. Here are the proposed syntaxes:

  • To specify a test suite: -s <suite_name> or --suite <suite_name>
  • To specify a test case: -c <case_name> or --case <case_name>

If no suite or case is specified, we will run all test suites as usual.

Additional Notes

  • If a suite or case is specified and it is not found, Clarity should print an error message and exit.
  • If both a suite and a case are specified, we will ignore the case and only run the suite.
  • If a case is specified, but not the suite it belongs to, Clarity should search for the suite that contains the case and run only that suite with the specified case. If there is a conflict, ie. two suites have a test case with the exact same name, both will be run.
  • We should add support for these new options to the Clarity documentation and help message.

Implement fixtures support

We need to implement fixtures to support the setup and teardown of test environments. This will allow us to have more control over the state of the system before and after tests are run, and help with code reusability.

Acceptance criteria

  • A fixture system is implemented and integrated with the existing codebase
  • Fixtures can be defined and used in tests by calling appropriate functions
  • The fixture system is well-documented and easy to understand
  • Tests using fixtures are passing and integrated with the test runner

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.