From fd6a5134ecb844e2805a03e2a4f9fd71107e0a52 Mon Sep 17 00:00:00 2001 From: evanchia Date: Thu, 8 Jul 2021 14:02:26 -0700 Subject: [PATCH 1/6] Adding C++ retry command Signed-off-by: evanchia --- Code/Tools/AzTestRunner/src/main.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Code/Tools/AzTestRunner/src/main.cpp b/Code/Tools/AzTestRunner/src/main.cpp index c6d887244f..e53e2ae799 100644 --- a/Code/Tools/AzTestRunner/src/main.cpp +++ b/Code/Tools/AzTestRunner/src/main.cpp @@ -126,6 +126,14 @@ namespace AzTestRunner std::cout << "arg[" << i << "] " << argv[i] << std::endl; } + // Construct a full retry command + std::cout << "Full command: " << argv[0] << " " << lib << " " << symbol; + for (int i = 1; i < argc; i++) + { + std::cout << " " << argv[i]; + } + std::cout << std::endl; + std::cout << "LIB: " << lib << std::endl; } From b1a1f78ca685dc4089d1c32c5734eae36680d888 Mon Sep 17 00:00:00 2001 From: evanchia Date: Mon, 12 Jul 2021 16:54:57 -0700 Subject: [PATCH 2/6] Moved retry command to after the test fails Signed-off-by: evanchia --- Code/Tools/AzTestRunner/src/main.cpp | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/Code/Tools/AzTestRunner/src/main.cpp b/Code/Tools/AzTestRunner/src/main.cpp index e53e2ae799..d846cd5cbd 100644 --- a/Code/Tools/AzTestRunner/src/main.cpp +++ b/Code/Tools/AzTestRunner/src/main.cpp @@ -126,17 +126,16 @@ namespace AzTestRunner std::cout << "arg[" << i << "] " << argv[i] << std::endl; } - // Construct a full retry command - std::cout << "Full command: " << argv[0] << " " << lib << " " << symbol; - for (int i = 1; i < argc; i++) - { - std::cout << " " << argv[i]; - } - std::cout << std::endl; - std::cout << "LIB: " << lib << std::endl; } + // Construct a retry command if test fails + std::string retry_command = "Retry command: " + std::string(argv[0]) + " " + lib + " " + symbol; + for (int i = 1; i < argc; i++) + { + retry_command.append(" " + std::string(argv[i])); + } + // Wait for debugger if (waitForDebugger) { @@ -230,6 +229,10 @@ namespace AzTestRunner if (testMainFunction->IsValid()) { result = (*testMainFunction)(argc, argv); + if (result != 0) + { + std::cout << retry_command << std::endl; + } std::cout << "OKAY " << symbol << "() returned " << result << std::endl; testMainFunction.reset(); } From 9bd5b9fbd62273693963bbd28c52c05476d07490 Mon Sep 17 00:00:00 2001 From: evanchia Date: Wed, 14 Jul 2021 16:09:00 -0700 Subject: [PATCH 3/6] Simplified and moved aztestrunner retry command Signed-off-by: evanchia --- Code/Tools/AzTestRunner/src/main.cpp | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/Code/Tools/AzTestRunner/src/main.cpp b/Code/Tools/AzTestRunner/src/main.cpp index d846cd5cbd..96832c3fed 100644 --- a/Code/Tools/AzTestRunner/src/main.cpp +++ b/Code/Tools/AzTestRunner/src/main.cpp @@ -129,13 +129,6 @@ namespace AzTestRunner std::cout << "LIB: " << lib << std::endl; } - // Construct a retry command if test fails - std::string retry_command = "Retry command: " + std::string(argv[0]) + " " + lib + " " + symbol; - for (int i = 1; i < argc; i++) - { - retry_command.append(" " + std::string(argv[i])); - } - // Wait for debugger if (waitForDebugger) { @@ -229,14 +222,16 @@ namespace AzTestRunner if (testMainFunction->IsValid()) { result = (*testMainFunction)(argc, argv); - if (result != 0) - { - std::cout << retry_command << std::endl; - } std::cout << "OKAY " << symbol << "() returned " << result << std::endl; testMainFunction.reset(); } + // Construct a retry command if the test fails + if (result != 0) + { + std::cout << "Retry command: " << std::string(argv[0]) << " " << lib << " " << symbol << std::endl; + } + // unload and reset the module here, because it needs to release resources that were used / activated in // system allocator / etc. module.reset(); From a92ed42829dc74d092fe8a189ed7c008ed70d879 Mon Sep 17 00:00:00 2001 From: evanchia Date: Tue, 3 Aug 2021 16:51:19 -0700 Subject: [PATCH 4/6] minor fixes for c++ retry command Signed-off-by: evanchia --- Code/Tools/AzTestRunner/src/main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Code/Tools/AzTestRunner/src/main.cpp b/Code/Tools/AzTestRunner/src/main.cpp index 96832c3fed..225975b654 100644 --- a/Code/Tools/AzTestRunner/src/main.cpp +++ b/Code/Tools/AzTestRunner/src/main.cpp @@ -229,7 +229,7 @@ namespace AzTestRunner // Construct a retry command if the test fails if (result != 0) { - std::cout << "Retry command: " << std::string(argv[0]) << " " << lib << " " << symbol << std::endl; + std::cout << "Retry command:\n " << argv[0] << " " << lib << " " << symbol << std::endl; } // unload and reset the module here, because it needs to release resources that were used / activated in From e9ef0a02ec30689e692da05575fa86dbdf4e79d2 Mon Sep 17 00:00:00 2001 From: evanchia Date: Wed, 4 Aug 2021 11:17:38 -0700 Subject: [PATCH 5/6] minor fixes for c++ retry command Signed-off-by: evanchia --- Code/Tools/AzTestRunner/src/main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Code/Tools/AzTestRunner/src/main.cpp b/Code/Tools/AzTestRunner/src/main.cpp index 225975b654..d9ee727447 100644 --- a/Code/Tools/AzTestRunner/src/main.cpp +++ b/Code/Tools/AzTestRunner/src/main.cpp @@ -229,7 +229,7 @@ namespace AzTestRunner // Construct a retry command if the test fails if (result != 0) { - std::cout << "Retry command:\n " << argv[0] << " " << lib << " " << symbol << std::endl; + std::cout << "Retry command: " << std::endl << argv[0] << " " << lib << " " << symbol << std::endl; } // unload and reset the module here, because it needs to release resources that were used / activated in From c229191fad3a1595658502e9ee767764305891a9 Mon Sep 17 00:00:00 2001 From: evanchia Date: Tue, 10 Aug 2021 13:09:42 -0700 Subject: [PATCH 6/6] removing unused output for aztestrunner Signed-off-by: evanchia --- Code/Tools/AzTestRunner/src/main.cpp | 6 ------ 1 file changed, 6 deletions(-) diff --git a/Code/Tools/AzTestRunner/src/main.cpp b/Code/Tools/AzTestRunner/src/main.cpp index d9ee727447..231e4e8059 100644 --- a/Code/Tools/AzTestRunner/src/main.cpp +++ b/Code/Tools/AzTestRunner/src/main.cpp @@ -120,12 +120,6 @@ namespace AzTestRunner { const char* cwd = AzTestRunner::get_current_working_directory(); std::cout << "cwd = " << cwd << std::endl; - - for (int i = 0; i < argc; i++) - { - std::cout << "arg[" << i << "] " << argv[i] << std::endl; - } - std::cout << "LIB: " << lib << std::endl; }