// Copyright 2006, Google Inc.1// All rights reserved.2//3// Redistribution and use in source and binary forms, with or without4// modification, are permitted provided that the following conditions are5// met:6//7// * Redistributions of source code must retain the above copyright8// notice, this list of conditions and the following disclaimer.9// * Redistributions in binary form must reproduce the above10// copyright notice, this list of conditions and the following disclaimer11// in the documentation and/or other materials provided with the12// distribution.13// * Neither the name of Google Inc. nor the names of its14// contributors may be used to endorse or promote products derived from15// this software without specific prior written permission.16//17// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS18// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT19// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR20// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT21// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,22// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT23// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,24// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY25// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT26// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE27// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.2829#include <cstdio>3031#include "gtest/gtest.h"3233#if defined(GTEST_OS_ESP8266) || defined(GTEST_OS_ESP32) || \34(defined(GTEST_OS_NRF52) && defined(ARDUINO))35// Arduino-like platforms: program entry points are setup/loop instead of main.3637#ifdef GTEST_OS_ESP826638extern "C" {39#endif4041void setup() { testing::InitGoogleTest(); }4243void loop() { RUN_ALL_TESTS(); }4445#ifdef GTEST_OS_ESP826646}47#endif4849#elif defined(GTEST_OS_QURT)50// QuRT: program entry point is main, but argc/argv are unusable.5152GTEST_API_ int main() {53printf("Running main() from %s\n", __FILE__);54testing::InitGoogleTest();55return RUN_ALL_TESTS();56}57#else58// Normal platforms: program entry point is main, argc/argv are initialized.5960GTEST_API_ int main(int argc, char **argv) {61printf("Running main() from %s\n", __FILE__);62testing::InitGoogleTest(&argc, argv);63return RUN_ALL_TESTS();64}65#endif666768