MIT License

项目介绍

Snaipe/Criterion 是一个托管在 GitHub 上的开源项目,主要使用 C 编写,采用 MIT License 许可证,目前获得 2.3k 个 Star、192 次 Fork。

仓库全名
Snaipe/Criterion
开源许可证
MIT License
Star 数
2.3k
Fork 数
192
未关闭 Issue
56

README 摘要

A dead-simple, yet extensible, C and C++ unit testing framework. Philosophy Most test frameworks for C require a lot of boilerplate code to set up tests and test suites -- you need to create a main, then register new test suites, then register the tests within these suites, and finally call the right functions. This gives the user great control, at the unfortunate cost of simplicity. Criterion follows the KISS…

完整内容见 GitHub 原始 README 或本页 。

常见问题

Criterion 用什么语言开发?

主要使用 C 编写,采用 MIT License 许可证,目前有 2.3k 个 Star。

Criterion 可以免费商用吗?

仓库采用 MIT License 许可证,可免费使用与修改,商业使用请遵守许可证条款(例如保留版权声明与许可声明)。

如何获取 Criterion 的源码?

可以直接克隆仓库:git clone https://github.com/Snaipe/Criterion.git,默认分支为 bleeding;安装与运行步骤见仓库 README。

Criterion 最近还在维护吗?

仓库最近一次更新为 10月6日,当前有 56 个未关闭 Issue;Star 数为 2.3k,可作为社区活跃度的参考。

关于

GitHub 原始描述(英文)

A cross-platform C and C++ unit testing framework for the 21st century

描述取自 GitHub 官方 API,保持仓库作者书写的原文。

简要分析

热度分
2744
价值分
1446
活跃状态
活跃

语言占比

C
C++
CMake
GDB
M4
Makefile
Meson
Perl
Python
Raku
Shell

README

Criterion Logo

CI Coverage Status License Version Documentation (Stable) Documentation (Bleeding)

A dead-simple, yet extensible, C and C++ unit testing framework.

Screencast

Philosophy

Most test frameworks for C require a lot of boilerplate code to set up tests and test suites – you need to create a main, then register new test suites, then register the tests within these suites, and finally call the right functions.

This gives the user great control, at the unfortunate cost of simplicity.

Criterion follows the KISS principle, while keeping the control the user would have with other frameworks:

  • C99 and C++11 compatible.
  • Tests are automatically registered when declared.
  • Implements a xUnit framework structure.
  • A default entry point is provided, no need to declare a main unless you want to do special handling.
  • Test are isolated in their own process, crashes and signals can be reported and tested.
  • Unified interface between C and C++: include the criterion header and it just works.
  • Supports parameterized tests and theories.
  • Progress and statistics can be followed in real time with report hooks.
  • TAP output format can be enabled with an option.
  • Runs on Linux, FreeBSD, macOS, and Windows (Compiling with MinGW GCC and Visual Studio 2015+).

Downloads

Packages

Platform Command
Ubuntu / Debian apt-get install libcriterion-dev
Gentoo emerge -a dev-libs/criterion
Arch Linux pacman -S criterion
macOS brew install criterion
Nix nix-shell -p criterion
FreeBSD pkg install criterion

If you’d like to see Criterion included in your favorite distribution, please reach out to their package maintainers team.

Binary archives

Binary releases for Linux x86_64 are available on the release page.

If you have a different platform, you can still build the library from source.

Developer Resources

Documentation

An online documentation is available on ReadTheDocs (PDF | Zip | Epub)

Samples

Sample tests can be found in the sample directory.

Getting help

Channel Description
Ask a question in GitHub discussions Ask a question in GitHub discussions
Subscribe to the mailing list Criterion mailing list on freelists.org

Misc

Credits

Criterion is built with the following projects:

Logo made by Paul Bouigue.

评论

暂无评论