Commit Graph

24 Commits

Author SHA1 Message Date
Hsin-Yi Chen
b8ec3d49de Do not call build/envsetup.sh in create_reference_dumps
This commit makes get_build_vars_for_product get variables by
soong_ui.bash without envsetup.sh.

Bug: 120819347
Test: ./create_reference_dumps.py --llndk -libs libbinder_ndk
Change-Id: I66d1245d277d3c5459c6027ccdb88288aaf4d802
2018-12-25 17:52:58 +08:00
Hsin-Yi Chen
e89977ad7e Refactor header-checker tests
- Rename the unit test class to HeaderCheckerTest.
- Create/delete temporary directory in setUp/tearDown.
- Move make_and_copy_reference_dumps from gen_all.py to test.py.
- Remove duplicate constant paths.
- Add default arguments to LsdumpModule.
- Fix coding style.

Bug: 117582158
Test: ./gen_all.py
Test: ./test.py
Change-Id: I6345a10da5431e8057e4a9321ecce4168b7d5292
2018-12-21 16:02:30 +08:00
dimitry
5f600aa39d Slightly improve error handling
Test: ./development/vndk/tools/header-checker/utils/create_reference_dumps.py -l libGLESv1_CM
Test: now fails with error message
Change-Id: Idd9aa84d8da6d4f6016f41438571ac1f0808be7e
2018-12-18 12:18:55 +01:00
Hsin-Yi Chen
07f3dd52a8 Add unit tests for header-abi-dumper -suppress-errors
- Add undeclared_types.h and known_issues.h.
- Classify modules into LsdumpModule and SdumpModule.

