• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) Meta Platforms, Inc. and affiliates.
3  * All rights reserved.
4  *
5  * This source code is licensed under the BSD-style license found in the
6  * LICENSE file in the root directory of this source tree.
7  */
8 
9 #include <gtest/gtest.h>
10 
11 #include <executorch/runtime/platform/log.h>
12 #include <executorch/runtime/platform/runtime.h>
13 
14 using namespace executorch::runtime;
15 
16 class LoggingTest : public ::testing::Test {
17  public:
SetUpTestSuite()18   static void SetUpTestSuite() {
19     // Initialize runtime.
20     runtime_init();
21   }
22 };
23 
TEST_F(LoggingTest,LogLevels)24 TEST_F(LoggingTest, LogLevels) {
25   ET_LOG(Debug, "Debug log.");
26   ET_LOG(Info, "Info log.");
27   ET_LOG(Error, "Error log.");
28   ET_LOG(Fatal, "Fatal log.");
29 }
30 
TEST_F(LoggingTest,LogFormatting)31 TEST_F(LoggingTest, LogFormatting) {
32   ET_LOG(Info, "Sample log with integer: %u", 100);
33 }
34