Skip to content

Use Catch2 for testing proper installation and linking of C++ libraries installed through task #43

@coderabbitai

Description

@coderabbitai

Background

The current approach for testing C++ libraries installed through task (e.g., Boost in PR #42) uses custom C++ programs with manual validation logic and error handling.

For example, in taskfiles/boost/test_boost.cpp, the current implementation:

  • Uses a custom main function with manual command-line argument parsing
  • Implements individual test functions that return boolean success/failure
  • Manually tracks and reports different error codes for various test failures

Proposal

Replace the current custom testing approach with Catch2, a modern C++ test framework that would provide:

  • Simpler test declarations with REQUIRE/CHECK macros
  • Automatic test registration and discovery
  • Better test output with clear failure messages
  • Test sections and fixtures for better organization
  • Built-in command-line parser with test filtering options
  • Seamless integration with CI systems and test report generation
  • Reduced boilerplate code

Implementation Steps

  1. Add a task to download and install Catch2 (similar to how Boost is installed)
  2. Update the test C++ programs to use Catch2's test macros and framework
  3. Modify the task running the tests to capture and report Catch2 test results
  4. Consider adding this as a standard approach for all C++ library testing tasks

This would standardize testing across all C++ libraries and make it easier to add new tests in the future.

References

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions