Commit a024bc75 authored by dterei's avatar dterei

Merge branch 'master' of http://darcs.haskell.org/nofib

parents 1d8192f8 a3f5555e
......@@ -9,6 +9,7 @@ module Slurp (Status(..), Results(..), ResultTable, parse_log) where
import Control.Monad
import qualified Data.Map as Map
import Data.Map (Map)
import Data.List (isPrefixOf)
import Text.Regex
-- import Debug.Trace
......@@ -193,7 +194,7 @@ ghc6_re s = case matchRegex re s of
Just (read allocations, read gcs, read avg_residency, read max_residency, read samples, read gc_work', 1048576 * read in_use, read initialisation, read initialisation_elapsed, read mut, read mut_elapsed, read gc, read gc_elapsed, read gc0_count, read gc0, read gc0_elapsed, read gc1_count, read gc1, read gc1_elapsed, read bal)
Just _ -> error "ghc3_re: Can't happen"
Nothing -> Nothing
where re = mkRegex "^<<ghc:[ \t]+([0-9]+)[ \t]+bytes,[ \t]*([0-9]+)[ \t]+GCs[ \t]+\\(([0-9]+)[ \t]*\\+[ \t]*([0-9]+)\\),[ \t]*([0-9]+)/([0-9]+)[ \t]+avg/max bytes residency \\(([0-9]+) samples\\), ([0-9]+) bytes GC work, ([0-9]+)M in use, ([0-9.]+) INIT \\(([0-9.]+) elapsed\\), ([0-9.]+) MUT \\(([0-9.]+) elapsed\\), ([0-9.]+) GC \\(([0-9.]+) elapsed\\), ([0-9.]+) GC\\(0\\) \\(([0-9.]+) elapsed\\), ([0-9.]+) GC\\(1\\) \\(([0-9.]+) elapsed\\), ([0-9.]+) balance :ghc>>"
where re = mkRegex "^<<ghc:[ \t]+([0-9]+)[ \t]+bytes,[ \t]*([0-9]+)[ \t]+GCs[ \t]+\\(([0-9]+)[ \t]*\\+[ \t]*([0-9]+)\\),[ \t]*([0-9]+)/([0-9]+)[ \t]+avg/max bytes residency \\(([0-9]+) samples\\), ([0-9]+) bytes GC work, ([0-9]+)M in use, ([0-9.]+) INIT \\(([0-9.]+) elapsed\\), ([0-9.]+) MUT \\(([0-9.-]+) elapsed\\), ([0-9.]+) GC \\(([0-9.]+) elapsed\\), ([0-9.]+) GC\\(0\\) \\(([0-9.]+) elapsed\\), ([0-9.]+) GC\\(1\\) \\(([0-9.]+) elapsed\\), ([0-9.]+) balance :ghc>>"
wrong_exit_status, wrong_output, out_of_heap, out_of_stack :: Regex
wrong_exit_status = mkRegex "^\\**[ \t]*expected exit status ([0-9]+) not seen ; got ([0-9]+)"
......@@ -411,7 +412,8 @@ parse_run_time prog (l:ls) res ex =
[gc0_count] [gc0] [gc0_elapsed] [gc1_count] [gc1] [gc1_elapsed] [bal]
[gc_work'] Nothing Nothing Nothing Nothing [in_use];
Nothing ->
Nothing | "<<ghc" `isPrefixOf` l -> error $ "Failed to parse GHC output " ++ show l
| otherwise ->
case matchRegex wrong_output l of {
Just ["stdout"] ->
......
......@@ -227,21 +227,27 @@ cat /dev/null > $DefaultStdoutFile
cat /dev/null > $DefaultStderrFile
$PreScriptLines
$SpixifyLine1
# NB: if you plan to use "sed" in this script please bear in mind that in some seds (in particular BSD sed,
# also used on OS X) the output is always terminated by a new line, even if the input wasn't. This can cause
# spurious cmp failures if the expected stderr/stdout did not have a trailing newline.
#
# We try to use tr instead to avoid these problems. Make sure you run it in the C locale or else it may throw
# an error if the input string is not encoded in the locale encoding.
$TimeCmd /bin/sh -c \'$CachegrindPrefix $ToRun $TimingMagic @PgmArgs < $PgmStdinFile 1> $TmpPrefix/runtest$$.1.raw 2> $TmpPrefix/runtest$$.2.raw 3> $TmpPrefix/runtest$$.3.raw\'
progexit=\$?
if [ "$StdoutBinary" = "0" ]; then
# remove Windows \r carraige-returns
sed 's/\r//g' < $TmpPrefix/runtest$$.1.raw > $TmpPrefix/runtest$$.1
LC_CTYPE=C tr -d '\r' < $TmpPrefix/runtest$$.1.raw > $TmpPrefix/runtest$$.1
else
cp $TmpPrefix/runtest$$.1.raw $TmpPrefix/runtest$$.1
fi
if [ "$StderrBinary" = "0" ]; then
# remove Windows \r carraige-returns
sed 's/\r//g' < $TmpPrefix/runtest$$.2.raw > $TmpPrefix/runtest$$.2
LC_CTYPE=C tr -d '\r' < $TmpPrefix/runtest$$.2.raw > $TmpPrefix/runtest$$.2
else
cp $TmpPrefix/runtest$$.2.raw $TmpPrefix/runtest$$.2
fi
sed 's/\r//g' < $TmpPrefix/runtest$$.3.raw > $TmpPrefix/runtest$$.3
LC_CTYPE=C tr -d '\r' < $TmpPrefix/runtest$$.3.raw > $TmpPrefix/runtest$$.3
if [ \$progexit -eq 0 ] && [ $PgmFail -ne 0 ]; then
echo $ToRun @PgmArgs \\< $PgmStdinFile
echo "****" expected a failure, but was successful
......@@ -255,7 +261,7 @@ else
$PostScriptLines
hit='NO'
for out_file in @PgmStdoutFile ; do
if sed "s/ \$//" $TmpPrefix/runtest$$.1 | cmp -s \$out_file - ; then
if cmp -s \$out_file $TmpPrefix/runtest$$.1 ; then
hit='YES'
fi
done
......@@ -281,7 +287,7 @@ fi
hit='NO'
for out_file in @PgmStderrFile ; do
if sed "s/ \$//" $TmpPrefix/runtest$$.2 | cmp -s \$out_file - ; then
if cmp -s \$out_file $TmpPrefix/runtest$$.2 ; then
hit='YES'
fi
done
......
result1 = 2.59635799135966e-12
result2 = 2.59635799135966e-12
result3 = 4.8279900966008427e-8
Run_simple : "RESULT u,v,r,z,alpha,s,rho,p,q,epsilon,theta,deltat err"
"<"-2.2662218507181433,-3.469446951953614e-16,371360.59811700473,1.982045902386176e-2,18910.179268515803,5420373.038098176,14000.10270147848,9871.00152949301,1.4319026901564615,9975.269961008136,95907.23515697249,1.0e-2,25580.958466109587>
done
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment