Description
Currently each test created by hack/generate-e2e-test.py as found in #109 defines coreCodeTemplate
as a String. That String is a copy of the contents of SomeExample.rpde + "\n\nsaveFrame(\"%s\")\nexit()\n"
.
If tests are going to live in the same repo as examples, then this is code duplication, which hurts maintainability.
In the future, tests extending E2eTestBase
should not contain a copy of example code. Instead each test should include a Java statement that dynamically loads a specific .rpde example filename into a String, then appends saveFrame()
and exit()
to that string.
Loading at test time will prevent tests and examples from getting out of sync during testing if the example is being edited but the test isn't regenerated (so the coreCodeTemplate String is out-of-date).