xref: /aosp_15_r20/external/executorch/test/utils/UnitTestMain.cpp (revision 523fa7a60841cd1ecfb9cc4201f1ca8b03ed023a)
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 /**
10  * @file
11  * Custom main function for unit test executables.
12  */
13 
14 #include <executorch/runtime/platform/compiler.h>
15 #include <executorch/runtime/platform/runtime.h>
16 #include <gtest/gtest.h>
17 
18 // Define main as a weak symbol to allow trivial overriding.
19 int main(int argc, char** argv) ET_WEAK;
20 
main(int argc,char ** argv)21 int main(int argc, char** argv) {
22   ::testing::InitGoogleTest(&argc, argv);
23   torch::executor::runtime_init();
24   return RUN_ALL_TESTS();
25 }
26