Add tests for declaration-only enums.

* tests/data/test-abidiff-exit/test-decl-enum-report-2.txt: Add
	new test reference output.
	* tests/data/test-abidiff-exit/test-decl-enum-report-3.txt: Likewise.
	* tests/data/test-abidiff-exit/test-decl-enum-report.txt: Likewise.
	* tests/data/test-abidiff-exit/test-decl-enum-v{0,1}.c: Add source
	code for the binaries below.
	* tests/data/test-abidiff-exit/test-decl-enum-v{0,1}.o: Add new
	binary test inputs.
	* tests/data/Makefile.am: Add the new files above to source
	distribution.
	* tests/test-abidiff-exit.cc: Add the test inputs above to the
	test harness.

Signed-off-by: Giuliano Procida <gprocida@google.com>
Signed-off-by: Dodji Seketeli <dodji@redhat.com>
This commit is contained in:
Giuliano Procida 2020-06-10 12:59:40 +01:00 committed by Dodji Seketeli
parent 6295ff70ef
commit b0f98180e0
9 changed files with 69 additions and 0 deletions

View File

@ -158,6 +158,13 @@ test-abidiff-exit/test-fun-param-v0.o \
test-abidiff-exit/test-fun-param-v1.abi \
test-abidiff-exit/test-fun-param-v1.c \
test-abidiff-exit/test-fun-param-v1.o \
test-abidiff-exit/test-decl-enum-v0.c \
test-abidiff-exit/test-decl-enum-v0.o \
test-abidiff-exit/test-decl-enum-v1.c \
test-abidiff-exit/test-decl-enum-v1.o \
test-abidiff-exit/test-decl-enum-report.txt \
test-abidiff-exit/test-decl-enum-report-2.txt \
test-abidiff-exit/test-decl-enum-report-3.txt \
\
test-diff-dwarf/test0-v0.cc \
test-diff-dwarf/test0-v0.o \

View File

@ -0,0 +1,3 @@
Functions changes summary: 0 Removed, 0 Changed (2 filtered out), 0 Added functions
Variables changes summary: 0 Removed, 0 Changed, 0 Added variable

View File

@ -0,0 +1,5 @@
Leaf changes summary: 0 artifact changed
Changed leaf types summary: 0 leaf type changed
Removed/Changed/Added functions summary: 0 Removed, 0 Changed, 0 Added function
Removed/Changed/Added variables summary: 0 Removed, 0 Changed, 0 Added variable

View File

@ -0,0 +1,17 @@
Functions changes summary: 0 Removed, 2 Changed, 0 Added functions
Variables changes summary: 0 Removed, 0 Changed, 0 Added variable
2 functions with some indirect sub-type change:
[C] 'function void reg1(const embodied_enum*)' at test-decl-enum-v1.c:4:1 has some indirect sub-type changes:
parameter 1 of type 'const embodied_enum*' has sub-type changes:
in pointed to type 'const embodied_enum':
in unqualified underlying type 'enum embodied_enum' at test-decl-enum-v1.c:1:1:
enum type enum embodied_enum was a declaration-only enum type and is now a defined enum type
[C] 'function void reg2(const disembodied_enum*)' at test-decl-enum-v1.c:5:1 has some indirect sub-type changes:
parameter 1 of type 'const disembodied_enum*' has sub-type changes:
in pointed to type 'const disembodied_enum':
in unqualified underlying type 'enum disembodied_enum':
enum type enum disembodied_enum was a defined enum type and is now a declaration-only enum type

View File

@ -0,0 +1,5 @@
enum embodied_enum;
enum disembodied_enum { X };
void reg1(const enum embodied_enum * foo) { (void)foo; }
void reg2(const enum disembodied_enum * foo) { (void)foo; }

Binary file not shown.

View File

@ -0,0 +1,5 @@
enum embodied_enum { Y };
enum disembodied_enum;
void reg1(const enum embodied_enum * foo) { (void)foo; }
void reg2(const enum disembodied_enum * foo) { (void)foo; }

Binary file not shown.

View File

@ -212,6 +212,33 @@ InOutSpec in_out_specs[] =
"data/test-abidiff-exit/test-fun-param-report.txt",
"output/test-abidiff-exit/test-fun-param-report.txt"
},
{
"data/test-abidiff-exit/test-decl-enum-v0.o",
"data/test-abidiff-exit/test-decl-enum-v1.o",
"",
"--harmless",
abigail::tools_utils::ABIDIFF_ABI_CHANGE,
"data/test-abidiff-exit/test-decl-enum-report.txt",
"output/test-abidiff-exit/test-decl-enum-report.txt"
},
{
"data/test-abidiff-exit/test-decl-enum-v0.o",
"data/test-abidiff-exit/test-decl-enum-v1.o",
"",
"",
abigail::tools_utils::ABIDIFF_OK,
"data/test-abidiff-exit/test-decl-enum-report-2.txt",
"output/test-abidiff-exit/test-decl-enum-report-2.txt"
},
{
"data/test-abidiff-exit/test-decl-enum-v0.o",
"data/test-abidiff-exit/test-decl-enum-v1.o",
"",
"--leaf-changes-only",
abigail::tools_utils::ABIDIFF_OK,
"data/test-abidiff-exit/test-decl-enum-report-3.txt",
"output/test-abidiff-exit/test-decl-enum-report-3.txt"
},
{0, 0, 0 ,0, abigail::tools_utils::ABIDIFF_OK, 0, 0}
};