diff --git a/libraries/hpc b/libraries/hpc index 4206323affaa6cc625a6f400c3da7cdd9c309461..f73c482db30a40cfa12074de51335b70a0974931 160000 --- a/libraries/hpc +++ b/libraries/hpc @@ -1 +1 @@ -Subproject commit 4206323affaa6cc625a6f400c3da7cdd9c309461 +Subproject commit f73c482db30a40cfa12074de51335b70a0974931 diff --git a/testsuite/tests/hpc/Makefile b/testsuite/tests/hpc/Makefile index 6de7ceefc191487f3d4ccc23a65b1b580c62692b..5945bb8dd0eebd99c15b53a4a60c0f4c05d257f6 100644 --- a/testsuite/tests/hpc/Makefile +++ b/testsuite/tests/hpc/Makefile @@ -7,3 +7,11 @@ T11798: "$(TEST_HC)" $(TEST_HC_ARGS) T11798 "$(TEST_HC)" $(TEST_HC_ARGS) T11798 -fhpc test -e .hpc/T11798.mix + +T17073: + LANG=ASCII "$(TEST_HC)" $(TEST_HC_ARGS) T17073.hs -fhpc -v0 + ./T17073 + $(HPC) report T17073 + $(HPC) version + LANG=ASCII $(HPC) markup T17073 + diff --git a/testsuite/tests/hpc/T17073.hs b/testsuite/tests/hpc/T17073.hs new file mode 100644 index 0000000000000000000000000000000000000000..d1e0a45b9aa26d37942ffbcb0fc9ce123cb3d902 --- /dev/null +++ b/testsuite/tests/hpc/T17073.hs @@ -0,0 +1,5 @@ +module Main where + +main :: IO () +main = putStrLn "Добрый день" + diff --git a/testsuite/tests/hpc/T17073.stdout b/testsuite/tests/hpc/T17073.stdout new file mode 100644 index 0000000000000000000000000000000000000000..db489a3eacb50bb3ab5f7b6fffdce8e2092cb93e --- /dev/null +++ b/testsuite/tests/hpc/T17073.stdout @@ -0,0 +1,15 @@ +Добрый день +100% expressions used (2/2) +100% boolean coverage (0/0) + 100% guards (0/0) + 100% 'if' conditions (0/0) + 100% qualifiers (0/0) +100% alternatives used (0/0) +100% local declarations used (0/0) +100% top-level declarations used (1/1) +hpc tools, version 0.68 +Writing: Main.hs.html +Writing: hpc_index.html +Writing: hpc_index_fun.html +Writing: hpc_index_alt.html +Writing: hpc_index_exp.html \ No newline at end of file diff --git a/testsuite/tests/hpc/all.T b/testsuite/tests/hpc/all.T index ed68e293321fe98f9d53c080162e0fbd343fc4b0..bd32c64148d524b88a8e3908890c1bd7814401bc 100644 --- a/testsuite/tests/hpc/all.T +++ b/testsuite/tests/hpc/all.T @@ -21,3 +21,5 @@ test('T2991', [cmd_wrapper(T2991), extra_clean(['T2991LiterateModule.hi', 'T2991LiterateModule.o'])], # Run with 'ghc --main'. Do not list other modules explicitly. multimod_compile_and_run, ['T2991', '']) + +test('T17073', normal, makefile_test, ['T17073 HPC={hpc}']) diff --git a/utils/hpc/HpcMarkup.hs b/utils/hpc/HpcMarkup.hs index a9b5ce172257362df339d12ec0fd6712fff278c9..70519600e9ac30843cf215b67a9b6304079d26e5 100644 --- a/utils/hpc/HpcMarkup.hs +++ b/utils/hpc/HpcMarkup.hs @@ -7,14 +7,12 @@ module HpcMarkup (markup_plugin) where import Trace.Hpc.Mix import Trace.Hpc.Tix -import Trace.Hpc.Util +import Trace.Hpc.Util (HpcPos, fromHpcPos, writeFileUtf8) import HpcFlags import HpcUtils -import System.Directory import System.FilePath -import System.IO (localeEncoding) import Data.List import Data.Maybe(fromJust) import Data.Semigroup as Semi @@ -82,10 +80,10 @@ markup_main flags (prog:modNames) = do unless (verbosity flags < Normal) $ putStrLn $ "Writing: " ++ (filename <.> "html") - writeFileUsing (dest_dir filename <.> "html") $ + writeFileUtf8 (dest_dir filename <.> "html") $ "" ++ "" ++ - charEncodingTag ++ + "" ++ "