| OLD | NEW |
| 1 // Copyright 2008 the V8 project authors. All rights reserved. | 1 // Copyright 2008 the V8 project authors. All rights reserved. |
| 2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
| 3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
| 4 // met: | 4 // met: |
| 5 // | 5 // |
| 6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
| 7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
| 8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
| 9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
| 10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
| (...skipping 24 matching lines...) Expand all Loading... |
| 35 static void Test##Name() | 35 static void Test##Name() |
| 36 #endif | 36 #endif |
| 37 | 37 |
| 38 #ifndef DISABLED_TEST | 38 #ifndef DISABLED_TEST |
| 39 #define DISABLED_TEST(Name) \ | 39 #define DISABLED_TEST(Name) \ |
| 40 static void Test##Name(); \ | 40 static void Test##Name(); \ |
| 41 CcTest register_test_##Name(Test##Name, __FILE__, #Name, false); \ | 41 CcTest register_test_##Name(Test##Name, __FILE__, #Name, false); \ |
| 42 static void Test##Name() | 42 static void Test##Name() |
| 43 #endif | 43 #endif |
| 44 | 44 |
| 45 | |
| 46 class CcTest { | 45 class CcTest { |
| 47 public: | 46 public: |
| 48 typedef void (TestFunction)(); | 47 typedef void (TestFunction)(); |
| 49 CcTest(TestFunction* callback, const char* file, const char* name, | 48 CcTest(TestFunction* callback, const char* file, const char* name, |
| 50 bool enabled); | 49 bool enabled); |
| 51 void Run() { callback_(); } | 50 void Run() { callback_(); } |
| 52 static int test_count(); | 51 static int test_count(); |
| 53 static CcTest* last() { return last_; } | 52 static CcTest* last() { return last_; } |
| 54 CcTest* prev() { return prev_; } | 53 CcTest* prev() { return prev_; } |
| 55 const char* file() { return file_; } | 54 const char* file() { return file_; } |
| 56 const char* name() { return name_; } | 55 const char* name() { return name_; } |
| 57 bool enabled() { return enabled_; } | 56 bool enabled() { return enabled_; } |
| 58 private: | 57 private: |
| 59 TestFunction* callback_; | 58 TestFunction* callback_; |
| 60 const char* file_; | 59 const char* file_; |
| 61 const char* name_; | 60 const char* name_; |
| 62 bool enabled_; | 61 bool enabled_; |
| 63 static CcTest* last_; | 62 static CcTest* last_; |
| 64 CcTest* prev_; | 63 CcTest* prev_; |
| 65 }; | 64 }; |
| 66 | 65 |
| 67 #endif // ifndef CCTEST_H_ | 66 #endif // ifndef CCTEST_H_ |
| OLD | NEW |