Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 #include <stdint.h> | |
|
antonm
2010/01/21 13:10:45
shouldn't those be moved into test dir?
Alexandre
2010/01/22 23:08:42
Yes they should. I'll remove it.
On 2010/01/21 13:
| |
| 2 | |
| 3 #include <v8.h> | |
| 4 | |
| 5 #include "test-interface-mips.h" | |
| 6 | |
| 7 using namespace v8; | |
| 8 | |
| 9 | |
| 10 // Functions corresponding to different tests. | |
| 11 int RunTest1(); | |
| 12 | |
| 13 int main(int argc, char* argv[]) { | |
| 14 | |
| 15 int32_t test = 1; | |
| 16 | |
| 17 switch(test) { | |
| 18 case 1: | |
| 19 printf("case 1.\n"); | |
| 20 return RunTest1(); | |
| 21 default: | |
| 22 printf("No test to run.\n"); | |
| 23 return -1; | |
| 24 }; | |
| 25 | |
| 26 return -1; | |
| 27 } | |
| 28 | |
| 29 int RunTest1() { | |
| 30 // Create a stack-allocated handle scope. | |
| 31 HandleScope handle_scope; | |
| 32 | |
| 33 // Create a new context. | |
| 34 Persistent<Context> context = Context::New(); | |
| 35 | |
| 36 // Enter the created context for compiling and | |
| 37 // running the hello world script. | |
| 38 Context::Scope context_scope(context); | |
| 39 | |
| 40 // Call the test | |
| 41 TestMIPS1(); | |
| 42 | |
| 43 // Dispose the persistent context. | |
| 44 context.Dispose(); | |
| 45 | |
| 46 return 0; | |
| 47 } | |
| OLD | NEW |