The CSS2.1 Test Suite's final format is generated from the XHTML 1.1 source files with a set of Python scripts. These can be found in the tools/ directory of the test suite repository.
tools/build.pyscript from the root of your test repository checkout.
If you want to hack the w3ctestlib, you'll need to request write access from Peter Linss email@example.com.
The w3ctestlib/ folder is a subrepo. To write to it, add to tools/w3ctestlib/.hg/hgrc the following:
[paths] default-push = https://hg.csswg.org/dev/w3ctestlib
and make sure you commit and push first inside w3ctestlib (to update the subrepo), then above it in the test repository (to update the test repository's versioned link to the subrepo).