using std::string;
using std::ofstream;
using std::cerr;
+using abigail::tests::get_build_dir;
/// This is an aggregate that specifies where a test shall get its
/// input from, and where it shall write its ouput to.
// programmer likes.
corp->set_architecture_name("");
- out_abi_path =
- abigail::tests::get_build_dir() + "/tests/" + s->out_abi_path;
+ out_abi_path = get_build_dir() + "/tests/" + s->out_abi_path;
if (!abigail::tools_utils::ensure_parent_dir_created(out_abi_path))
{
cerr << "Could not create parent director for " << out_abi_path;
is_ok = (is_ok && r);
of.close();
+ string abilint = get_build_dir() + "/tools/abilint";
+ abilint += " --noout";
+ string cmd = abilint + " " + out_abi_path;
+ if (system(cmd.c_str()))
+ {
+ cerr << "output file doesn't pass abilint: " << out_abi_path << "\n";
+ r = false;
+ }
+ is_ok = (is_ok && r);
+
+
+ in_elf_path = abigail::tests::get_src_dir() + "/tests/" + s->in_elf_path;
+ string abidiff = get_build_dir() + "/tools/abidiff";
+ cmd = abidiff + " --no-architecture " + in_elf_path + " " + out_abi_path;
+ r = true;
+ if (system(cmd.c_str()))
+ {
+ cerr << "ABIs differ:\n"
+ << in_elf_path
+ << "\nand:\n"
+ << out_abi_path
+ << "\n";
+ r = false;
+ }
+ is_ok = (is_ok && r);
+
in_abi_path = abigail::tests::get_src_dir() + "/tests/" + s->in_abi_path;
- string cmd = "diff -u " + in_abi_path + " " + out_abi_path;
+ cmd = "diff -u " + in_abi_path + " " + out_abi_path;
+ r = true;
if (system(cmd.c_str()))
- is_ok = false;
+ r = false;
+ is_ok = (is_ok && r);
}
return !is_ok;
using abigail::tools_utils::file_type;
using abigail::tools_utils::check_file;
using abigail::tools_utils::guess_file_type;
+using abigail::tests::get_build_dir;
using abigail::translation_unit_sptr;
using abigail::corpus_sptr;
using abigail::xml_reader::read_translation_unit_from_file;
is_ok = (is_ok && r);
of.close();
- string cmd = "diff -u " + in_path + " " + out_path;
+ string abilint = get_build_dir() + "/tools/abilint";
+ abilint += " --noout";
+ string cmd = abilint + " " + out_path;
if (system(cmd.c_str()))
- is_ok = false;
+ {
+ cerr << "ABI XML file doesn't pass abilint: " << out_path << "\n";
+ is_ok &= false;
+ }
+
+ string abidiff = get_build_dir() + "/tools/abidiff";
+ cmd = abidiff + " --no-architecture " + in_path + " " + out_path;
+ if (system(cmd.c_str()))
+ {
+ cerr << "ABIs differ:\n"
+ << in_path
+ << "\nand:\n"
+ << out_path
+ << "\n";
+ is_ok &= false;
+ }
+
+ cmd = "diff -u " + in_path + " " + out_path;
+ if (system(cmd.c_str()))
+ is_ok &= false;
}
return !is_ok;