Iterate on test setup

This commit is contained in:
Nick Gerleman
2022-12-24 00:25:02 -08:00
parent 0a82167c30
commit 0f67a0a458
38 changed files with 36 additions and 61 deletions

View File

@@ -5,9 +5,8 @@
* LICENSE file in the root directory of this source tree.
*/
var Yoga = Yoga || require("../../dist/entry-" + process.env.TEST_ENTRY);
var ITERATIONS = 2000;
const ITERATIONS = 2000;
const YGBENCHMARK = global.YGBENCHMARK ?? global.test;
YGBENCHMARK("Stack with flex", function() {
var root = Yoga.Node.create();

View File

@@ -1361,7 +1361,7 @@ it("align_baseline_multiline_column", function () {
console.assert(50 === root_child0.getComputedWidth(), "50 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
console.assert(50 === root_child0.getComputedHeight(), "50 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
console.assert(70 === root_child1.getComputedLeft(), "70 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")");
console.assert(50 === root_child1.getComputedLeft(), "50 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")");
console.assert(50 === root_child1.getComputedTop(), "50 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")");
console.assert(30 === root_child1.getComputedWidth(), "30 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")");
console.assert(50 === root_child1.getComputedHeight(), "50 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")");
@@ -1371,7 +1371,7 @@ it("align_baseline_multiline_column", function () {
console.assert(20 === root_child1_child0.getComputedWidth(), "20 === root_child1_child0.getComputedWidth() (" + root_child1_child0.getComputedWidth() + ")");
console.assert(20 === root_child1_child0.getComputedHeight(), "20 === root_child1_child0.getComputedHeight() (" + root_child1_child0.getComputedHeight() + ")");
console.assert(10 === root_child2.getComputedLeft(), "10 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")");
console.assert(0 === root_child2.getComputedLeft(), "0 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")");
console.assert(0 === root_child2.getComputedTop(), "0 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")");
console.assert(40 === root_child2.getComputedWidth(), "40 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")");
console.assert(70 === root_child2.getComputedHeight(), "70 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")");
@@ -1481,7 +1481,7 @@ it("align_baseline_multiline_column2", function () {
console.assert(50 === root_child0.getComputedWidth(), "50 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
console.assert(50 === root_child0.getComputedHeight(), "50 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
console.assert(70 === root_child1.getComputedLeft(), "70 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")");
console.assert(50 === root_child1.getComputedLeft(), "50 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")");
console.assert(50 === root_child1.getComputedTop(), "50 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")");
console.assert(30 === root_child1.getComputedWidth(), "30 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")");
console.assert(50 === root_child1.getComputedHeight(), "50 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")");
@@ -1491,7 +1491,7 @@ it("align_baseline_multiline_column2", function () {
console.assert(20 === root_child1_child0.getComputedWidth(), "20 === root_child1_child0.getComputedWidth() (" + root_child1_child0.getComputedWidth() + ")");
console.assert(20 === root_child1_child0.getComputedHeight(), "20 === root_child1_child0.getComputedHeight() (" + root_child1_child0.getComputedHeight() + ")");
console.assert(10 === root_child2.getComputedLeft(), "10 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")");
console.assert(0 === root_child2.getComputedLeft(), "0 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")");
console.assert(0 === root_child2.getComputedTop(), "0 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")");
console.assert(40 === root_child2.getComputedWidth(), "40 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")");
console.assert(70 === root_child2.getComputedHeight(), "70 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")");

View File

@@ -1,34 +0,0 @@
<html>
<script>
function it(name, func) {
console.log(name);
func();
}
function YGBENCHMARK(name, func) {
console.log(name);
func();
}
</script>
<script src="../dist/Yoga.bundle.js"></script>
<script src="./tools.js"></script>
<script src="./Facebook.Yoga/YGAbsolutePositionTest.js"></script>
<script src="./Facebook.Yoga/YGAlignContentTest.js"></script>
<script src="./Facebook.Yoga/YGAlignItemsTest.js"></script>
<script src="./Facebook.Yoga/YGAlignSelfTest.js"></script>
<script src="./Facebook.Yoga/YGBorderTest.js"></script>
<script src="./Facebook.Yoga/YGFlexDirectionTest.js"></script>
<script src="./Facebook.Yoga/YGFlexTest.js"></script>
<script src="./Facebook.Yoga/YGFlexWrapTest.js"></script>
<script src="./Facebook.Yoga/YGJustifyContentTest.js"></script>
<script src="./Facebook.Yoga/YGMarginTest.js"></script>
<script src="./Facebook.Yoga/YGMinMaxDimensionTest.js"></script>
<script src="./Facebook.Yoga/YGPaddingTest.js"></script>
<script src="./Facebook.Yoga/YGRoundingTest.js"></script>
<script src="./Benchmarks/YGBenchmark.js"></script>
</html>