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 { TempDir()11std::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 RegisterTest(void (* fn)(void),const char * name)22void RegisterTest(void (*fn)(void), const char *name) { 23 tests[ntests].fn = fn; 24 tests[ntests++].name = name; 25 } 26 main(int argc,char ** argv)27int 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 } 35