tests: automatically handle deps also for generated tests
* tests/gen-testsuite-part: The test scripts are now scanned for
automatic dependency generation *after* the auto-generated tests
have been created, so they too will be scanned. It is a little
tricky to ensure that the freshly-generated tests are correctly
scanned, and we do that with the help of ...
(@generated_tests): ... this new variable.
Other related minor changes and refactorings.