mirror of
git://sourceware.org/git/libabigail.git
synced 2025-02-23 17:36:52 +00:00
Add better error messaging to several tests
When test-read-dwarf and test-diff-filter fail, it's important to know what exact command line failed. This patch makes these tests display the failing command. * tests/test-diff-filter.cc (test_task::perform): Display the failing command. * tests/test-read-common.cc (test_task::run_abidw): Likewise. * tests/test-read-common.h (test_task::run_diff): Likewise. Signed-off-by: Dodji Seketeli <dodji@redhat.com>
This commit is contained in:
parent
aecfa368a5
commit
ed3eabbb6b
@ -902,6 +902,9 @@ struct test_task : public abigail::workers::task
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
is_ok = false;
|
is_ok = false;
|
||||||
|
|
||||||
|
if (!abidiff_ok)
|
||||||
|
error_message += "cmd failed: " + cmd;
|
||||||
}
|
}
|
||||||
}; //end struct test_task.
|
}; //end struct test_task.
|
||||||
|
|
||||||
|
@ -108,7 +108,8 @@ test_task::run_abidw(const string& extargs)
|
|||||||
+ in_abi_path
|
+ in_abi_path
|
||||||
+ "\nand:\n"
|
+ "\nand:\n"
|
||||||
+ out_abi_path
|
+ out_abi_path
|
||||||
+ "\n";
|
+ "\n"
|
||||||
|
+ "command was: '" + cmd + "'\n";
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -131,11 +132,12 @@ test_task::run_diff()
|
|||||||
string cmd = "diff -u " + in_abi_path + " " + out_abi_path;
|
string cmd = "diff -u " + in_abi_path + " " + out_abi_path;
|
||||||
if (system(cmd.c_str()))
|
if (system(cmd.c_str()))
|
||||||
{
|
{
|
||||||
error_message = string("ABIs differ:\n")
|
error_message = string("ABI files differ:\n")
|
||||||
+ in_abi_path
|
+ in_abi_path
|
||||||
+ "\nand:\n"
|
+ "\nand:\n"
|
||||||
+ out_abi_path
|
+ out_abi_path
|
||||||
+ "\n";
|
+ "\n"
|
||||||
|
+ "command was: '" + cmd + "'\n";
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -101,6 +101,10 @@ struct test_task : public abigail::workers::task
|
|||||||
bool
|
bool
|
||||||
set_out_abi_path()
|
set_out_abi_path()
|
||||||
{
|
{
|
||||||
|
if (!spec.out_abi_path)
|
||||||
|
// No output abi path was specified in the spec, so get out.
|
||||||
|
return false;
|
||||||
|
|
||||||
out_abi_path = out_abi_base + spec.out_abi_path;
|
out_abi_path = out_abi_base + spec.out_abi_path;
|
||||||
if (!abigail::tools_utils::ensure_parent_dir_created(out_abi_path))
|
if (!abigail::tools_utils::ensure_parent_dir_created(out_abi_path))
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user