A simple local test runner for codingame

i wrote a simple local test runner for codingame:

https://github.com/lesmana/simple-local-test-runner-for-codingame

a small tool to run tests for your codingame code on your local machine.

why? when other tools for this use case already exists? because i am not on codingame to use other peoples code. i write my own. that is how things are done around here.

on a more serious note: because i want all test cases and expected output in one big file for easy editing. the main idea was to write more test cases myself. because some puzzles on codingame have very limited test cases.

the tools that i found using a quick search on this forum (link1, link2) where either not simple (involving login and whatnot) or the test cases and expected output were spread over multiple files. which makes editing very cumbersome.

one of them could only do javascript and python code. my tool can do any language that is executable on your system.

also they are written in javascript. simple tools are written in bash. yes i am disgruntled old linux user.

limitations:

this tool only runs tests. it does not sync with codingame website. you will have to copy your code and test cases yourself.

this tool only works for practice puzzles which read input once. it does not work for puzzles that must read input per turn.

demonstration:

here is an example test file

=====================
----------------------
example test cases
for code that replaces "in" with "lol"
==========================
test case 1
---------------------------
input1
-----------------------------
lolput1
==========================
test case 2
---------------------------
input2
-----------------------------
lolput2
=========================

and example output if run

$ ./cgrunner.sh ./examplecode.py < exampletests
=====================
test case 1
----------------------
lolput1
----------------------
PASS: test case 1
=====================
test case 2
----------------------
lolput2
----------------------
PASS: test case 2
=====================
all pass

for real world examples see here https://www.codingame.com/forum/t/community-puzzle-challenge-3-squares-order/2402/16