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
This commit is contained in:
Emil Sjolander
2016-08-26 10:22:58 -07:00
committed by Facebook Github Bot 6
parent 89c00a7a3b
commit e3fa40e694
10 changed files with 45 additions and 44 deletions

View File

@@ -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,