diff options
author | Brad King <brad.king@kitware.com> | 2021-06-29 13:20:59 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2021-06-29 13:21:13 (GMT) |
commit | 9b4a5b4120ce1b11815ade9486c8269ccdf7c8df (patch) | |
tree | 9304ce9922edc5a9a85e87e1bb53492ce5b71e16 | |
parent | 4eb78f774ca0be457f960dc061bcee0b941a3deb (diff) | |
parent | 1e3d3c52841ac7981879f691c07f28ffaf2ffce5 (diff) | |
download | CMake-9b4a5b4120ce1b11815ade9486c8269ccdf7c8df.zip CMake-9b4a5b4120ce1b11815ade9486c8269ccdf7c8df.tar.gz CMake-9b4a5b4120ce1b11815ade9486c8269ccdf7c8df.tar.bz2 |
Merge topic 'test-driver-local-var' into release-3.21
1e3d3c5284 TestDriver: Avoid declaring local variable after statement
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6276
-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"); |