Test: ./test.py
Bug: 117582158
Change-Id: Ia8d56d28e6bf37f6d8f746fa9505b51c44772294
2018-11-20 18:39:12 +08:00
Hsin-Yi Chen
376b57580e Merge "Update unit tests for -dump-function-declarations" 2018-11-09 08:22:50 +00:00
Hsin-Yi Chen
b7565950ef Update unit tests for -dump-function-declarations
- Apply -dump-function-declarations to input/*.h.
- Add an explicitly deleted function to input/example1.h.
- Remove gen_expected_output.py and input/func_decl_*.h.

Bug: 71485848
Bug: 117582158
Test: ./test.py
Change-Id: Ic81448a3607c23bfb10781b4df097578814b7118
2018-11-08 18:07:27 +08:00
Logan Chien
ce6ea7999f header-checker: Fix unit test include directories
This commit fixes the built-in include directories for header-abi-dumper
unit test cases. Remove the reference to
`prebuilts/sdk/renderscript/clang-include` because we don't check out
`prebuilts/sdk` in `aosp-clang-tools` branch.

Test: PATH=out/soong/dist/bin:$PATH \
development/vndk/tools/header-checker/tests/test.py

Change-Id: Ieb24b0a53b719f4569149251efcdaa3722c0b88c
2018-11-08 14:48:47 +08:00
Logan Chien
f120783abd header-checker: Code cleanup
This commit cleans up several whitespaces nits, re-indent the code,
remove unnecessary data member initializers, and add missing header
guards.

Test: ./tests/test.py
Change-Id: Ibc355441aaa110280b263c5c3d8fc766941b08af
2018-10-17 09:46:24 +08:00
Logan Chien
6dbbe7bf8d header-checker: Cleanup create_reference_dumps.py
This commit refactors the `main()` function, cleans up several
indentation or spacing errors, and rewrites some code in Pythonic way.

Test: ./tests/test.py
Test: ./utils/create_reference_dumps.py
Change-Id: Ie654187bff5b5c49b421814efab0e8f308c93fa8
2018-10-09 11:31:09 +08:00
Logan Chien
f58bb5f1fe header-checker: Generate ABI dumps w/o gzip
This commit adds an option to generate ABI dumps without compressing
them with gzip.

Bug: 111376916
Test: ./create_reference_dumps.py
Test: ./create_reference_dumps.py --compress
Change-Id: I1ad0781744a9ba6ff34ffed9418576986daeb67d
2018-10-08 16:33:18 +08:00
Hsin-Yi Chen
86bcedcd0c Change default dump format to JSON
Bug: 112877706
Test: ./test.py
Change-Id: I5fd00e75b804a33c982008bc95ea017b480b67cc
2018-10-03 18:05:34 +08:00
Hsin-Yi Chen
4b9b242efe Add test for loading JSON dump
- Add a test that compares protobuf and JSON dumps.
- Add input-format=Json to header-abi-linker and diff.

Bug: 112877706
Test: ./test.py
Change-Id: Ic9be304b565a2ac58ed76e1a0fcc96530395b750
2018-09-21 11:50:26 +08:00
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
b2144fb977 Unify command for creation of llndk, vndk abi references.
Bug: 64267858

Test: utils/create_reference_dumps.py creates llndk + vndk abi
      references

Test: utils/create_reference_dumps.py -l libjpeg

Merged-In: I72ae13fb9c48f23a62b959195dbd5fa6fe4c14b0
Change-Id: I72ae13fb9c48f23a62b959195dbd5fa6fe4c14b0
(cherry picked from commit a038b56c7d)
2018-04-12 09:07:39 -07:00
Jayant Chowdhary
3dc4ff3ef0 Make utils/create_reference_dumps.py slightly less slower when -l is specified.
Bug: 64267858

Test: Without this change:
          rm -rf $ANDROID_BUILD_TOP/out; utils/create_reference_dumps.py
	  -l libjpeg -> > 30 minutes
      With this change:
          rm -rf $ANDROID_BUILD_TOP/out; utils/create_reference_dumps.py
	  -l libjpeg -> approx 11.5 minutes

Change-Id: I9c145ed5d8c9a9cc2cb1dc7db9ab9b83843a291e
2018-03-29 22:43:04 +00:00
Jayant Chowdhary
1ebd366d52 Use target 'vndk' instead of 'vndk_package' while creating abi references.
Using 'vndk_package' will miss out on vndk libraries not being used by the
lunch target

Bug: 64267858

Test: utils/create_reference_dumps.py

Change-Id: Ifaa61aae715af7f2010aadbfa9864da7c74ca14f
2018-03-27 15:50:19 -07:00
Jayant Chowdhary
cd0e8aff22 Add --llndk to create_reference_dumps.py for llndk libraries.
Currently, we do abi checks on the system variants of llndk libraries.
Therefore, add an 'llndk' flag to specify that the system variant should be
built.

Bug: 77101345

Test: utils/create_reference_dumps.py --llndk -l libdl produces
      libdl references.

Change-Id: Id4c607674f096daf041520d4a1ca43199d4451da
2018-03-27 12:45:20 -07:00
Jayant Chowdhary
76183b7a83 Shenanigans to make create_reference_dumps.py more usable.
- pick up lsdump paths from
  $(OUT_DIR)/lsdump_paths/$(TARGET_PRODUCT)/paths.txt instead of
  searching through out/soong/.intermediates.

- llndk lsdumps also get picked up and copied to ref dump dir root now

- creation of references are more fine grained to take into account
  target arch variant and cpu variant as well.

- references for vndk libs and llndk libs for all target archs and
  variants can be generated with one invocation of the script now.

Test: utils/create_reference_dumps.py -l libjpeg -l libc++ -l libc

Test: utils/create_reference_dumps.py -l libjpeg -l libc++ -l libc
      --no-make-lib

Test: utils/create_reference_dumps.py

Change-Id: I9105900b70c62c01f8282e1782cb38a42f4d4356
2018-03-01 15:11:32 -08:00
Jayant Chowdhary
d1f8fc226b gzip reference dumps while copying to ref-dump-dir.
Remove the additional step of gzipping reference dumps manually.

Test: utils/create_reference_dumps.py --version current -ref-dump-dir
      $ANDROID_BUILD_TOP/prebuilts/abi-dumps/vndk; mm -j64 in
      external/libexif.

Change-Id: Ib22a3b4fa90e4f849529efc4b03ab43d87996458
2018-02-09 10:29:57 -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
Jayant Chowdhary
c18ded4bb0 Make create_reference_dumps.py faster.
Since we now build and install all vndk libraries,regardless of
dependencies, we may just look for all files with the extension '.lsdump' for
TARGET_ARCH and TARGET_2ND_ARCH, and copy them to the given reference dump
directory.

Test: utils/create_reference_dumps.py --version current -ref-dump-dir
      <dir> creates reference dumps at <dir>

Change-Id: Ic9db57b00614b3e8dc18d8e56eab4bd87df1723c
2017-12-07 12:46:18 -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
Dan Willemsen
d3fc8faff6 Switch to new soong_ui dumpvar-mode
Stop using make directly.

Test: manual tests
Test: development/scripts/symbol.py
Change-Id: I9f75776251b693dbe979989942d2db49768224d2
2017-10-17 14:10:51 -07: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