Test Generator for the C track

The tests on the C track are somewhat stale and would benefit from an update. They would benefit even more from a test generator to help keep them current. Ideally a C test generator would be written in C. But I don’t write C and no one wrote a generator for the track yet. In the meanwhile, the Python/Jinja test generator I wrote is now being used across ~10 tracks. I could add that generator to the C track and bootstrap a bunch of exercise templates.

Thoughts from C maintainers on reusing a Python/Jinja generator to get C exercise tests generated?

CC @Borderite

Related:

1 Like

For what it’s worth, it’s working out pretty nicely over on the Objective-C track. :slight_smile:

» grep -l 'def problem_spec_dir' */bin/* 2>/dev/null
awk/bin/generate_tests
bash/bin/generate_tests
fortran/bin/generate_tests
gdscript/bin/generate_tests
jq/bin/test-generator
objective-c/bin/generate_tests
scala/bin/generate-tests
scheme/bin/generate_tests.py
sqlite/bin/generate_tests

Plus @BethanyG’s version of this. Not quite the same (it also handles nested tests without flattening, and an auto-formatting step, at the cost of greater complexity), but for Python/Jinja generators also add Python, R and Julia to the list.

1 Like

Yeah. My version is heavily influenced by the Python generator. But more barebones.

Rust also has a test generator written in Rust using the tera template engine, should you want to go with something “lower level”, and/or faster than Python. :smile:

And Erik went a slightly different route with the C# generators.

So you have options, depending on what you’re comfortable with.

+cc @ahans @ryanplusplus

I’m on board with trying out a Python/Jinja generator.

1 Like

I’ll get you a PR in the next few days. Thanks!

See https://github.com/exercism/c/pull/1498

2 Likes