diff --git a/tests/cpp-runtime/hexagon/run_unit_tests.cc b/tests/cpp-runtime/hexagon/run_unit_tests.cc index e409c441343ec..6ad770da3326b 100644 --- a/tests/cpp-runtime/hexagon/run_unit_tests.cc +++ b/tests/cpp-runtime/hexagon/run_unit_tests.cc @@ -108,8 +108,12 @@ TVM_REGISTER_GLOBAL("hexagon.run_unit_tests").set_body([](TVMArgs args, TVMRetVa testing::TestEventListeners& listeners = testing::UnitTest::GetInstance()->listeners(); listeners.Append(gprinter); - RUN_ALL_TESTS(); - *rv = gprinter->GetOutput(); + int gtest_error_code = RUN_ALL_TESTS(); + std::string gtest_output = gprinter->GetOutput(); + std::stringstream gtest_error_code_and_output; + gtest_error_code_and_output << gtest_error_code << std::endl; + gtest_error_code_and_output << gtest_output; + *rv = gtest_error_code_and_output.str(); delete gprinter; }); diff --git a/tests/python/contrib/test_hexagon/test_hexagon_unit_tests.py b/tests/python/contrib/test_hexagon/test_hexagon_unit_tests.py deleted file mode 100644 index 7e80d80579615..0000000000000 --- a/tests/python/contrib/test_hexagon/test_hexagon_unit_tests.py +++ /dev/null @@ -1,44 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - -import pytest -import numpy as np -from tvm.contrib.hexagon.build import HexagonLauncher -from .conftest import requires_hexagon_toolchain - - -@requires_hexagon_toolchain -def test_hexagon_unit_tests(hexagon_session): - # arguments to pass to gtest - # e.g. - # 1) to run all tests use: - # gtest_args = "" - # 2) to run all tests with "foo" in their name twice use: - # gtest_args = "--gtest_repeat=2 --gtest_filter=*foo*" - gtest_args = "" - try: - func = hexagon_session._rpc.get_function("hexagon.run_unit_tests") - result = func(gtest_args) - print(result) - except: - print( - "This test requires the USE_HEXAGON_GTEST cmake flag to be specified with a path to a Hexagon gtest version normally located at /path/to/hexagon/sdk/utils/googletest/gtest" - ) - result = "FAILED" - - # check if the unit tests "FAILED" - assert result.find("FAILED") == -1