libabigail/tests
Matthias Maennich 72eb3fe482 tests: Add kernel symtab test suite
Add (Catch based) test suite to test kernel symbol table (ksymtab)
reading through the result persisted in abigail::corpus.

The test cases are created through simple kernel module C source files
targeting the desired properties ((gpl) exported / local functions /
variables). The kernel binaries are built without debug information to
keep them reasonably small and reproducible. That is just enough
sufficient to analyze ksymtabs. The Makefile that comes with them
recreates the test cases from the sources, given a kernel source tree
with the appropriate version, e.g.

   make KDIR=/path/to/4.14

This covers ksymtab reading and ensuring we detect the kernel binary
correctly. The kernel versions are selected based on features introduced
into the Linux kernel that affect the ksymtab representation.

 - Linux v4.14 - reasonably old kernel to start with (actually v4.14.180)
 - Linux v4.19 - first version having position relative relocations
		 (PREL) in ksymtab entries on some platforms
		 (actually v4.19.123)
 - Linux v5.4  - first version having symbol namespaces (actually v5.4.41)
 - Linux v5.6  - latest released stable kernel as of writing (actually v5.6.13)

	* tests/data/Makefile.am: add new test data for runtestsymtab
	* tests/data/test-symtab/kernel-4.14/Makefile: New test case makefile.
	* tests/data/test-symtab/kernel-4.14/empty.c: Likewise.
	* tests/data/test-symtab/kernel-4.14/one_of_each.c: Likewise.
	* tests/data/test-symtab/kernel-4.14/single_function.c: Likewise.
	* tests/data/test-symtab/kernel-4.14/single_function_gpl.c: Likewise.
	* tests/data/test-symtab/kernel-4.14/single_variable.c: Likewise.
	* tests/data/test-symtab/kernel-4.14/single_variable_gpl.c: Likewise.
	* tests/data/test-symtab/kernel-4.14/empty.ko: New test data.
	* tests/data/test-symtab/kernel-4.14/one_of_each.ko: Likewise.
	* tests/data/test-symtab/kernel-4.14/single_function.ko: Likewise.
	* tests/data/test-symtab/kernel-4.14/single_function_gpl.ko: Likewise.
	* tests/data/test-symtab/kernel-4.14/single_variable.ko: Likewise.
	* tests/data/test-symtab/kernel-4.14/single_variable_gpl.ko: Likewise.
	* tests/data/test-symtab/kernel-4.19/Makefile: New test case makefile.
	* tests/data/test-symtab/kernel-4.19/empty.c: Likewise.
	* tests/data/test-symtab/kernel-4.19/one_of_each.c: Likewise.
	* tests/data/test-symtab/kernel-4.19/single_function.c: Likewise.
	* tests/data/test-symtab/kernel-4.19/single_function_gpl.c: Likewise.
	* tests/data/test-symtab/kernel-4.19/single_variable.c: Likewise.
	* tests/data/test-symtab/kernel-4.19/single_variable_gpl.c: Likewise.
	* tests/data/test-symtab/kernel-4.19/empty.ko: New test data.
	* tests/data/test-symtab/kernel-4.19/one_of_each.ko: Likewise.
	* tests/data/test-symtab/kernel-4.19/single_function.ko: Likewise.
	* tests/data/test-symtab/kernel-4.19/single_function_gpl.ko: Likewise.
	* tests/data/test-symtab/kernel-4.19/single_variable.ko: Likewise.
	* tests/data/test-symtab/kernel-4.19/single_variable_gpl.ko: Likewise.
	* tests/data/test-symtab/kernel-5.4/Makefile: New test case makefile.
	* tests/data/test-symtab/kernel-5.4/empty.c: Likewise.
	* tests/data/test-symtab/kernel-5.4/one_of_each.c: Likewise.
	* tests/data/test-symtab/kernel-5.4/single_function.c: Likewise.
	* tests/data/test-symtab/kernel-5.4/single_function_gpl.c: Likewise.
	* tests/data/test-symtab/kernel-5.4/single_variable.c: Likewise.
	* tests/data/test-symtab/kernel-5.4/single_variable_gpl.c: Likewise.
	* tests/data/test-symtab/kernel-5.4/empty.ko: New test data.
	* tests/data/test-symtab/kernel-5.4/one_of_each.ko: Likewise.
	* tests/data/test-symtab/kernel-5.4/single_function.ko: Likewise.
	* tests/data/test-symtab/kernel-5.4/single_function_gpl.ko: Likewise.
	* tests/data/test-symtab/kernel-5.4/single_variable.ko: Likewise.
	* tests/data/test-symtab/kernel-5.4/single_variable_gpl.ko: Likewise.
	* tests/data/test-symtab/kernel-5.6/Makefile: New test case makefile.
	* tests/data/test-symtab/kernel-5.6/empty.c: Likewise.
	* tests/data/test-symtab/kernel-5.6/one_of_each.c: Likewise.
	* tests/data/test-symtab/kernel-5.6/single_function.c: Likewise.
	* tests/data/test-symtab/kernel-5.6/single_function_gpl.c: Likewise.
	* tests/data/test-symtab/kernel-5.6/single_variable.c: Likewise.
	* tests/data/test-symtab/kernel-5.6/single_variable_gpl.c: Likewise.
	* tests/data/test-symtab/kernel-5.6/empty.ko: New test data.
	* tests/data/test-symtab/kernel-5.6/one_of_each.ko: Likewise.
	* tests/data/test-symtab/kernel-5.6/single_function.ko: Likewise.
	* tests/data/test-symtab/kernel-5.6/single_function_gpl.ko: Likewise.
	* tests/data/test-symtab/kernel-5.6/single_variable.ko: Likewise.
	* tests/data/test-symtab/kernel-5.6/single_variable_gpl.ko: Likewise.
	* tests/data/test-symtab/kernel/Makefile: New test case source file.
	* tests/data/test-symtab/kernel/empty.c: Likewise.
	* tests/data/test-symtab/kernel/one_of_each.c: Likewise.
	* tests/data/test-symtab/kernel/single_function.c: Likewise.
	* tests/data/test-symtab/kernel/single_function_gpl.c: Likewise.
	* tests/data/test-symtab/kernel/single_variable.c: Likewise.
	* tests/data/test-symtab/kernel/single_variable_gpl.c: Likewise.
	* tests/test-symtab.cc: New test case to test kernel symtabs.

