xref: /third_party/mesa3d/src/gtest/src/gtest_main.cc (revision bf215546)
1bf215546Sopenharmony_ci// Copyright 2006, Google Inc.
2bf215546Sopenharmony_ci// All rights reserved.
3bf215546Sopenharmony_ci//
4bf215546Sopenharmony_ci// Redistribution and use in source and binary forms, with or without
5bf215546Sopenharmony_ci// modification, are permitted provided that the following conditions are
6bf215546Sopenharmony_ci// met:
7bf215546Sopenharmony_ci//
8bf215546Sopenharmony_ci//     * Redistributions of source code must retain the above copyright
9bf215546Sopenharmony_ci// notice, this list of conditions and the following disclaimer.
10bf215546Sopenharmony_ci//     * Redistributions in binary form must reproduce the above
11bf215546Sopenharmony_ci// copyright notice, this list of conditions and the following disclaimer
12bf215546Sopenharmony_ci// in the documentation and/or other materials provided with the
13bf215546Sopenharmony_ci// distribution.
14bf215546Sopenharmony_ci//     * Neither the name of Google Inc. nor the names of its
15bf215546Sopenharmony_ci// contributors may be used to endorse or promote products derived from
16bf215546Sopenharmony_ci// this software without specific prior written permission.
17bf215546Sopenharmony_ci//
18bf215546Sopenharmony_ci// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19bf215546Sopenharmony_ci// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
20bf215546Sopenharmony_ci// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
21bf215546Sopenharmony_ci// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
22bf215546Sopenharmony_ci// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
23bf215546Sopenharmony_ci// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
24bf215546Sopenharmony_ci// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25bf215546Sopenharmony_ci// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26bf215546Sopenharmony_ci// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27bf215546Sopenharmony_ci// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28bf215546Sopenharmony_ci// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29bf215546Sopenharmony_ci
30bf215546Sopenharmony_ci#include <cstdio>
31bf215546Sopenharmony_ci#include "gtest/gtest.h"
32bf215546Sopenharmony_ci
33bf215546Sopenharmony_ci#ifdef ARDUINO
34bf215546Sopenharmony_civoid setup() {
35bf215546Sopenharmony_ci  testing::InitGoogleTest();
36bf215546Sopenharmony_ci}
37bf215546Sopenharmony_ci
38bf215546Sopenharmony_civoid loop() { RUN_ALL_TESTS(); }
39bf215546Sopenharmony_ci
40bf215546Sopenharmony_ci#else
41bf215546Sopenharmony_ci
42bf215546Sopenharmony_ciGTEST_API_ int main(int argc, char **argv) {
43bf215546Sopenharmony_ci  printf("Running main() from %s\n", __FILE__);
44bf215546Sopenharmony_ci  testing::InitGoogleTest(&argc, argv);
45bf215546Sopenharmony_ci  return RUN_ALL_TESTS();
46bf215546Sopenharmony_ci}
47bf215546Sopenharmony_ci#endif
48