diff options
author | Slava Shklyaev <slavash@google.com> | 2019-11-26 11:07:47 +0000 |
---|---|---|
committer | Slava Shklyaev <slavash@google.com> | 2019-12-04 11:12:40 +0000 |
commit | e7eedfa73c4dca5699782c4d9a0c458da587bb08 (patch) | |
tree | dff65900ac20370d35dd68101e3a8504093dd680 /nn/runtime/test/LogTestCaseToLogcat.h | |
parent | 0e4ef8137aa66717592d03504b525461240cf25b (diff) | |
download | ml-e7eedfa73c4dca5699782c4d9a0c458da587bb08.tar.gz |
Log test case to logcat
Sample output:
I NeuralNetworksTest: useCpuOnly = 0, computeMode = ComputeMode::SYNC, allowSyncExecHal = 0 // pass 0
I NeuralNetworksTest: [Test Case] OperationValidationTest.ADD_float16 BEGIN
...
I NeuralNetworksTest: [Test Case] OperationValidationTest.ADD_float16 END
I NeuralNetworksTest: [Test Case] OperationValidationTest.ADD_float32 BEGIN
...
Bug: 145183949
Test: NNT_static
Test: CtsNNAPITestCases
Change-Id: I923ed709e4f3450c6795cfb5e956a32f4a0f6bd1
Diffstat (limited to 'nn/runtime/test/LogTestCaseToLogcat.h')
-rw-r--r-- | nn/runtime/test/LogTestCaseToLogcat.h | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/nn/runtime/test/LogTestCaseToLogcat.h b/nn/runtime/test/LogTestCaseToLogcat.h new file mode 100644 index 000000000..6f6ae24ba --- /dev/null +++ b/nn/runtime/test/LogTestCaseToLogcat.h @@ -0,0 +1,39 @@ +/* + * Copyright (C) 2019 The Android Open Source Project + * + * Licensed 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. + */ + +#ifndef ANDROID_FRAMEWORKS_ML_NN_RUNTIME_TEST_LOG_TEST_CASE_TO_LOGCAT_H +#define ANDROID_FRAMEWORKS_ML_NN_RUNTIME_TEST_LOG_TEST_CASE_TO_LOGCAT_H + +#include <android-base/logging.h> +#include <gtest/gtest.h> + +namespace android::nn { + +class LogTestCaseToLogcat : public ::testing::EmptyTestEventListener { + virtual void OnTestStart(const ::testing::TestInfo& test_info) { + LOG(INFO) << "[Test Case] " << test_info.test_suite_name() << "." << test_info.name() + << " BEGIN"; + } + + virtual void OnTestEnd(const ::testing::TestInfo& test_info) { + LOG(INFO) << "[Test Case] " << test_info.test_suite_name() << "." << test_info.name() + << " END"; + } +}; + +} // namespace android::nn + +#endif // ANDROID_FRAMEWORKS_ML_NN_RUNTIME_TEST_LOG_TEST_CASE_TO_LOGCAT_H |