Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Hexagon] capture gtest output and return over FFI #11239

Merged
merged 12 commits into from
May 11, 2022

Conversation

adstraw
Copy link
Contributor

@adstraw adstraw commented May 7, 2022

Captures Hexagon gtest output in a string and passes back over the FFI. Captured output mimics standard gtest output:

[==========] Running 27 test(s) from 1 test suite(s).
[----------] 27 test(s) from HexagonBuffer
[ RUN      ] HexagonBuffer.default_scope
[       OK ] HexagonBuffer.default_scope (0 ms)
[ RUN      ] HexagonBuffer.ddr_scope
[       OK ] HexagonBuffer.ddr_scope (0 ms)
[ RUN      ] HexagonBuffer.vtcm_scope
[       OK ] HexagonBuffer.vtcm_scope (0 ms)
[ RUN      ] HexagonBuffer.invalid_scope
[       OK ] HexagonBuffer.invalid_scope (0 ms)
[ RUN      ] HexagonBuffer.micro_copies_corresponding_regions
[       OK ] HexagonBuffer.micro_copies_corresponding_regions (0 ms)
[ RUN      ] HexagonBuffer.micro_copies_src_bigger
[       OK ] HexagonBuffer.micro_copies_src_bigger (0 ms)
[ RUN      ] HexagonBuffer.micro_copies_dest_bigger
[       OK ] HexagonBuffer.micro_copies_dest_bigger (0 ms)
[ RUN      ] HexagonBuffer.micro_copies_src_overlaps_dest_region
[       OK ] HexagonBuffer.micro_copies_src_overlaps_dest_region (0 ms)
[ RUN      ] HexagonBuffer.micro_copies_dest_overlaps_src_region
[       OK ] HexagonBuffer.micro_copies_dest_overlaps_src_region (0 ms)
[ RUN      ] HexagonBuffer.micro_copies_discontiguous_regions
[       OK ] HexagonBuffer.micro_copies_discontiguous_regions (0 ms)
[ RUN      ] HexagonBuffer.micro_copies_invalid_size
[       OK ] HexagonBuffer.micro_copies_invalid_size (0 ms)
[ RUN      ] HexagonBuffer.macro_copies_adjacent_corresponding_regions_merged
[       OK ] HexagonBuffer.macro_copies_adjacent_corresponding_regions_merged (0 ms)
[ RUN      ] HexagonBuffer.macro_copies_discontiguous_regions_not_merged
[       OK ] HexagonBuffer.macro_copies_discontiguous_regions_not_merged (0 ms)
[ RUN      ] HexagonBuffer.macro_copies_overlapping_regions_merged
[       OK ] HexagonBuffer.macro_copies_overlapping_regions_merged (0 ms)
[ RUN      ] HexagonBuffer.copy_from
[       OK ] HexagonBuffer.copy_from (0 ms)
[ RUN      ] HexagonBuffer.copy_from_invalid_size
[       OK ] HexagonBuffer.copy_from_invalid_size (0 ms)
[ RUN      ] HexagonBuffer.copy_from_smaller_size
[       OK ] HexagonBuffer.copy_from_smaller_size (0 ms)
[ RUN      ] HexagonBuffer.nd
[       OK ] HexagonBuffer.nd (0 ms)
[ RUN      ] HexagonBuffer.nd_copy_from
[       OK ] HexagonBuffer.nd_copy_from (0 ms)
[ RUN      ] HexagonBuffer.1d_copy_from_1d
[       OK ] HexagonBuffer.1d_copy_from_1d (0 ms)
[ RUN      ] HexagonBuffer.2d_copy_from_1d
[       OK ] HexagonBuffer.2d_copy_from_1d (0 ms)
[ RUN      ] HexagonBuffer.1d_copy_from_2d
[       OK ] HexagonBuffer.1d_copy_from_2d (0 ms)
[ RUN      ] HexagonBuffer.nd_copy_from_nd_invalid_size
[       OK ] HexagonBuffer.nd_copy_from_nd_invalid_size (0 ms)
[ RUN      ] HexagonBuffer.nd_copy_from_nd_smaller_size
[       OK ] HexagonBuffer.nd_copy_from_nd_smaller_size (0 ms)
[ RUN      ] HexagonBuffer.md_copy_from_nd
[       OK ] HexagonBuffer.md_copy_from_nd (0 ms)
[ RUN      ] HexagonBuffer.copy_to
[       OK ] HexagonBuffer.copy_to (0 ms)
[ RUN      ] HexagonBuffer.nd_copy_to
[       OK ] HexagonBuffer.nd_copy_to (0 ms)
[----------] 27 test(s) from HexagonBuffer (0 ms total)
[==========] 27 test(s) from 1 test suite(s) ran. (0 ms total)
[  PASSED  ] 27 test(s)

