Test Suite by TheRustifyer · Pull Request #22 · zerodaycode/Zero · GitHub
Skip to content

Test Suite - #22

Merged
TheRustifyer merged 7 commits into
zerodaycode:mainfrom
TheRustifyer:main
Jul 25, 2023
Merged

TheRustifyer merged 7 commits into
zerodaycode:mainfrom
TheRustifyer:main

Conversation

@TheRustifyer

@TheRustifyer TheRustifyer commented Jul 9, 2023 •

Copy link
Copy Markdown
Member

Zero - test_suite - Very initial implementation of a own test suite, to stop to depend on third party implementations due to our constraints of use the latest C++ features.

The main reason behind this is due to the issues detected with Clang version >= 16 and Catch2, since it's imposible to build Catch2 with Clang. Instead of waiting them for fix this, we will implement our test suite from scratch.

Initially, we have:

  • Test Suite -> Common structure for handle related test cases
  • Test Case -> A particular user-defined code that will be the testing object
  • Test Results -> Structure for hold the results of different suites and the free test cases (There's still a very initial implementation, warnings are not handled by them)
  • Assertions -> Only implemented assertEquals and assertNotEquals. We are in a very initial state, so it's fine to test our development workflow right now

Color features: Added some different colors to the terminal output, related by action. This should be completly refactored into their own feature, but due to the incoming std::print and std::format (that won't be usable until LLVM's 17 version, I don't know how to exactly proceed, because printing coloured strings could be done with the planned custom string implementation that we have planned, or just concatenating the color ANSI codes... hard to tell now. But we can think in such a feature in different ways

Update: Waiting for #23 to remove from the code the ANSI codes, since a formatter and a stylizer is ready to be merged to upstream.

…to stop to depend on third party implementations due to our constraints of use the latest C++ features.

Initially, we have:
- Test Suite -> Common structure for handle related test cases
- Test Case  -> A particular user-defined code that will be the testing object
- Test Results -> Structure for hold the results of different suites and the free test cases (There's still a very initial implementation, warnings are not handled by them)
- Assertions -> Only implemented `assertEquals`. We are in a very initial state, so it's fine to test our development workflow right now

Color features: Added some different colors to the terminal output, related by action. This should be completly refactored into their own feature, but due to the incoming std::print and std::format (that won't be usable until LLVM's 17 version, I don't know how to exactly proceed, because printing coloured strings could be done with the planned custom string implementation that we have planned, or just concatenating the color ANSI codes... hard to tell now. But we can think in such a feature in different ways
@TheRustifyer
TheRustifyer requested review from 0nSystem and gbm25 July 9, 2023 12:57
@TheRustifyer TheRustifyer self-assigned this Jul 9, 2023
@TheRustifyer
TheRustifyer marked this pull request as draft July 9, 2023 12:59
…the tracker. Declaring the suite library to the rest of the zork.conf(s)
…st suites now stores pointers to the targets, and we are able to avoid with this change the `arithmetic on a pointer to an incomplete type`, letting them on the top-level of the module. This will be useful when we split the components into their module partitions
…TestSuite and TestCase defined constructors
1. Assertions have now their own module
2. Deleted the default constructor for the test suites. A identifier must be generated always by the user
1. The suite results are now a member of the `Test Suite` type
2. More format and colours
3. Reorganized the Zork's configuration files
1. Generated a README.md for the `test-suite`
2. `assertNotEquals` standalone functions created
@TheRustifyer
TheRustifyer marked this pull request as ready for review July 22, 2023 11:32
@TheRustifyer

Copy link
Copy Markdown
Member Author

@TheRustifyer
TheRustifyer merged commit 48fdaf3 into zerodaycode:main Jul 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant