TestDriver: fix style-'variableScope' cppcheck warning
When applied on a user project, cppcheck complains that the 'test_name' variable could have a reduced scope.
When applied on a user project, cppcheck complains that the 'test_name' variable could have a reduced scope.