Skip to main content

58 docs tagged with "testing"

View All Tags

Adding Custom Stringizers

NOTE: code snippets in this article omit #include directives for brevity. You must remember to include the required header files!

Cgreen

Unit tests for RISC-V are written in C with Cgreen while the solution file is in assembly.

Criterion

The Criterion testing framework is available in its Github repository. Reference for the Criterion API can be found here//criterion.readthedocs.io/en/master/intro.html.

JUnit

You can use JUnit 4 or 5 in Codewars. 5 offers nesting, pretty name display and multiple test classes.

lc-test

To run tests for Lambda Calculus programs, Codewars uses a custom compiling and testing framework, published and available in this GitHub repository.

PHPUnit

All PHPUnit tests start with a subclass of TestCase. You can then add one or more test case methods to that class, each of which must be public and start with test. In Codewars' PHP versions 7.4+, PHPUnit requires the name of the test class to end with Test.

Python Codewars Test Framework

To run Python tests, Codewars currently uses a custom test framework, published and available in this GitHub repository.

RSpec

Shell can be tested with Ruby's RSpec library which runs the solution shell script as a subprocess. The runshell(args true) function is provided to facilitate this. Calling runshell(2, 3, 4) effectively runs bash -c $(cat solution.sh) 2 3 4 and returns the script's stdout as a string.

ScalaTest

Basic Setup (Scala 3.0/ScalaTest 3.2)

testest

To run Factor tests, Codewars currently uses a custom test vocabulary, published and available in this GitHub repository.