Locally I use Windows, that's why my scripts are batch files.
build-image.batbuilds an image to run C++ kata,run-image.batruns code of a kata in a container. Userun-image KATA-CODEto run, whenreKATA-CODEis a name of one of subdirectories inkata_codedirectory.
CodewarsReporteris unfinished.
cmake -S . -B build -G Ninja
cmake --build build && ./build/tests/tests --reporter=codewarsUse ./configure.sh and ./run-tests.sh.
We'll configure and build an example project while building the container image so each submission will only build the submitted code.
I haven't figured out the timings of the test events used in the custom reporter yet. The tests can be written more naturally, but it might be difficult to get the output we want.
The snippets directory contains snippets of example kata as they are submitted, before preprocessing.
The kata_code directory contains source file of a kata as produced by the CW preprocessor. The files are cp-ed into a container.
ExampleExceptions- a set of test cases to evaluate output of the reporter in case of expected and unexpected exceptions.ExampleFailureMessages- showcase of assertions and matchers most useful for CW authors.ExampleOrganization- a set of test fixtures instantiated in various ways evaluate output of the reporter (especially grouping of tests).ExampleParametrized- a set of parametrized/generated tests to evaluate output of the reporter.OriginalExample- the original example of Google Test tests prepared by kazk. It uses no CW preprocessor markers, and onlypreloaded.handsolution.cppare relevant.preloaded.cppandsolution.hare also saved, but are irrelevant, and cause no problems when buiding and testing the kata.UniqueInOrder- a kata which requires separate cpp file and header file for solution, because it requires users to implement two functions: one is a template, and one is a "normal" function. It uses CW preprocessor markers to split submitted solution snippet into two files.Cafeteria- a kata with no preprocessing markers, with a complex preloaded, where both solution and preloaded are treated as headers, and the cpp part of both gets (apparently) ignored. It also defines customoperator <<for the preloaded types, which is used by GTest to present instances in failure messages. To be honest, I am not sure why this example works because I expected it to fail with linker errors caused by standalone definitions ofoperator<<. I need to take a better look.