summaryrefslogtreecommitdiff
path: root/libraries/base
diff options
context:
space:
mode:
authorCheng Shao <terrorjack@type.dance>2023-04-02 12:09:24 +0000
committerMarge Bot <ben+marge-bot@smart-cactus.org>2023-04-27 16:00:35 -0400
commitbd2bfdecc8040a9a70478cd8d646a34b5fa77c35 (patch)
tree87174be2a5bb1849099fa88f9bc2d3c13773b032 /libraries/base
parentb174a1101289f2287d9194a229314badcb72ca1f (diff)
downloadhaskell-bd2bfdecc8040a9a70478cd8d646a34b5fa77c35.tar.gz
testsuite: wasm32-specific fixes
This patch includes all wasm32-specific testsuite fixes.
Diffstat (limited to 'libraries/base')
-rw-r--r--libraries/base/tests/IO/all.T15
-rw-r--r--libraries/base/tests/IO/openFile008.hs3
-rw-r--r--libraries/base/tests/all.T2
3 files changed, 13 insertions, 7 deletions
diff --git a/libraries/base/tests/IO/all.T b/libraries/base/tests/IO/all.T
index bfe14ee2aa..43e58ff8c5 100644
--- a/libraries/base/tests/IO/all.T
+++ b/libraries/base/tests/IO/all.T
@@ -35,7 +35,7 @@ test('hReady001', js_broken(22374), compile_and_run, ['-cpp'])
# work for the 'ghci' way because in that case we already pipe input from
# a script, so hence omit_ways(['ghci'])
test('hReady002', [cmd_prefix('sleep 1 |'), omit_ways(['ghci']),
- multi_cpu_race, js_broken(22374)],
+ multi_cpu_race, js_broken(22374), when(arch('wasm32'), fragile(23275))],
compile_and_run, [''])
test('hSeek001', normal, compile_and_run, [''])
@@ -57,7 +57,7 @@ test('hSetBuffering004', set_stdin('hSetBuffering004.hs'), compile_and_run, ['']
test('ioeGetErrorString001', normal, compile_and_run, ['-cpp'])
test('ioeGetFileName001', normal, compile_and_run, ['-cpp'])
test('ioeGetHandle001', normal, compile_and_run, ['-cpp'])
-test('isEOF001', extra_run_opts('</dev/null'), compile_and_run, [''])
+test('isEOF001', [extra_run_opts('</dev/null'), when(arch('wasm32'), fragile(23275))], compile_and_run, [''])
test('misc001', [extra_run_opts('misc001.hs misc001.out')], compile_and_run,
[''])
@@ -70,7 +70,7 @@ test('openFile005', js_broken(22261), compile_and_run, [''])
test('openFile006', [], compile_and_run, [''])
test('openFile007', js_broken(22261), compile_and_run, [''])
test('openFile008', [js_broken(22349), cmd_prefix('ulimit -n 1024; ')], compile_and_run, [''])
-test('openFile009', [], compile_and_run, [''])
+test('openFile009', [when(arch('wasm32'), fragile(23284))], compile_and_run, [''])
test('putStr001', normal, compile_and_run, [''])
test('readFile001', js_broken(22261), compile_and_run, [''])
@@ -121,7 +121,13 @@ test('encoding001', [], compile_and_run, [''])
test('encoding002', normal, compile_and_run, [''])
test('encoding003', normal, compile_and_run, [''])
-test('encoding004', [extra_files(['encoded-data/']), js_broken(22374)], compile_and_run, [''])
+test('encoding004', [extra_files(['encoded-data/']), js_broken(22374),
+# wasi-libc doesn't have cp936, see
+# https://gitlab.haskell.org/ghc/wasi-libc/-/blob/main/libc-top-half/musl/src/locale/iconv.c#L38
+# and
+# https://gitlab.haskell.org/ghc/wasi-libc/-/blob/main/libc-top-half/musl/src/locale/codepages.h
+# for locales supported by wasi-libc's iconv implementation
+when(arch('wasm32'), skip)], compile_and_run, [''])
test('encoding005', normal, compile_and_run, [''])
test('environment001', [], makefile_test, ['environment001-test'])
@@ -136,6 +142,7 @@ test('encodingerror001', normal, compile_and_run, [''])
# Requires use of the FD interface which is not supported under WINIO
test('T4808', [when(opsys('mingw32'), skip)
+ , when(arch('wasm32'), fragile(23284))
,fragile_for(16909, concurrent_ways), exit_code(1)]
, compile_and_run, [''])
test('T4895', normal, compile_and_run, [''])
diff --git a/libraries/base/tests/IO/openFile008.hs b/libraries/base/tests/IO/openFile008.hs
index 9c1a1c47f8..fb4d0bce44 100644
--- a/libraries/base/tests/IO/openFile008.hs
+++ b/libraries/base/tests/IO/openFile008.hs
@@ -1,5 +1,4 @@
import System.IO
-import System.Cmd
import System.FilePath
import Text.Printf
import System.Directory
@@ -10,7 +9,7 @@ testdir = "openFile008_testdir"
-- Test repeated opening/closing of 1000 files. This is useful for guaging
-- the performance of open/close and file locking.
main = do
- system ("rm -rf " ++ testdir)
+ removePathForcibly testdir
createDirectory testdir
let filenames = [testdir </> printf "file%03d" (n::Int) | n <- [1..1000]]
diff --git a/libraries/base/tests/all.T b/libraries/base/tests/all.T
index 0a9e00eb11..8eaecdfc10 100644
--- a/libraries/base/tests/all.T
+++ b/libraries/base/tests/all.T
@@ -169,7 +169,7 @@ test('qsemn001', normal, compile_and_run, [''])
test('T7457', normal, compile_and_run, [''])
-test('T7773', [when(opsys('mingw32'), skip), js_broken(22261)], compile_and_run, [''])
+test('T7773', [when(opsys('mingw32'), skip), js_broken(22261), when(arch('wasm32'), fragile(23275))], compile_and_run, [''])
# Andreas says that T7773 will not (and should not) work on Windows
# Tests for kind-polymorphic Category