From e3fa40e6945e6747571268bd6dcfba1dde08b97c Mon Sep 17 00:00:00 2001 From: Emil Sjolander Date: Fri, 26 Aug 2016 10:22:58 -0700 Subject: [PATCH] Allow specifying the test name in the input to gentest Summary: Allow adding test name within html through the id of the root element. This makes it much easier to re-generate test files. Differential Revision: D3771966 fbshipit-source-id: 313e1648dcf4521e7c649f54c4ced2aa3297bf06 --- gentest/gentest.js | 3 ++- tests/CSSLayoutAbsolutePositionTest.cpp | 8 ++++---- tests/CSSLayoutAlignContentTest.cpp | 8 ++++---- tests/CSSLayoutAlignItemsTest.cpp | 8 ++++---- tests/CSSLayoutAlignSelfTest.cpp | 8 ++++---- tests/CSSLayoutFlexDirectionTest.cpp | 12 ++++++------ tests/CSSLayoutFlexTest.cpp | 10 +++++----- tests/CSSLayoutFlexWrapTest.cpp | 4 ++-- tests/CSSLayoutJustifyContentTest.cpp | 20 ++++++++++---------- tests/CSSLayoutMinMaxDimensionTest.cpp | 8 ++++---- 10 files changed, 45 insertions(+), 44 deletions(-) diff --git a/gentest/gentest.js b/gentest/gentest.js index e8fd15a9..ac1f720f 100755 --- a/gentest/gentest.js +++ b/gentest/gentest.js @@ -50,7 +50,7 @@ function printTest(rootNode, layoutTree) { })); for (var i = 0; i < layoutTree.length - 1; i++) { - lines.push('TEST(CSSLayoutTest, INSERT_NAME_HERE) {'); + lines.push('TEST(CSSLayoutTest, ' + layoutTree[i].name + ') {'); lines.push(' ' + setupTestTree(layoutTree[i], 'root', null).reduce(function(curr, prev) { return curr + '\n ' + prev; @@ -346,6 +346,7 @@ function calculateTree(root) { for (var i = 0; i < root.children.length; i++) { var child = root.children[i]; rootLayout.push({ + name: child.id !== '' ? child.id : 'INSERT_NAME_HERE', left: child.offsetLeft, top: child.offsetTop, width: child.offsetWidth, diff --git a/tests/CSSLayoutAbsolutePositionTest.cpp b/tests/CSSLayoutAbsolutePositionTest.cpp index aa104eee..ee27c93c 100644 --- a/tests/CSSLayoutAbsolutePositionTest.cpp +++ b/tests/CSSLayoutAbsolutePositionTest.cpp @@ -10,16 +10,16 @@ /** * @Generated by gentest/gentest.sh with the following input * - *
+ *
*
*
- *
+ *
*
*
- *
+ *
*
*
- *
+ *
*
*
* diff --git a/tests/CSSLayoutAlignContentTest.cpp b/tests/CSSLayoutAlignContentTest.cpp index 60b79cdd..fc038b6f 100644 --- a/tests/CSSLayoutAlignContentTest.cpp +++ b/tests/CSSLayoutAlignContentTest.cpp @@ -10,28 +10,28 @@ /** * @Generated by gentest/gentest.sh with the following input * - *
+ *
*
*
*
*
*
*
- *
+ *
*
*
*
*
*
*
- *
+ *
*
*
*
*
*
*
- *
+ *
*
*
*
diff --git a/tests/CSSLayoutAlignItemsTest.cpp b/tests/CSSLayoutAlignItemsTest.cpp index 1556aa5a..2fe95785 100644 --- a/tests/CSSLayoutAlignItemsTest.cpp +++ b/tests/CSSLayoutAlignItemsTest.cpp @@ -10,16 +10,16 @@ /** * @Generated by gentest/gentest.sh with the following input * - *
+ *
*
*
- *
+ *
*
*
- *
+ *
*
*
- *
+ *
*
*
* diff --git a/tests/CSSLayoutAlignSelfTest.cpp b/tests/CSSLayoutAlignSelfTest.cpp index 45a3c33b..256fc9fb 100644 --- a/tests/CSSLayoutAlignSelfTest.cpp +++ b/tests/CSSLayoutAlignSelfTest.cpp @@ -10,16 +10,16 @@ /** * @Generated by gentest/gentest.sh with the following input * - *
+ *
*
*
- *
+ *
*
*
- *
+ *
*
*
- *
+ *
*
*
* diff --git a/tests/CSSLayoutFlexDirectionTest.cpp b/tests/CSSLayoutFlexDirectionTest.cpp index 31e37017..aab5ca80 100644 --- a/tests/CSSLayoutFlexDirectionTest.cpp +++ b/tests/CSSLayoutFlexDirectionTest.cpp @@ -10,32 +10,32 @@ /** * @Generated by gentest/gentest.sh with the following input * - *
+ *
*
*
*
*
- *
+ *
*
*
*
*
- *
+ *
*
*
*
*
- *
+ *
*
*
*
*
- *
+ *
*
*
*
*
- *
+ *
*
*
*
diff --git a/tests/CSSLayoutFlexTest.cpp b/tests/CSSLayoutFlexTest.cpp index 7e10c040..ef0923b5 100644 --- a/tests/CSSLayoutFlexTest.cpp +++ b/tests/CSSLayoutFlexTest.cpp @@ -10,23 +10,23 @@ /** * @Generated by gentest/gentest.sh with the following input * - *
+ *
*
*
*
- *
+ *
*
*
*
- *
+ *
*
*
*
- *
+ *
*
*
*
- *
+ *
*
*
*
diff --git a/tests/CSSLayoutFlexWrapTest.cpp b/tests/CSSLayoutFlexWrapTest.cpp index 1c6f6282..41140158 100644 --- a/tests/CSSLayoutFlexWrapTest.cpp +++ b/tests/CSSLayoutFlexWrapTest.cpp @@ -10,13 +10,13 @@ /** * @Generated by gentest/gentest.sh with the following input * - *
+ *
*
*
*
*
*
- *
+ *
*
*
*
diff --git a/tests/CSSLayoutJustifyContentTest.cpp b/tests/CSSLayoutJustifyContentTest.cpp index 08b6c3dd..15047bc6 100644 --- a/tests/CSSLayoutJustifyContentTest.cpp +++ b/tests/CSSLayoutJustifyContentTest.cpp @@ -10,52 +10,52 @@ /** * @Generated by gentest/gentest.sh with the following input * - *
+ *
*
*
*
*
- *
+ *
*
*
*
*
- *
+ *
*
*
*
*
- *
+ *
*
*
*
*
- *
+ *
*
*
*
*
- *
+ *
*
*
*
*
- *
+ *
*
*
*
*
- *
+ *
*
*
*
*
- *
+ *
*
*
*
*
- *
+ *
*
*
*
diff --git a/tests/CSSLayoutMinMaxDimensionTest.cpp b/tests/CSSLayoutMinMaxDimensionTest.cpp index 382a6686..940181fe 100644 --- a/tests/CSSLayoutMinMaxDimensionTest.cpp +++ b/tests/CSSLayoutMinMaxDimensionTest.cpp @@ -10,17 +10,17 @@ /** * @Generated by gentest/gentest.sh with the following input * - *
+ *
*
*
- *
+ *
*
*
- *
+ *
*
*
*
- *
+ *
*
*
*