Commit Graph

28 Commits

Author SHA1 Message Date
Hsin-Yi Chen
299acf20e3 Add test for lsdump in JSON format
- Add a test case and data for lsdump in JSON format
- Rename command line option -text-format to -output-format
- Add option -input-format to header-abi-linker

Bug: 112877706
Test: ./test.py
Change-Id: Ia94f7ffffbcaf55f336932029883ea3635c547e9
2018-08-27 07:01:18 +00:00
Jayant Chowdhary
728a91471e Fix function pointer test for header-checker.
Test: changing tests/integration/cpp/include/abstract_class.h changes to
      test results. This would not happen earlier, since inadvertently,
      the test used to pick up abi references locally instead of freshly
      creating them.

Change-Id: Id2c62a6a69b151c5c7f504cfd94bc2be8c851c31
2018-08-14 12:21:53 +08:00
Xin Li
f0edd38359 Merge "Merge Android Pie into master" 2018-08-07 16:51:28 +00:00
Yi-yo Chiang
c79ffcedda Remove "is_inlined" from header-abi-dumper
This commit removes "is_inlined" flag from lsdump's VTableComponent,
because the clang library used to walk the ast doesn't report accurate
information about whether a member function is inlined or not.

Also update the testcases.

Bug: 80217511
Test: ./tests/test.py
Change-Id: I0e133b140a4f3debff8030de7d6712590cf98d76
2018-08-03 14:36:35 +08:00
Yi-yo Chiang
088bdf1af4 Merge "Add is_inlined and is_pure property to header-abi-dump"
am: 54e9654768

Change-Id: I197b7da5c6dfb5d743a8a16565654846176a13d2
2018-07-23 19:04:04 -07:00
Yi-yo Chiang
0218a940cb Add is_inlined and is_pure property to header-abi-dump
- abi_dump.proto: Adds is_inlined and is_pure flag to VTableComponent.
is_inlined means a virtual function is inlined and probably not exported.
is_pure means a virtual function is pure and probably not exported.

Bug: 80217511
Test: ./tests/test.py
Change-Id: Ic1562ed47faba1f3d7eec6dffe94991296ba7176
2018-07-23 14:58:03 +08:00
Hsin-Yi Chen
cda676761a Merge "Show thunk symbols in vtables"
am: 321b110998

Change-Id: I101bd3c34f04f56c69aecf4ce4828ecaa713cadf
2018-07-01 21:09:21 -07:00
Hsin-Yi Chen
cd1eada7b0 Show thunk symbols in vtables
- Convert method declarations to thunk symbols if thunk information
  exists.
- Add a test case and reference dumps for virtual inheritance.

Bug: 80671888
Test: ./tests/test.py
Change-Id: I55ecbd7c8b0f5b0f534d81e6c6967f99ffd1d42e
2018-06-29 10:57:31 +00:00
Jayant Chowdhary
d8e44b2ed0 Merge "header-abi-diff: Add a flag to consider opaque types with different names structurally unequal." am: 73ea62cf25
am: dfe45fdd6e

Change-Id: I23ffd2e2e74c6e32f3aec7262fbd2c9b1af5f979
2018-06-07 16:41:42 -07:00
Jayant Chowdhary
e90b33a9d9 header-abi-diff: Add a flag to consider opaque types with different names structurally unequal.
Bug: 79576032

Test: tests/test.py

Change-Id: I28cb7a2676a1e85e4ef1d2faaf6684d7c1824370
2018-06-04 11:50:05 -07:00
Jayant Chowdhary
7e4bcd8f0c Merge "header-abi-diff: Fix omission of warning message for extensions." am: dd511b6bd0
am: d4767873d5

Change-Id: I7bd9303b989a6d8735589a524bb2fa06393cc59f
2018-05-29 12:24:19 -07:00
Jayant Chowdhary
b31dbb37f6 header-abi-diff: Fix omission of warning message for extensions.
Test: Without change : extend libjpeg; build breaks without warning message
      specifying extension

Test: With change : extend libjpeg; build breaks with warning message specifying
      extension

Test: tests/test.py

Change-Id: I1653a977d0945810b4b9dc4ec9923b12c4f5dc36
2018-05-24 18:12:55 -07:00
Jayant Chowdhary
ae789286a4 Merge "header-abi-diff: Fix return code for extension in presence of elf only changes." am: 0aeced009b
am: c6ad943e83

Change-Id: If64138ea61e5aa5a51339820fba9f70bf59de66e
2018-05-24 10:41:30 -07:00
Jayant Chowdhary
03c4e279a8 header-abi-diff: Fix return code for extension in presence of elf only changes.
Before this change, an elf symbol change not exported through public
headers would short circuit the check for api extension. As a result,
header-abi-diff would return a compatible return status (0). This isn't
correct, extensions should take precedence over elf only changes and an
extension status should be returned (non zero).

Test: tests/test.py

Change-Id: I6907d0ebaf332d019cdf2e264316f7d521e00d82
2018-05-23 21:11:22 -07:00
Jayant Chowdhary
af91f22241 Merge "Mark two records as different if the access specifier is downgraded." am: 849a934bb4
am: 6128f0a47c

