third_party/re2/util/test.cc
Go to the documentation of this file.
1 // Copyright 2009 The RE2 Authors. All Rights Reserved.
2 // Use of this source code is governed by a BSD-style
3 // license that can be found in the LICENSE file.
4 
5 #include <stdio.h>
6 #include <string>
7 
8 #include "util/test.h"
9 
10 namespace testing {
11 std::string TempDir() { return "/tmp/"; }
12 } // namespace testing
13 
14 struct Test {
15  void (*fn)(void);
16  const char *name;
17 };
18 
19 static Test tests[10000];
20 static int ntests;
21 
22 void RegisterTest(void (*fn)(void), const char *name) {
23  tests[ntests].fn = fn;
24  tests[ntests++].name = name;
25 }
26 
27 int main(int argc, char** argv) {
28  for (int i = 0; i < ntests; i++) {
29  printf("%s\n", tests[i].name);
30  tests[i].fn();
31  }
32  printf("PASS\n");
33  return 0;
34 }
testing
Definition: aws_request_signer_test.cc:25
testing::TempDir
GTEST_API_ std::string TempDir()
Definition: bloaty/third_party/googletest/googletest/src/gtest.cc:6140
printf
_Use_decl_annotations_ int __cdecl printf(const char *_Format,...)
Definition: cs_driver.c:91
testing::internal::string
::std::string string
Definition: bloaty/third_party/protobuf/third_party/googletest/googletest/include/gtest/internal/gtest-port.h:881
setup.name
name
Definition: setup.py:542
ntests
static int ntests
Definition: third_party/re2/util/test.cc:20
main
int main(int argc, char **argv)
Definition: third_party/re2/util/test.cc:27
generate-asm-lcov.fn
fn
Definition: generate-asm-lcov.py:146
Test::fn
void(* fn)(void)
Definition: third_party/bloaty/third_party/re2/util/test.cc:12
RegisterTest
void RegisterTest(void(*fn)(void), const char *name)
Definition: third_party/re2/util/test.cc:22
Test::name
const char * name
Definition: third_party/bloaty/third_party/re2/util/test.cc:13
tests
Definition: src/python/grpcio_tests/tests/__init__.py:1
Test
Definition: hpack_parser_test.cc:43
i
uint64_t i
Definition: abseil-cpp/absl/container/btree_benchmark.cc:230


grpc
Author(s):
autogenerated on Fri May 16 2025 03:00:27