summaryrefslogtreecommitdiff
path: root/compiler/utils/assembler_test_base.h
diff options
context:
space:
mode:
author Andreas Gampe <agampe@google.com> 2015-10-06 18:59:08 -0700
committer Andreas Gampe <agampe@google.com> 2015-10-07 09:26:30 -0700
commit7532401fbb3602cc6831b5f9a809c0e88d1daa83 (patch)
treef6300733d5bcac9f2882374254a55df8c8d1b42f /compiler/utils/assembler_test_base.h
parent8c812b71552a8a1b2bf06e430d355b12b7084807 (diff)
ART: Change asm test logging
Adapt the output a bit to log the exact shell command, and change how the output is logged and what is logged. Should get more info on failure. Change-Id: Iacf58d27d6e1cf01e2fcd5835c4e0f8b5a820501
Diffstat (limited to 'compiler/utils/assembler_test_base.h')
-rw-r--r--compiler/utils/assembler_test_base.h29
1 files changed, 22 insertions, 7 deletions
diff --git a/compiler/utils/assembler_test_base.h b/compiler/utils/assembler_test_base.h
index 43c9d942ed..8c71292465 100644
--- a/compiler/utils/assembler_test_base.h
+++ b/compiler/utils/assembler_test_base.h
@@ -520,18 +520,19 @@ class AssemblerTestInfrastructure {
return line;
}
- // For debug purposes.
- void FindToolDump(std::string tool_name) {
- // Find the current tool. Wild-card pattern is "arch-string*tool-name".
+ // Helper for below. If name_predicate is empty, search for all files, otherwise use it for the
+ // "-name" option.
+ static void FindToolDumpPrintout(std::string name_predicate, std::string tmp_file) {
std::string gcc_path = GetRootPath() + GetGCCRootPath();
std::vector<std::string> args;
args.push_back("find");
args.push_back(gcc_path);
- args.push_back("-name");
- args.push_back(architecture_string_ + "*" + tool_name);
+ if (!name_predicate.empty()) {
+ args.push_back("-name");
+ args.push_back(name_predicate);
+ }
args.push_back("|");
args.push_back("sort");
- std::string tmp_file = GetTmpnam();
args.push_back(">");
args.push_back(tmp_file);
std::string sh_args = Join(args, ' ');
@@ -547,10 +548,24 @@ class AssemblerTestInfrastructure {
UNREACHABLE();
}
+ LOG(ERROR) << "FindToolDump: gcc_path=" << gcc_path
+ << " cmd=" << sh_args;
std::ifstream in(tmp_file.c_str());
if (in) {
- LOG(ERROR) << in.rdbuf();
+ std::string line;
+ while (std::getline(in, line)) {
+ LOG(ERROR) << line;
+ }
}
+ in.close();
+ std::remove(tmp_file.c_str());
+ }
+
+ // For debug purposes.
+ void FindToolDump(std::string tool_name) {
+ // Check with the tool name.
+ FindToolDumpPrintout(architecture_string_ + "*" + tool_name, GetTmpnam());
+ FindToolDumpPrintout("", GetTmpnam());
}
// Use a consistent tmpnam, so store it.