Change-Id: Ic3e7a229885a52340fe7cee5eeea679edf501d18
2018-05-17 10:51:01 -07:00
Jayant Chowdhary
6893d8cc69 Mark two records as different if the access specifier is downgraded.
Earlier, we marked two records as different if their access specifiers
were not the same.

Bug: http://b/79493296

Test: tests/test.py

Change-Id: I117a408c7a85624a1e3d7a7477ae789eddd4bccc
2018-05-14 14:07:49 -07:00
Jayant Chowdhary
195393383a Merge "Fix incorrect public object access specifiers." am: 7865edfab8
am: 404f1172cc

Change-Id: I9284246be02e631065b7f8812b20ff38e5766996
2018-04-17 15:18:28 -07:00
Jayant Chowdhary
9c569ce793 Fix incorrect public object access specifiers.
Bug: 78184573

Test: tests/test.py

Change-Id: I9cf5df612322eb66e9a46450d7f43c99586dbab6
2018-04-17 13:37:16 -07:00
Jayant Chowdhary
243ae244ba Fix function pointer test for header-checker.
Test: changing tests/integration/cpp/include/abstract_class.h changes to
      test results. This would not happen earlier, since inadvertently,
      the test used to pick up abi references locally instead of freshly
      creating them.

Change-Id: Ie9604cc09df1ab5a87996f1ecd141f228d67a765
2018-04-11 15:38:24 -07:00
Jayant Chowdhary
bab864d2d0 Add test for function pointer diffing.
Bug: 71486762

Test: tests/test.py

Change-Id: Id956804c36b0c06b4e6259d6864438974ed18267
2018-03-21 22:13:55 -07:00
Jayant Chowdhary
3bc023f373 Add an additional test for ODR.
Also add missing test source files.

Test: tests/test.py

Change-Id: I44ec2cab9596e4722600995855d0a035e304e7ae
2018-02-12 13:43:54 -08:00
Jayant Chowdhary
7cc00996e5 Fix map key in header-abi-diff while extracting user defined types.
The key being added to respective maps which facilitate diffing of
unreferenced user defined types was earlier the linker set key. The
unique id should be used instead. This is because linker set keys for C
and C++ types can be the same, but their unique id's cannot. Thus,
having linker set keys as a key leaves open the possibility of false
type aliasing, whereas the unique id does not.

Test: python3 tests/test.py

Test: python3 tests/test.py \
      MyTest.test_libc_and_cpp_with_unused_struct_and_libc_and_cpp_with_unused_cstruct;
      before this change, this test fails; after this change, the test
      passes.

Change-Id: I91816167a48308a8c812d01e0a09e9bb70c60b50
2018-02-07 13:04:30 -08:00
Logan Chien
f7b388328b header-checker: Code cleanup
Test: None (No functionality changes)
Change-Id: I18078a5465d4d93bacc8ba381d3ca727ea423ef7
2018-01-09 18:17:08 +08:00
Jayant Chowdhary
537edf605d Fix invalidation of vector iterator while computing removed class fields.
Test: tests/test.py pass

Change-Id: I58eb0966972c8fc1f74cd6a28708c5f591a77f75
2018-01-02 18:47:48 -08:00
Jayant Chowdhary
a668261e85 Fix missing setter for RecordKind.
The record kind (struct, class or union) was not being set while
converting from protobuf to IR.

Test: tests/test.py, all tests pass. Without the change, the default
      kind of a C record would have shown up as class_kind.

Change-Id: I507581211a6d30c2c51414c6fab6413eece6b458
2017-12-07 12:48:42 -08:00
Jayant Chowdhary
29092604b2 Fix how header-checker tests run.
Previously, the tests mainly exercised header-abi-diff.
After this change, checked-in reference dumps are compared with
generated dumps. This allows us to:
  - get header-abi-dumper and header-abi-linker involved in testing
    better.
  - Know about any incompatbile message format changes made
    inadvertently.

Test: tests/test.py; all tests pass.

Change-Id: I7c7ba0811e6c08c6194a0a11616680279e7a0e1d
2017-12-07 12:46:10 -08:00
Jayant Chowdhary
860b41407e Add more comprehensive tests for abi diffing.
1) We do not involve the build system to create test reference dumps. Symbols
in tests, are faked through version scripts to avoid checking in prebuilt .so
test files.

2) Also add a script to create reference abi dumps.

3) Fix a comment in ast_processing.cpp

Test: Run tests/test.py, all tests run and pass on generic arm64, mips64
and x86_64 builds.

Change-Id: Id3a420c1ae093a05a79da4c29e85071f28d714d1
2017-08-24 23:41:01 -07:00
Logan Chien
e3d3bda3bb Add functional tests for header-abi-dumper.
This commit adds functional tests for header-abi-dumper.

Test: mm -j8 && ./tests/test.py
Change-Id: Ibc2f2200297720ca9ada7a5e039d40c9648a5d2a
2017-02-06 19:44:32 +08:00