* Adds a test to the TestQueue for execution. * @param {Function} testTasksFunc * @param {Boolean} prioritize * @param {String} seed
(testTasksFunc, prioritize, seed)
| 2675 | * @param {String} seed |
| 2676 | */ |
| 2677 | function addToTestQueue(testTasksFunc, prioritize, seed) { |
| 2678 | if (prioritize) { |
| 2679 | config.queue.splice(priorityCount++, 0, testTasksFunc); |
| 2680 | } else if (seed) { |
| 2681 | if (!unitSampler) { |
| 2682 | unitSampler = unitSamplerGenerator(seed); |
| 2683 | } |
| 2684 | |
| 2685 | // Insert into a random position after all prioritized items |
| 2686 | var index = Math.floor(unitSampler() * (config.queue.length - priorityCount + 1)); |
| 2687 | config.queue.splice(priorityCount + index, 0, testTasksFunc); |
| 2688 | } else { |
| 2689 | config.queue.push(testTasksFunc); |
| 2690 | } |
| 2691 | } |
| 2692 | |
| 2693 | /** |
| 2694 | * Creates a seeded "sample" generator which is used for randomizing tests. |
nothing calls this directly
no test coverage detected