cc @mehrdadh

@github-actions github-actions bot requested a review from mehrdadh May 9, 2022 21:46
@mehrdadh
Copy link
Member

mehrdadh commented May 9, 2022

@adstraw how come this doesn't fail since we disabled gtest on hexagon?
https://github.com/apache/tvm/blob/main/tests/scripts/task_build_hexagon_api.sh

@supersat
Copy link
Contributor

supersat commented May 9, 2022

@mehrdadh This only works on the simulator. I will create a separate PR to fix #11237 and re-enable hardware tests

@adstraw
Copy link
Contributor Author

adstraw commented May 10, 2022

This PR is now failing in CI due to name change of the top-level python test from unit_test.py to test_run_unit_tests.py. Needed the test_ prefix to be able to run this test in CI. This PR is not blocked behind the fix for #11237 which @supersat will fix.

@adstraw adstraw force-pushed the straw-capture-gtest-output branch from 772d7ce to c20a060 Compare May 10, 2022 18:15
@adstraw
Copy link
Contributor Author

adstraw commented May 10, 2022

Thought of a better solution that would allow us to land this PR before fixing #11237. Latest commit skips the unit tests if $USE_HEXAGON_GTEST is not set in the environment. This should allow CI to pass because we aren't currently setting that flag so test will be skipped.

Copy link
Member

@mehrdadh mehrdadh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Let's test it on hardware CI as well before merging

Copy link
Member

@mehrdadh mehrdadh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks!

@mehrdadh mehrdadh merged commit 1a8c64b into apache:main May 11, 2022
@adstraw adstraw deleted the straw-capture-gtest-output branch May 11, 2022 23:36
mehrdadh pushed a commit to mehrdadh/tvm that referenced this pull request May 16, 2022
* [Hexagon] capture gtest output and return over FFI

* rename to test_hexagon_unit_tests.py so it will run in CI

* rename to run_unit_tests.cc

* pass back gtest error code along with gtest output

* skip Hexagon unit tests if gtest not enabled

* pass gtest_args as pytest argument

* change env variable to HEXAGON_GTEST

* set HEXAGON_GTEST in the environment to enable Hexagon unit tests

* add back try / except around get_function
shtinsa pushed a commit to Deelvin/tvm that referenced this pull request May 17, 2022
* [Hexagon] capture gtest output and return over FFI

* rename to test_hexagon_unit_tests.py so it will run in CI

* rename to run_unit_tests.cc

* pass back gtest error code along with gtest output

* skip Hexagon unit tests if gtest not enabled

* pass gtest_args as pytest argument

* change env variable to HEXAGON_GTEST

* set HEXAGON_GTEST in the environment to enable Hexagon unit tests

* add back try / except around get_function
shingjan pushed a commit to shingjan/tvm that referenced this pull request May 17, 2022
* [Hexagon] capture gtest output and return over FFI

* rename to test_hexagon_unit_tests.py so it will run in CI

* rename to run_unit_tests.cc

* pass back gtest error code along with gtest output

* skip Hexagon unit tests if gtest not enabled

* pass gtest_args as pytest argument

* change env variable to HEXAGON_GTEST

* set HEXAGON_GTEST in the environment to enable Hexagon unit tests

* add back try / except around get_function
SebastianBoblest pushed a commit to SebastianBoblest/tvm that referenced this pull request May 27, 2022
* [Hexagon] capture gtest output and return over FFI

* rename to test_hexagon_unit_tests.py so it will run in CI

* rename to run_unit_tests.cc

* pass back gtest error code along with gtest output

* skip Hexagon unit tests if gtest not enabled

* pass gtest_args as pytest argument

* change env variable to HEXAGON_GTEST

* set HEXAGON_GTEST in the environment to enable Hexagon unit tests

* add back try / except around get_function
juda pushed a commit to juda/tvm that referenced this pull request Jun 21, 2022
* [Hexagon] capture gtest output and return over FFI

* rename to test_hexagon_unit_tests.py so it will run in CI

* rename to run_unit_tests.cc

* pass back gtest error code along with gtest output

* skip Hexagon unit tests if gtest not enabled

* pass gtest_args as pytest argument

* change env variable to HEXAGON_GTEST

* set HEXAGON_GTEST in the environment to enable Hexagon unit tests

* add back try / except around get_function
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants