| OLD | NEW |
| 1 // Copyright 2007-2008 the V8 project authors. All rights reserved. | 1 // Copyright 2007-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 4462 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4473 // If it was the last then signal that fact. | 4473 // If it was the last then signal that fact. |
| 4474 if (active_tests_ == 0) { | 4474 if (active_tests_ == 0) { |
| 4475 all_tests_done_->Signal(); | 4475 all_tests_done_->Signal(); |
| 4476 } else { | 4476 } else { |
| 4477 // Otherwise select a new test and start that. | 4477 // Otherwise select a new test and start that. |
| 4478 NextThread(); | 4478 NextThread(); |
| 4479 } | 4479 } |
| 4480 } | 4480 } |
| 4481 | 4481 |
| 4482 | 4482 |
| 4483 DECLARE_int(prng_seed); | |
| 4484 DEFINE_int(prng_seed, 42, "Seed used for threading test randomness"); | |
| 4485 | |
| 4486 | |
| 4487 static unsigned linear_congruential_generator; | 4483 static unsigned linear_congruential_generator; |
| 4488 | 4484 |
| 4489 | 4485 |
| 4490 void ApiTestFuzzer::Setup(PartOfTest part) { | 4486 void ApiTestFuzzer::Setup(PartOfTest part) { |
| 4491 linear_congruential_generator = FLAG_prng_seed; | 4487 linear_congruential_generator = i::FLAG_testing_prng_seed; |
| 4492 fuzzing_ = true; | 4488 fuzzing_ = true; |
| 4493 int start = (part == FIRST_PART) ? 0 : (RegisterThreadedTest::count() >> 1); | 4489 int start = (part == FIRST_PART) ? 0 : (RegisterThreadedTest::count() >> 1); |
| 4494 int end = (part == FIRST_PART) | 4490 int end = (part == FIRST_PART) |
| 4495 ? (RegisterThreadedTest::count() >> 1) | 4491 ? (RegisterThreadedTest::count() >> 1) |
| 4496 : RegisterThreadedTest::count(); | 4492 : RegisterThreadedTest::count(); |
| 4497 active_tests_ = tests_being_run_ = end - start; | 4493 active_tests_ = tests_being_run_ = end - start; |
| 4498 for (int i = 0; i < tests_being_run_; i++) { | 4494 for (int i = 0; i < tests_being_run_; i++) { |
| 4499 RegisterThreadedTest::nth(i)->fuzzer_ = new ApiTestFuzzer(i + start); | 4495 RegisterThreadedTest::nth(i)->fuzzer_ = new ApiTestFuzzer(i + start); |
| 4500 } | 4496 } |
| 4501 for (int i = 0; i < active_tests_; i++) { | 4497 for (int i = 0; i < active_tests_; i++) { |
| (...skipping 400 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4902 v8::Handle<v8::Script> script0 = | 4898 v8::Handle<v8::Script> script0 = |
| 4903 v8::Script::Compile(source0, v8::String::New("test.js")); | 4899 v8::Script::Compile(source0, v8::String::New("test.js")); |
| 4904 v8::Handle<v8::Script> script1 = | 4900 v8::Handle<v8::Script> script1 = |
| 4905 v8::Script::Compile(source1, v8::String::New("test.js")); | 4901 v8::Script::Compile(source1, v8::String::New("test.js")); |
| 4906 v8::Handle<v8::Script> script2 = | 4902 v8::Handle<v8::Script> script2 = |
| 4907 v8::Script::Compile(source0); // different origin | 4903 v8::Script::Compile(source0); // different origin |
| 4908 CHECK_EQ(1234, script0->Run()->Int32Value()); | 4904 CHECK_EQ(1234, script0->Run()->Int32Value()); |
| 4909 CHECK_EQ(1234, script1->Run()->Int32Value()); | 4905 CHECK_EQ(1234, script1->Run()->Int32Value()); |
| 4910 CHECK_EQ(1234, script2->Run()->Int32Value()); | 4906 CHECK_EQ(1234, script2->Run()->Int32Value()); |
| 4911 } | 4907 } |
| OLD | NEW |