Add hb-diff-filter-failures
authorBehdad Esfahbod <behdad@behdad.org>
Fri, 20 Jan 2012 22:17:44 +0000 (17:17 -0500)
committerBehdad Esfahbod <behdad@behdad.org>
Fri, 20 Jan 2012 22:17:44 +0000 (17:17 -0500)
test/shaping/hb-diff-filter-failures [new file with mode: 0755]

diff --git a/test/shaping/hb-diff-filter-failures b/test/shaping/hb-diff-filter-failures
new file mode 100755 (executable)
index 0000000..3048555
--- /dev/null
@@ -0,0 +1,28 @@
+#!/usr/bin/python
+
+import sys
+
+red_color = '\033[41;37;1m'
+green_color = '\033[42;37;1m'
+end_color = '\033[m'
+
+def filter_failures (f):
+       for l in f:
+               if l[0] in '-+':
+                       sys.stdout.writelines (l)
+                       continue
+
+
+def open_file (f):
+       if f == '-':
+               return sys.stdin
+       return file (f)
+
+if __name__ == '__main__':
+
+       if len (sys.argv) == 1:
+               print "Usage: %s FILE..." % sys.argv[0]
+               sys.exit (1)
+
+       for s in sys.argv[1:]:
+               filter_failures (open_file (s))