Signed-off-by: Matthias Maennich <maennich@google.com>
Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2020-05-27 11:00:51 +02:00
..
data tests: Add kernel symtab test suite 2020-05-27 11:00:51 +02:00
lib
.gitignore tests/.gitignore: ignore all files starting with runtest* 2020-05-13 11:26:28 +02:00
Makefile.am tests: Add symtab test suite 2020-05-27 11:00:51 +02:00
mockfedabipkgdiff.in
print-diff-tree.cc Update copyright year to 2020 2020-02-21 17:05:01 +01:00
runtestcanonicalizetypes.sh.in
runtestdefaultsupprs.py.in
runtestdefaultsupprspy3.sh.in
runtestfedabipkgdiff.py.in
runtestfedabipkgdiffpy3.sh.in
test-abicompat.cc Update copyright year to 2020 2020-02-21 17:05:01 +01:00
test-abidiff-exit.cc Bug 25986 - Wrong name of function type used in change report 2020-05-14 09:54:52 +02:00
test-abidiff.cc Update copyright year to 2020 2020-02-21 17:05:01 +01:00
test-alt-dwarf-file.cc Update copyright year to 2020 2020-02-21 17:05:01 +01:00
test-annotate.cc
test-core-diff.cc Update copyright year to 2020 2020-02-21 17:05:01 +01:00
test-cxx-compat.cc cxx-compat: add test suite for cxx-compat 2020-05-13 11:55:12 +02:00
test-diff2.cc Update copyright year to 2020 2020-02-21 17:05:01 +01:00
test-diff-dwarf-abixml.cc Update copyright year to 2020 2020-02-21 17:05:01 +01:00
test-diff-dwarf.cc Update copyright year to 2020 2020-02-21 17:05:01 +01:00
test-diff-filter.cc Bug 25661 - Support data member replacement by anonymous data member 2020-05-18 13:42:50 +02:00
test-diff-pkg.cc configure: add more diagnostic options when ABIGAIL_DEVEL is set 2020-05-18 10:39:36 +02:00
test-diff-suppr.cc tests: parallelize diff-suppr test 2020-04-20 15:02:39 +02:00
test-dot.cc Update copyright year to 2020 2020-02-21 17:05:01 +01:00
test-elf-helpers.cc abg-dwarf-reader split: create abg-elf-helpers.{h,cc} and test case 2020-04-22 11:39:45 +02:00
test-ini.cc Update copyright year to 2020 2020-02-21 17:05:01 +01:00
test-ir-walker.cc Update copyright year to 2020 2020-02-21 17:05:01 +01:00
test-kmi-whitelist.cc Simplify generation of symbol whitelist regex. 2020-05-04 11:17:49 +02:00
test-lookup-syms.cc dwarf-reader: Fix bloom filter access in GNU_HASH section 2020-03-20 13:35:00 +01:00
test-read-dwarf.cc dwarf-reader: remove superfluous ABG_ASSERT 2020-03-18 23:10:14 +01:00
test-read-write.cc configure: add more diagnostic options when ABIGAIL_DEVEL is set 2020-05-18 10:39:36 +02:00
test-svg.cc Update copyright year to 2020 2020-02-21 17:05:01 +01:00
test-symtab.cc tests: Add kernel symtab test suite 2020-05-27 11:00:51 +02:00
test-tools-utils.cc Update copyright year to 2020 2020-02-21 17:05:01 +01:00
test-types-stability.cc test-types-stability: parallelize test case alternatives 2020-05-04 15:34:42 +02:00
test-utils.cc Update copyright year to 2020 2020-02-21 17:05:01 +01:00
test-utils.h Update copyright year to 2020 2020-02-21 17:05:01 +01:00
test-valgrind-suppressions.supp
test-write-read-archive.cc Update copyright year to 2020 2020-02-21 17:05:01 +01:00
update-test-output.py