Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(134)

Side by Side Diff: test/cctest/cctest.h

Issue 11015008: Fix cctests using Sockets to be able to run in parallel (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 8 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | test/cctest/cctest.status » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 195 matching lines...) Expand 10 before | Expand all | Expand 10 after
206 static inline v8::Local<v8::Script> v8_compile(const char* x) { 206 static inline v8::Local<v8::Script> v8_compile(const char* x) {
207 return v8::Script::Compile(v8_str(x)); 207 return v8::Script::Compile(v8_str(x));
208 } 208 }
209 209
210 210
211 // Helper function that compiles and runs the source. 211 // Helper function that compiles and runs the source.
212 static inline v8::Local<v8::Value> CompileRun(const char* source) { 212 static inline v8::Local<v8::Value> CompileRun(const char* source) {
213 return v8::Script::Compile(v8::String::New(source))->Run(); 213 return v8::Script::Compile(v8::String::New(source))->Run();
214 } 214 }
215 215
216
216 // Helper function that compiles and runs the source with given origin. 217 // Helper function that compiles and runs the source with given origin.
217 static inline v8::Local<v8::Value> CompileRunWithOrigin(const char* source, 218 static inline v8::Local<v8::Value> CompileRunWithOrigin(const char* source,
218 const char* origin_url, 219 const char* origin_url,
219 int line_number, 220 int line_number,
220 int column_number) { 221 int column_number) {
221 v8::ScriptOrigin origin(v8::String::New(origin_url), 222 v8::ScriptOrigin origin(v8::String::New(origin_url),
222 v8::Integer::New(line_number), 223 v8::Integer::New(line_number),
223 v8::Integer::New(column_number)); 224 v8::Integer::New(column_number));
224 return v8::Script::Compile(v8::String::New(source), &origin)->Run(); 225 return v8::Script::Compile(v8::String::New(source), &origin)->Run();
225 } 226 }
226 227
227 228
229 // Pick a slightly different port to allow tests to be run in parallel.
230 static inline int FlagDependentPortOffset() {
231 return ::v8::internal::FLAG_crankshaft == false ? 100 :
232 ::v8::internal::FLAG_always_opt ? 200 : 0;
233 }
234
235
228 #endif // ifndef CCTEST_H_ 236 #endif // ifndef CCTEST_H_
OLDNEW
« no previous file with comments | « no previous file | test/cctest/cctest.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698