on master help sign in
put the tests under -DTEST
ab5b409Neil Mitchell
gen/Main.hs+1−1
@@ -23,7 +23,7 @@ main = do
23 putStrLn $ rerender src res
23 putStrLn $ rerender src res
24 writeFileChanged "test.h" $ unlines $ compile html
24 writeFileChanged "test.h" $ unlines $ compile html
25 buildRule ["test.h","test.c"] ["gen" <.> (if isWindows then "exe" else "")] $
25 buildRule ["test.h","test.c"] ["gen" <.> (if isWindows then "exe" else "")] $
26− system_ "gcc test.c -o gen -Werror"
26+ system_ "gcc test.c -o gen -Werror -Wall -Wextra -DTEST"
27 system_ "gen"
27 system_ "gen"
28
28
29writeFileChanged :: FilePath -> String -> IO ()
29writeFileChanged :: FilePath -> String -> IO ()
gen/test.c+4
@@ -409,6 +409,8 @@ document* hexml_document_parse(const char* s, int slen)
409/////////////////////////////////////////////////////////////////////
409/////////////////////////////////////////////////////////////////////
410// TEST HARNESS (temporary)
410// TEST HARNESS (temporary)
411
411
412+#ifdef TEST
413+
412static char* resolve(const document* d, str loc)
414static char* resolve(const document* d, str loc)
413{
415{
414 char* buf = malloc(loc.length + 3);
416 char* buf = malloc(loc.length + 3);
@@ -456,6 +458,8 @@ int main()
456 return 0;
458 return 0;
457}
459}
458
460
461+#endif
462+
459/*
463/*
460void main()
464void main()
461{
465{