[tests] use extern testcase & define in modules

This fixes a -Wunused-variable in GCC