1//===-- Main function for implementation of base class for libc unittests -===//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8
9#include "LibcTest.h"
10
11static const char *getTestFilter(int argc, char *argv[]) {
12 return argc > 1 ? argv[1] : nullptr;
13}
14
15extern "C" int main(int argc, char **argv, char **envp) {
16 LIBC_NAMESPACE::testing::argc = argc;
17 LIBC_NAMESPACE::testing::argv = argv;
18 LIBC_NAMESPACE::testing::envp = envp;
19
20 const char *TestFilter = getTestFilter(argc, argv);
21 return LIBC_NAMESPACE::testing::Test::runTests(TestFilter);
22}
23

source code of libc/test/UnitTest/LibcTestMain.cpp