on master help sign in
Add include-strict-utf8 build flag

When this flag is enabled benchmarks that require strictly valid utf8 input are enabled.

commit6db157f12092dc79408a1f898d04eaa43bd69a51 authorHarendra Kumar <harendra@composewell.com> dateTue 30 Nov 2021, 03:00 (5 years ago) parent1c6c2d0
2 files changed+9−1
benchmark/Streamly/Benchmark/Unicode/Stream.hs+1−1 benchmark/streamly-benchmarks.cabal+8
benchmark/Streamly/Benchmark/Unicode/Stream.hs+1−1
@@ -276,7 +276,7 @@ o_1_space_decode_encode_read env =
276276 copyStreamLatin1' inh outh
277277 , mkBench "encodeLatin1 . decodeLatin1" env $ \inh outh ->
278278 copyStreamLatin1 inh outh
279−#ifdef DEVBUILD
279+#ifdef INCLUDE_STRICT_UTF8
280280 -- Requires valid unicode input
281281 , mkBench "encodeUtf8' . decodeUtf8'" env $ \inh outh ->
282282 _copyStreamUtf8' inh outh
benchmark/streamly-benchmarks.cabal+8
@@ -39,6 +39,11 @@ flag dev
3939 manual: True
4040 default: False
4141
42+flag include-strict-utf8
43+ description: Include strict utf8 input benchmarks
44+ manual: True
45+ default: False
46+
4247flag has-llvm
4348 description: Use llvm backend for better performance
4449 manual: True
@@ -64,6 +69,9 @@ common compile-options
6469 if flag(dev)
6570 cpp-options: -DDEVBUILD
6671
72+ if flag(include-strict-utf8)
73+ cpp-options: -DINCLUDE_STRICT_UTF8
74+
6775 if flag(inspection)
6876 cpp-options: -DINSPECTION
6977