Can not run lab1-testsuite-larger

12 views
Skip to first unread message

hjalti

unread,
Feb 9, 2012, 2:59:36 PM2/9/12
to proglang-course-2012
Hi, I'm using MinGW on Windows 7. I have no problem running make or
individually testing my parser against single cc files using "./
TestParser test.cc" but when I run the testsuite with "./progs-test-
lab1 path/to/your/file.cf" I get the same error for all the test
files:

Parsing ..\bad\bad135.cc...
←[031m./testdriver ..\bad\bad135.cc failed: invalid output←[0m
For source file ..\bad\bad135.cc:
---------------- begin ..\bad\bad135.cc ------------------
←[032mcomment "foo"
←[0m
----------------- end ..\bad\bad135.cc -------------------
It printed this to standard error:
←[034m'.' is not recognized as an internal or external command,
operable program or batch file.
←[0m

Ending with:

------------------------------------------------------------
←[030mNumber of rules: 123←[0m
←[034mshift/reduce conflicts: 2←[0m
See lab1-test-dir\ParCPP.info for information about the conflicts
------------------------------------------------------------
←[031mGood programs: passed 0 of 37 tests←[0m
←[031mBad programs: passed 0 of 135 tests←[0m

When I test against each file manually I get no problems, but it is
quite annoying having to manually test against almost 200 files every
time I make a change to the parser. Does anybody else have this
problem or know how to solve it?

Best regards,
Hjalti

Arnar Birgisson

unread,
Feb 13, 2012, 4:37:28 AM2/13/12
to proglang-c...@googlegroups.com
Looks like a problem with the color codes for non-windows terminals. I
don't have a windows machine to test, but try applying the following
patch to the test program:

diff --git a/progs-test-lab1.hs b/progs-test-lab1.hs
index db835a4..268a910 100644
--- a/progs-test-lab1.hs
+++ b/progs-test-lab1.hs
@@ -190,7 +190,7 @@ catLefts xs = [x | Left x <- xs]
type Color = Int

color :: Color -> String -> String
-color c s = fgcol c ++ s ++ normal
+color c s = s

highlight = "\ESC[7m"
bold = "\ESC[1m"


cheers,
Arnar

Reply all
Reply to author
Forward
0 new messages