diff options
author | Brad King <brad.king@kitware.com> | 2021-06-28 13:10:16 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2021-06-28 13:28:15 (GMT) |
commit | 1e3d3c52841ac7981879f691c07f28ffaf2ffce5 (patch) | |
tree | 27db850ff5bd5a671b692113bc9516d9009e4b2e /Templates | |
parent | 117b1545a9d9c231f70ff24bfe8155149a5c0429 (diff) | |
download | CMake-1e3d3c52841ac7981879f691c07f28ffaf2ffce5.zip CMake-1e3d3c52841ac7981879f691c07f28ffaf2ffce5.tar.gz CMake-1e3d3c52841ac7981879f691c07f28ffaf2ffce5.tar.bz2 |
TestDriver: Avoid declaring local variable after statement
Move a declaration added by commit 3f6ff4b5db (create_test_sourcelist:
add test driver option to run all tests, 2021-04-27, v3.21.0-rc1~257^2)
into its own scope.
Diffstat (limited to 'Templates')
-rw-r--r-- | Templates/TestDriver.cxx.in | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/Templates/TestDriver.cxx.in b/Templates/TestDriver.cxx.in index e3efa79..6113417 100644 --- a/Templates/TestDriver.cxx.in +++ b/Templates/TestDriver.cxx.in @@ -136,9 +136,11 @@ int main(int ac, char* av[]) t = clock(); status = (*cmakeGeneratedFunctionMapEntries[i].func)(ac, av); t = clock() - t; - double time_taken = ((double)t) / CLOCKS_PER_SEC; status_message = (status == -1) ? "not ok" : "ok"; - printf("%s %d %s # %f\n", status_message, i + 1, name, time_taken); + { + double time_taken = ((double)t) / CLOCKS_PER_SEC; + printf("%s %d %s # %f\n", status_message, i + 1, name, time_taken); + } } printf("All tests finished.\n"); |