RagnarGrootKoerkamp / BAPCtools

Tools for developing ICPC-style programming contest problems.
GNU General Public License v3.0
50 stars 23 forks source link

Generators: Replace {name} by fixed `testcase.*` output #273

Closed RagnarGrootKoerkamp closed 1 year ago

RagnarGrootKoerkamp commented 1 year ago

Currently generators that write .in and .ans (and other) files are required to write them to name.*. But this requires passing the testcase name only for the purpose of setting the output filename:

testcase: gen.py {name}

Instead, it would be simpler if gen.py could just write to testcase.in, testcase.ans, and generally testcase.*, since all generators are run in a temporary directory anyway. Then we can simply do

testcase: gen.py
RagnarGrootKoerkamp commented 1 year ago

For backwards compatibility, we can just substitute the {name} argument for testcase everywhere.

mzuenni commented 1 year ago

As far as i can see name is already always testcase since #261 (However problemtools likely handles this differently?).

RagnarGrootKoerkamp commented 1 year ago

Right, that's fine from our side. But what I want is that generators can just always write testcase.*, without having to pass the {name}. The current spec requires them to write to the actual name of the testcase, for which this {name} is needed, so that is mostly the part that needs changing.

mzuenni commented 1 year ago

but that is just a change in the spec, no code needs to be changed (from our side)? ^^

RagnarGrootKoerkamp commented 1 year ago

Hmm yes pretty much true. I'll add some tests and update doc/generators.yaml