I’ve just submitted PR https://github.com/stan-dev/stan/pull/2357 for issue https://github.com/stan-dev/stan/issues/2280. this feature captures the line numbers in the Stan program for variable declarations - previously this was only done for statements.
as noted in the PR, the tests that I’ve added aren’t automated.
for the generated code, the test
make test/integration/compile-models checks that the models in
stan/test/test-models/good and subdirs compiles. so I’ve added a directory
src/test/test-models/good/runtime_errors for the models I used to test this function, but I’d like to have automated tests that:
- check that the line numbers in the generated
.hppcode do line up with the
- check that at runtime the error message is as expected.
there are other language features where it would be nice to be able to verify that the generated code actually does what we say it will do - especially w/r/t to manipulating data, e.g., the compound assignment operators.
to me this seems to be one level up from unit testing - the functionality is spread over the parser, generator, and stan/math library functions, not to mention the interfaces. suggestions anyone?