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(); }