test-read-dwarf: ensure in_elf_path exists and add missing test files
authorMatthias Maennich <maennich@google.com>
Sun, 15 Mar 2020 12:55:11 +0000 (13:55 +0100)
committerDodji Seketeli <dodji@redhat.com>
Wed, 18 Mar 2020 21:46:03 +0000 (22:46 +0100)
test-read-dwarf silently succeeded even if the input elf file was not
existing. Hence, make distcheck succeeded even though the testfiles were
not distributed. Assert on the existence of the input file and add the
missing test case files.

* tests/data/Makefile.am: add missing test case files
* tests/test-read-dwarf.cc (test_task::perform): assert the
input elf file exists.

Signed-off-by: Matthias Maennich <maennich@google.com>
tests/data/Makefile.am
tests/test-read-dwarf.cc

index 3b4b614b0cfd0805e3e1a0f9e5d2b8fd226b9b83..21ae846b177cab19eb4dcf5b203c75e3d4c8817f 100644 (file)
@@ -440,6 +440,8 @@ test-read-dwarf/PR25007-sdhci.ko \
 test-read-dwarf/PR25007-sdhci.ko.abi \
 test-read-dwarf/PR25042-libgdbm-clang-dwarf5.so.6.0.0 \
 test-read-dwarf/PR25042-libgdbm-clang-dwarf5.so.6.0.0.abi \
+test-read-dwarf/test25-bogus-binary.elf \
+test-read-dwarf/test26-bogus-binary.elf \
 \
 test-annotate/test0.abi                        \
 test-annotate/test1.abi                        \
index 11e8425b5a84e788080b2c894fe5b9819b59e3ff..a8ea0619ccbb3c9f061626db2971d809851d6f1c 100644 (file)
@@ -328,6 +328,7 @@ struct test_task : public abigail::workers::task
     abigail::dwarf_reader::status status =
     abigail::dwarf_reader::STATUS_UNKNOWN;
     vector<char**> di_roots;
+    ABG_ASSERT(abigail::tools_utils::file_exists(in_elf_path));
     read_context_sptr ctxt = create_read_context(in_elf_path,
                                                 di_roots,
                                                 env.get());