Improve test generation process a bit
authorAryeh Gregor <AryehGregor+gitcommit@gmail.com>
Wed, 21 Sep 2011 11:15:15 -0600
changeset 606 e6c392856557
parent 605 fc58c8a39346
child 607 5c35a3a49bd1
Improve test generation process a bit

Checked in the diff and patch files, so that what I'm doing is better
documented. Also fixed fixdata to ignore differences in line numbers,
and added some comments.
.gitignore
conformancetest/diff
conformancetest/fixdata
conformancetest/patch
--- a/.gitignore	Wed Sep 21 11:03:05 2011 -0600
+++ b/.gitignore	Wed Sep 21 11:15:15 2011 -0600
@@ -2,5 +2,4 @@
 data
 conformancetest/gecko-data
 conformancetest/webkit-data
-conformancetest/patch
-conformancetest/diff
+conformancetest/tmp-diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/conformancetest/diff	Wed Sep 21 11:15:15 2011 -0600
@@ -0,0 +1,118 @@
+@@ -1585,11 +1585,11 @@
+ 	{"stylewithcss":[false,false,"",false,true,""],"delete":[false,false,"",false,false,""]}],
+ ["foo&#x308;&#x327;[]bar",
+ 	[["stylewithcss","false"],["delete",""]],
+-	"foö[]bar",
++	"foö[]bar",
+ 	{"stylewithcss":[false,true,"",false,false,""],"delete":[false,false,"",false,false,""]}],
+ ["foo&#x308;&#x327;[]bar",
+ 	[["stylewithcss","true"],["delete",""]],
+-	"foö[]bar",
++	"foö[]bar",
+ 	{"stylewithcss":[false,false,"",false,true,""],"delete":[false,false,"",false,false,""]}],
+ ["&ouml;[]bar",
+ 	[["stylewithcss","false"],["delete",""]],
+@@ -1609,11 +1609,11 @@
+ 	{"stylewithcss":[false,false,"",false,true,""],"delete":[false,false,"",false,false,""]}],
+ ["o&#x308;&#x327;[]bar",
+ 	[["stylewithcss","false"],["delete",""]],
+-	"ö[]bar",
++	"ö[]bar",
+ 	{"stylewithcss":[false,true,"",false,false,""],"delete":[false,false,"",false,false,""]}],
+ ["o&#x308;&#x327;[]bar",
+ 	[["stylewithcss","true"],["delete",""]],
+-	"ö[]bar",
++	"ö[]bar",
+ 	{"stylewithcss":[false,false,"",false,true,""],"delete":[false,false,"",false,false,""]}],
+ ["&#x5e9;&#x5c1;&#x5b8;[]&#x5dc;&#x5d5;&#x5b9;&#x5dd;",
+ 	[["stylewithcss","false"],["delete",""]],
+@@ -1625,11 +1625,11 @@
+ 	{"stylewithcss":[false,false,"",false,true,""],"delete":[false,false,"",false,false,""]}],
+ ["&#x5e9;&#x5c1;&#x5b8;&#x5dc;&#x5d5;&#x5b9;[]&#x5dd;",
+ 	[["stylewithcss","false"],["delete",""]],
+-	"שָׁלו[]ם",
++	"שָׁלו[]ם",
+ 	{"stylewithcss":[false,true,"",false,false,""],"delete":[false,false,"",false,false,""]}],
+ ["&#x5e9;&#x5c1;&#x5b8;&#x5dc;&#x5d5;&#x5b9;[]&#x5dd;",
+ 	[["stylewithcss","true"],["delete",""]],
+-	"שָׁלו[]ם",
++	"שָׁלו[]ם",
+ 	{"stylewithcss":[false,false,"",false,true,""],"delete":[false,false,"",false,false,""]}],
+ ["<p>foo</p><p>[]bar</p>",
+ 	[["stylewithcss","false"],["delete",""]],
+@@ -5034,11 +5034,11 @@
+ ["foo[bar]baz",
+ 	[["stylewithcss","false"],["forecolor","rgba(0, 0, 255, 0.0)"]],
+ 	"foo<span style=\"color:rgba(0, 0, 0, 0)\">[bar]</span>baz",
+-	{"stylewithcss":[false,true,"",false,false,""],"forecolor":[false,false,"rgb(0, 0, 0)",false,false,"rgba(0, 0, 255, 0)"]}],
++	{"stylewithcss":[false,true,"",false,false,""],"forecolor":[false,false,"rgb(0, 0, 0)",false,false,"rgba(0, 0, 0, 0)"]}],
+ ["foo[bar]baz",
+ 	[["stylewithcss","true"],["forecolor","rgba(0, 0, 255, 0.0)"]],
+ 	"foo<span style=\"color:rgba(0, 0, 0, 0)\">[bar]</span>baz",
+-	{"stylewithcss":[false,false,"",false,true,""],"forecolor":[false,false,"rgb(0, 0, 0)",false,false,"rgba(0, 0, 255, 0)"]}],
++	{"stylewithcss":[false,false,"",false,true,""],"forecolor":[false,false,"rgb(0, 0, 0)",false,false,"rgba(0, 0, 0, 0)"]}],
+ ["foo[bar]baz",
+ 	[["stylewithcss","false"],["forecolor","rgb(15, -10, 375)"]],
+ 	"foo<font color=\"#0f00ff\">[bar]</font>baz",
+@@ -5330,11 +5330,11 @@
+ ["<span style=\"color: rgba(0, 0, 255, 0.0)\">[foo]</span>",
+ 	[["stylewithcss","false"],["forecolor","#0000FF"]],
+ 	"<font color=\"#0000ff\">[foo]</font>",
+-	{"stylewithcss":[false,true,"",false,false,""],"forecolor":[false,false,"rgba(0, 0, 255, 0)",false,false,"rgb(0, 0, 255)"]}],
++	{"stylewithcss":[false,true,"",false,false,""],"forecolor":[false,false,"rgba(0, 0, 0, 0)",false,false,"rgb(0, 0, 255)"]}],
+ ["<span style=\"color: rgba(0, 0, 255, 0.0)\">[foo]</span>",
+ 	[["stylewithcss","true"],["forecolor","#0000FF"]],
+ 	"<span style=\"color:rgb(0, 0, 255)\">[foo]</span>",
+-	{"stylewithcss":[false,false,"",false,true,""],"forecolor":[false,false,"rgba(0, 0, 255, 0)",false,false,"rgb(0, 0, 255)"]}],
++	{"stylewithcss":[false,false,"",false,true,""],"forecolor":[false,false,"rgba(0, 0, 0, 0)",false,false,"rgb(0, 0, 255)"]}],
+ ["<span style=\"color: rgb(15, -10, 375)\">[foo]</span>",
+ 	[["stylewithcss","false"],["forecolor","#0000FF"]],
+ 	"<font color=\"#0000ff\">[foo]</font>",
+@@ -7465,11 +7465,11 @@
+ 	{"stylewithcss":[false,false,"",false,true,""],"forwarddelete":[false,false,"",false,false,""]}],
+ ["&#x5e9;&#x5c1;&#x5b8;&#x5dc;[]&#x5d5;&#x5b9;&#x5dd;",
+ 	[["stylewithcss","false"],["forwarddelete",""]],
+-	"שָׁל[]ם",
++	"שָׁל[]ם",
+ 	{"stylewithcss":[false,true,"",false,false,""],"forwarddelete":[false,false,"",false,false,""]}],
+ ["&#x5e9;&#x5c1;&#x5b8;&#x5dc;[]&#x5d5;&#x5b9;&#x5dd;",
+ 	[["stylewithcss","true"],["forwarddelete",""]],
+-	"שָׁל[]ם",
++	"שָׁל[]ם",
+ 	{"stylewithcss":[false,false,"",false,true,""],"forwarddelete":[false,false,"",false,false,""]}],
+ ["<p>foo[]</p><p>bar</p>",
+ 	[["stylewithcss","false"],["forwarddelete",""]],
+@@ -11719,18 +11719,10 @@
+ 	[["stylewithcss","true"],["inserthtml","abc"]],
+ 	"<xmp>fabc{}o</xmp>",
+ 	{"stylewithcss":[false,false,"",false,true,""],"inserthtml":[false,false,"",false,false,""]}],
+-["<xmp>f[o]o</xmp>",
+-	[["stylewithcss","false"],["inserthtml","<b>abc</b>"]],
+-	"<xmp>f<b>abc</b>{}o</xmp>",
+-	{"stylewithcss":[false,true,"",false,false,""],"inserthtml":[false,false,"",false,false,""]}],
+-["<xmp>f[o]o</xmp>",
+-	[["stylewithcss","true"],["inserthtml","<b>abc</b>"]],
+-	"<xmp>f<b>abc</b>{}o</xmp>",
+-	{"stylewithcss":[false,false,"",false,true,""],"inserthtml":[false,false,"",false,false,""]}],
+ ["<script>f[o]o</script>bar",
+ 	[["stylewithcss","false"],["inserthtml","abc"]],
+ 	"<script>fabc{}o</script>bar",
+-	{"stylewithcss":[false,true,"",false,false,""],"inserthtml":[false,false,"",false,false,""]}],
++	{"stylewithcss":[false,false,"",false,false,""],"inserthtml":[false,false,"",false,false,""]}],
+ ["<script>f[o]o</script>bar",
+ 	[["stylewithcss","true"],["inserthtml","abc"]],
+ 	"<script>fabc{}o</script>bar",
+@@ -17697,11 +17689,11 @@
+ 	{"stylewithcss":[false,false,"",false,true,""],"italic":[true,false,"",false,true,""]}],
+ ["fo[o<span style=font-style:oblique>b]ar</span>baz",
+ 	[["stylewithcss","false"],["italic",""]],
+-	"fo<i>[o</i><span style=\"font-style:oblique\">b]ar</span>baz",
++	"fo<i>[o</i><span style=\"font-style:oblique\"><i>b]</i>ar</span>baz",
+ 	{"stylewithcss":[false,true,"",false,false,""],"italic":[true,false,"",false,true,""]}],
+ ["fo[o<span style=font-style:oblique>b]ar</span>baz",
+ 	[["stylewithcss","true"],["italic",""]],
+-	"fo<span style=\"font-style:italic\">[o</span><span style=\"font-style:oblique\">b]ar</span>baz",
++	"fo<span style=\"font-style:italic\">[o</span><span style=\"font-style:oblique\"><span style=\"font-style:italic\">b]</span>ar</span>baz",
+ 	{"stylewithcss":[false,false,"",false,true,""],"italic":[true,false,"",false,true,""]}],
+ ["<span style=font-style:italic>fo[o</span><span style=font-style:oblique>b]ar</span>",
+ 	[["stylewithcss","false"],["italic",""]],
--- a/conformancetest/fixdata	Wed Sep 21 11:03:05 2011 -0600
+++ b/conformancetest/fixdata	Wed Sep 21 11:15:15 2011 -0600
@@ -6,9 +6,21 @@
 cd conformancetest
 fromdos webkit-data
 fromdos gecko-data
+# Take a diff, ignoring the first two lines (which will contain dates).  This
+# reflects the differences in tests between Gecko and WebKit.  If any new tests
+# don't match between Gecko and WebKit, I want to know about it.
 diff -u webkit-data gecko-data | tail -n +3 > tmp-diff
-diff -u tmp-diff diff
+# The <() stuff gets rid of the exact numbers on the @@ lines before feeding
+# the two files to diff.  Then it will compare them.  If they differ, it will
+# exit with a nonzero exit code, so set -e will cause the script to abort,
+# printing out the difference.
+diff -u <(sed s/^@@.*/@@/ < tmp-diff) <(sed s/^@@.*/@@/ < diff)
 rm tmp-diff
+# The file "diff" contains the differences from WebKit to Gecko.  The file
+# "patch" is a manually-crafted subset, which contains only the differences
+# where we actually want Gecko's output.  Thus we copy webkit-data to data.js,
+# then apply patch so that it has the parts of Gecko's output we want instead
+# of WebKit's.
 cp webkit-data data.js
 patch data.js patch
 echo >> data.js
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/conformancetest/patch	Wed Sep 21 11:15:15 2011 -0600
@@ -0,0 +1,70 @@
+@@ -1585,11 +1585,11 @@
+ 	{"stylewithcss":[false,false,"",false,true,""],"delete":[false,false,"",false,false,""]}],
+ ["foo&#x308;&#x327;[]bar",
+ 	[["stylewithcss","false"],["delete",""]],
+-	"foö[]bar",
++	"foö[]bar",
+ 	{"stylewithcss":[false,true,"",false,false,""],"delete":[false,false,"",false,false,""]}],
+ ["foo&#x308;&#x327;[]bar",
+ 	[["stylewithcss","true"],["delete",""]],
+-	"foö[]bar",
++	"foö[]bar",
+ 	{"stylewithcss":[false,false,"",false,true,""],"delete":[false,false,"",false,false,""]}],
+ ["&ouml;[]bar",
+ 	[["stylewithcss","false"],["delete",""]],
+@@ -1609,11 +1609,11 @@
+ 	{"stylewithcss":[false,false,"",false,true,""],"delete":[false,false,"",false,false,""]}],
+ ["o&#x308;&#x327;[]bar",
+ 	[["stylewithcss","false"],["delete",""]],
+-	"ö[]bar",
++	"ö[]bar",
+ 	{"stylewithcss":[false,true,"",false,false,""],"delete":[false,false,"",false,false,""]}],
+ ["o&#x308;&#x327;[]bar",
+ 	[["stylewithcss","true"],["delete",""]],
+-	"ö[]bar",
++	"ö[]bar",
+ 	{"stylewithcss":[false,false,"",false,true,""],"delete":[false,false,"",false,false,""]}],
+ ["&#x5e9;&#x5c1;&#x5b8;[]&#x5dc;&#x5d5;&#x5b9;&#x5dd;",
+ 	[["stylewithcss","false"],["delete",""]],
+@@ -1625,11 +1625,11 @@
+ 	{"stylewithcss":[false,false,"",false,true,""],"delete":[false,false,"",false,false,""]}],
+ ["&#x5e9;&#x5c1;&#x5b8;&#x5dc;&#x5d5;&#x5b9;[]&#x5dd;",
+ 	[["stylewithcss","false"],["delete",""]],
+-	"שָׁלו[]ם",
++	"שָׁלו[]ם",
+ 	{"stylewithcss":[false,true,"",false,false,""],"delete":[false,false,"",false,false,""]}],
+ ["&#x5e9;&#x5c1;&#x5b8;&#x5dc;&#x5d5;&#x5b9;[]&#x5dd;",
+ 	[["stylewithcss","true"],["delete",""]],
+-	"שָׁלו[]ם",
++	"שָׁלו[]ם",
+ 	{"stylewithcss":[false,false,"",false,true,""],"delete":[false,false,"",false,false,""]}],
+ ["<p>foo</p><p>[]bar</p>",
+ 	[["stylewithcss","false"],["delete",""]],
+@@ -7465,11 +7465,11 @@
+ 	{"stylewithcss":[false,false,"",false,true,""],"forwarddelete":[false,false,"",false,false,""]}],
+ ["&#x5e9;&#x5c1;&#x5b8;&#x5dc;[]&#x5d5;&#x5b9;&#x5dd;",
+ 	[["stylewithcss","false"],["forwarddelete",""]],
+-	"שָׁל[]ם",
++	"שָׁל[]ם",
+ 	{"stylewithcss":[false,true,"",false,false,""],"forwarddelete":[false,false,"",false,false,""]}],
+ ["&#x5e9;&#x5c1;&#x5b8;&#x5dc;[]&#x5d5;&#x5b9;&#x5dd;",
+ 	[["stylewithcss","true"],["forwarddelete",""]],
+-	"שָׁל[]ם",
++	"שָׁל[]ם",
+ 	{"stylewithcss":[false,false,"",false,true,""],"forwarddelete":[false,false,"",false,false,""]}],
+ ["<p>foo[]</p><p>bar</p>",
+ 	[["stylewithcss","false"],["forwarddelete",""]],
+@@ -17697,11 +17689,11 @@
+ 	{"stylewithcss":[false,false,"",false,true,""],"italic":[true,false,"",false,true,""]}],
+ ["fo[o<span style=font-style:oblique>b]ar</span>baz",
+ 	[["stylewithcss","false"],["italic",""]],
+-	"fo<i>[o</i><span style=\"font-style:oblique\">b]ar</span>baz",
++	"fo<i>[o</i><span style=\"font-style:oblique\"><i>b]</i>ar</span>baz",
+ 	{"stylewithcss":[false,true,"",false,false,""],"italic":[true,false,"",false,true,""]}],
+ ["fo[o<span style=font-style:oblique>b]ar</span>baz",
+ 	[["stylewithcss","true"],["italic",""]],
+-	"fo<span style=\"font-style:italic\">[o</span><span style=\"font-style:oblique\">b]ar</span>baz",
++	"fo<span style=\"font-style:italic\">[o</span><span style=\"font-style:oblique\"><span style=\"font-style:italic\">b]</span>ar</span>baz",
+ 	{"stylewithcss":[false,false,"",false,true,""],"italic":[true,false,"",false,true,""]}],
+ ["<span style=font-style:italic>fo[o</span><span style=font-style:oblique>b]ar</span>",
+ 	[["stylewithcss","false"],["italic",""]],