diff --git a/gentest/gentest.js b/gentest/gentest.js index 198dcbb2..18199b95 100755 --- a/gentest/gentest.js +++ b/gentest/gentest.js @@ -8,10 +8,10 @@ */ window.onload = function() { - printTest(calculateTree(document.body.children[0])); + printTest(document.body.children[0], calculateTree(document.body.children[0])); } -function printTest(layoutTree) { +function printTest(rootNode, layoutTree) { var lines = [ '/**', ' * Copyright (c) 2014-present, Facebook, Inc.', @@ -22,11 +22,32 @@ function printTest(layoutTree) { ' * of patent rights can be found in the PATENTS file in the same directory.', ' */', '', + ]; + + lines.push('/**'); + lines.push(' * @Generated by gentest/gentest.sh with the following input'); + lines.push(' *'); + lines.push(rootNode.innerHTML.split('\n').map(function(line) { + return line.trim(); + }).filter(function(line) { + return line.length > 0 && line !== '
'; + }).map(function(line) { + return ' * ' + line; + }).reduce(function(curr, prev) { + return curr + '\n' + prev; + })); + lines.push(' *'); + lines.push(' */'); + lines.push(''); + + lines.push([ '#include ', '#include ', '#include ', '', - ]; + ].reduce(function(curr, prev) { + return curr + '\n' + prev; + })); for (var i = 0; i < layoutTree.length - 1; i++) { lines.push('TEST(CSSLayoutTest, INSERT_NAME_HERE) {'); diff --git a/tests/CSSLayoutFlexBasisTest.cpp b/tests/CSSLayoutFlexBasisTest.cpp index cfed1e51..62730596 100644 --- a/tests/CSSLayoutFlexBasisTest.cpp +++ b/tests/CSSLayoutFlexBasisTest.cpp @@ -7,6 +7,16 @@ * of patent rights can be found in the PATENTS file in the same directory. */ +/** + * @Generated by gentest/gentest.sh with the following input + * + *
+ *
+ *
+ *
+ * + */ + #include #include #include