Chromium Code Reviews| Index: src/mips/test-interface-mips.cc |
| =================================================================== |
| --- src/mips/test-interface-mips.cc (revision 0) |
| +++ src/mips/test-interface-mips.cc (revision 0) |
| @@ -0,0 +1,47 @@ |
| +#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:
|
| + |
| +#include <v8.h> |
| + |
| +#include "test-interface-mips.h" |
| + |
| +using namespace v8; |
| + |
| + |
| +// Functions corresponding to different tests. |
| +int RunTest1(); |
| + |
| +int main(int argc, char* argv[]) { |
| + |
| + int32_t test = 1; |
| + |
| + switch(test) { |
| + case 1: |
| + printf("case 1.\n"); |
| + return RunTest1(); |
| + default: |
| + printf("No test to run.\n"); |
| + return -1; |
| + }; |
| + |
| + return -1; |
| +} |
| + |
| +int RunTest1() { |
| + // Create a stack-allocated handle scope. |
| + HandleScope handle_scope; |
| + |
| + // Create a new context. |
| + Persistent<Context> context = Context::New(); |
| + |
| + // Enter the created context for compiling and |
| + // running the hello world script. |
| + Context::Scope context_scope(context); |
| + |
| + // Call the test |
| + TestMIPS1(); |
| + |
| + // Dispose the persistent context. |
| + context.Dispose(); |
| + |
| + return 0; |
| +} |