[Git][ghc/ghc][wip/js-staging] 2 commits: testsuite: add js_skip_csources function

doyougnu (@doyougnu) gitlab at gitlab.haskell.org
Fri Oct 7 19:27:45 UTC 2022



doyougnu pushed to branch wip/js-staging at Glasgow Haskell Compiler / GHC


Commits:
c41031c0 by doyougnu at 2022-10-07T14:17:46-04:00
testsuite: add js_skip_csources function

Used to indicate a test that fails in the JS backend because the JS
Backend does not yet support c-sources in cabal files.

- - - - -
7287a052 by doyougnu at 2022-10-07T14:17:46-04:00
testsuite: JS: skip tests which use c-sources

Skip because these tests use c-sources and the JS backend does not yet
support including c-sources

testsuite: JS backend: skip backpack tests

testsuite: JS: skip c-sources ffi tests

testsuite: JS: skip multipleHomeUnits_odir

testsuite: JS: disable more backpack tests

testsuite: JS: disable c-sources rts tests

testsuite: JS: skip c-sources codeGen tests

testsuite: JS: skip c-sources generics test

- - - - -


11 changed files:

- testsuite/driver/testlib.py
- testsuite/tests/backpack/should_run/all.T
- testsuite/tests/codeGen/should_run/T20137/all.T
- testsuite/tests/codeGen/should_run/T20735/all.T
- testsuite/tests/codeGen/should_run/all.T
- testsuite/tests/driver/multipleHomeUnits/o-dir/all.T
- testsuite/tests/ffi/should_fail/all.T
- testsuite/tests/ffi/should_run/all.T
- testsuite/tests/generics/all.T
- testsuite/tests/rep-poly/all.T
- testsuite/tests/rts/all.T


Changes:

=====================================
testsuite/driver/testlib.py
=====================================
@@ -149,6 +149,10 @@ def js_broken( bug: IssueNumber ):
     else:
         return normal;
 
+# an alias to js_skip to note that these tests fail due to c-sources
+def js_skip_csources(name, opts):
+    js_skip(name,opts);
+
 def expect_fail( name, opts ):
     # The compiler, testdriver, OS or platform is missing a certain
     # feature, and we don't plan to or can't fix it now or in the


=====================================
testsuite/tests/backpack/should_run/all.T
=====================================
@@ -1,13 +1,13 @@
-test('bkprun01', normal, backpack_run, [''])
-test('bkprun02', normal, backpack_run, [''])
-test('bkprun03', normal, backpack_run, [''])
-test('bkprun04', normal, backpack_run, [''])
-test('bkprun05', exit_code(1), backpack_run, [''])
-test('bkprun06', normal, backpack_run, [''])
-test('bkprun07', normal, backpack_run, [''])
-test('bkprun08', normal, backpack_run, [''])
-test('bkprun09', normal, backpack_run, ['-O'])
-test('T13955', normal, backpack_run, [''])
-test('T15138', normal, backpack_run, [''])
-test('T15379', normal, backpack_run,[''])
+test('bkprun01', js_skip_csources, backpack_run, [''])
+test('bkprun02', js_skip_csources, backpack_run, [''])
+test('bkprun03', js_skip_csources, backpack_run, [''])
+test('bkprun04', js_skip_csources, backpack_run, [''])
+test('bkprun05', [exit_code(1), js_skip_csources], backpack_run, [''])
+test('bkprun06', js_skip_csources, backpack_run, [''])
+test('bkprun07', js_skip_csources, backpack_run, [''])
+test('bkprun08', js_skip_csources, backpack_run, [''])
+test('bkprun09', js_skip_csources, backpack_run, ['-O'])
+test('T13955', js_skip_csources, backpack_run, [''])
+test('T15138', js_skip_csources, backpack_run, [''])
+test('T15379', js_skip_csources, backpack_run,[''])
 test('T20133', expect_broken(20133), backpack_run, [''])


=====================================
testsuite/tests/codeGen/should_run/T20137/all.T
=====================================
@@ -1 +1 @@
-test('T20137', normal, compile_and_run, ['T20137C.c'])
+test('T20137', js_skip_csources, compile_and_run, ['T20137C.c'])


=====================================
testsuite/tests/codeGen/should_run/T20735/all.T
=====================================
@@ -1,5 +1,5 @@
 test('T20735',
-     normal,
+     js_skip_csources,
      multi_compile_and_run,
      ['T20735', [('T20735_c.c', '')], ''])
 


=====================================
testsuite/tests/codeGen/should_run/all.T
=====================================
@@ -211,7 +211,7 @@ test('T16449_2', exit_code(0), compile_and_run, [''])
 test('T16846', [only_ways(['optasm']), exit_code(1)], compile_and_run, [''])
 
 test('T17920', cmm_src, compile_and_run, [''])
-test('T18527', normal, compile_and_run, ['T18527FFI.c'])
+test('T18527', js_skip_csources, compile_and_run, ['T18527FFI.c'])
 test('T19149', only_ways('sanity'), compile_and_run, ['T19149_c.c'])
 test('T20275', normal, compile_and_run, [''])
 


=====================================
testsuite/tests/driver/multipleHomeUnits/o-dir/all.T
=====================================
@@ -1,6 +1,7 @@
 # This test checks that getRootSummary doesn't cross package boundaries.
 test('multipleHomeUnits_odir'
-    , [extra_files([ 'p1/', 'unitP1'])
+    , [extra_files([ 'p1/', 'unitP1']),
+       js_skip_csources
       ]
     , makefile_test
     , ['mhu-odir'])


=====================================
testsuite/tests/ffi/should_fail/all.T
=====================================
@@ -9,7 +9,7 @@ test('T3066', normal, compile_fail, [''])
 test('ccfail004', [extra_files(['Ccfail004A.hs'])], multimod_compile_fail, ['ccfail004', '-v0'])
 test('ccfail005', normal, compile_fail, [''])
 test('ccall_value', normal, compile_fail, [''])
-test('capi_value_function', normal, compile_fail, [''])
+test('capi_value_function', js_skip_csources, compile_fail, [''])
 test('NonreducingFfiSignature', normal, compile_fail, [''])
 test('T5664', normal, compile_fail, ['-v0'])
 test('T7506', normal, compile_fail, [''])
@@ -23,7 +23,8 @@ test('T21305_fail', normal, compile_fail, [''])
 # from an unsafe foreign function) and only makes sense in non-threaded way
 # (threaded runtime will hang). See #14912.
 test('UnsafeReenter',
-     [omit_ways(threaded_ways), exit_code(1)],
+     [omit_ways(threaded_ways), exit_code(1),
+     js_skip_csources],
      compile_and_run,
      ['UnsafeReenterC.c'])
 


=====================================
testsuite/tests/ffi/should_run/all.T
=====================================
@@ -30,6 +30,7 @@ test('ffi004', skip, compile_and_run, [''])
 test('ffi005', [ omit_ways(prof_ways + ['ghci']),
                  when(arch('i386'), skip),
                  when(platform('i386-apple-darwin'), expect_broken(4105)),
+                 js_skip_csources,
                  exit_code(3) ],
                compile_and_run, ['ffi005_c.c'])
 
@@ -72,7 +73,7 @@ test('ffi014', [only_ways(['threaded1', 'threaded2'])], compile_and_run,
      ['ffi014_cbits.c'])
 
 # GHCi can't handle the separate C file (ToDo: fix this somehow)
-test('ffi015', [omit_ways(['ghci'])], compile_and_run, ['ffi015_cbits.c'])
+test('ffi015', [omit_ways(['ghci']), js_skip_csources], compile_and_run, ['ffi015_cbits.c'])
 
 # GHCi can't handle foreign import "&"
 test('ffi016', omit_ways(['ghci']), compile_and_run, [''])
@@ -85,7 +86,8 @@ test('ffi018_ghci',
      [extra_files(['ffi018.h']),
       only_ways(['ghci']),
       when(unregisterised(), fragile(16085)),
-      pre_cmd('$MAKE -s --no-print-directory ffi018_ghci_setup')],
+      pre_cmd('$MAKE -s --no-print-directory ffi018_ghci_setup'),
+      js_skip_csources],
      compile_and_run, ['ffi018_ghci_c.o'])
 
 test('ffi019', normal, compile_and_run, [''])
@@ -93,14 +95,14 @@ test('ffi019', normal, compile_and_run, [''])
 # This one originally failed only GHCi, but doesn't hurt to test all ways.
 test('T1679', normal, compile_and_run, [''])
 
-test('T1288', [omit_ways(['ghci'])], compile_and_run, ['T1288_c.c'])
+test('T1288', [omit_ways(['ghci']), js_skip_csources], compile_and_run, ['T1288_c.c'])
 test('T1288_ghci',
      [only_ways(['ghci']),
       when(unregisterised(), fragile(16085)),
       pre_cmd('$MAKE -s --no-print-directory T1288_ghci_setup')],
      compile_and_run, ['T1288_ghci_c.o'])
 
-test('T2276', [omit_ways(['ghci'])], compile_and_run, ['T2276_c.c'])
+test('T2276', [omit_ways(['ghci']), js_skip_csources], compile_and_run, ['T2276_c.c'])
 test('T2276_ghci', [ only_ways(['ghci']),
                      when(opsys('darwin'), skip), # stdcall not supported on OS X
                      pre_cmd('$MAKE -s --no-print-directory T2276_ghci_setup') ],
@@ -108,13 +110,15 @@ test('T2276_ghci', [ only_ways(['ghci']),
 
 test('T2469', normal, compile_and_run, ['-optc-std=gnu99'])
 
-test('T2594', [omit_ways(['ghci'])], compile_and_run, ['T2594_c.c'])
+test('T2594', [omit_ways(['ghci']), js_skip_csources], compile_and_run, ['T2594_c.c'])
 
 test('fptr01', [omit_ways(['ghci'])], compile_and_run,
       [ 'fptr01_js.js' if arch("js") else 'fptr01_c.c'])
 test('fptr02', normal, compile_and_run, [''])
 
-test('fptrfail01', [omit_ways(['ghci']), exit_code(1)], compile_and_run,
+test('fptrfail01', [omit_ways(['ghci']),
+                   exit_code(1),
+                   js_skip_csources], compile_and_run,
      ['fptrfail01_c.c'])
 
 test('T2917a', normal, compile_and_run, [''])
@@ -136,7 +140,7 @@ else:
 	flagsForT4038 = ['']
 test('T4038', normal, compile_and_run, flagsForT4038)
 
-test('T4221', [omit_ways(['ghci'])], compile_and_run, ['T4221_c.c'])
+test('T4221', [omit_ways(['ghci']), js_skip_csources], compile_and_run, ['T4221_c.c'])
 
 test('T5402', [ omit_ways(['ghci']),
                 exit_code(42),
@@ -159,7 +163,7 @@ test('Capi_Ctype_001', [extra_files(['Capi_Ctype_A_001.hsc', 'capi_ctype_001.h',
 test('Capi_Ctype_002', [extra_files(['Capi_Ctype_A_002.hsc', 'capi_ctype_002_A.h', 'capi_ctype_002_B.h'])],
      makefile_test, ['Capi_Ctype_002'])
 
-test('ffi_parsing_001', [omit_ways(['ghci'])], compile_and_run,
+test('ffi_parsing_001', [omit_ways(['ghci']), js_skip_csources], compile_and_run,
      ['ffi_parsing_001_c.c'])
 
 test('capi_value', [omit_ways(['ghci'])], compile_and_run, ['capi_value_c.c'])
@@ -172,7 +176,7 @@ test('T7170',
 test('T4012', [expect_broken_for(7388, ['ghci'])], multimod_compile_and_run,
      ['T4012', ''])
 
-test('T8083', [omit_ways(['ghci'])], compile_and_run, ['T8083_c.c'])
+test('T8083', [omit_ways(['ghci']), js_skip_csources], compile_and_run, ['T8083_c.c'])
 
 test('T9274', [omit_ways(['ghci'])], compile_and_run, [''])
 
@@ -184,39 +188,39 @@ test('ffi023', [ omit_ways(['ghci']),
                 # needs it.
               compile_and_run, ['ffi023_c.c'])
 
-test('T12134', [omit_ways(['ghci'])], compile_and_run, ['T12134_c.c'])
+test('T12134', [omit_ways(['ghci']),js_skip_csources], compile_and_run, ['T12134_c.c'])
 
-test('T12614', [omit_ways(['ghci'])], compile_and_run, ['T12614_c.c'])
+test('T12614', [omit_ways(['ghci']),js_skip_csources], compile_and_run, ['T12614_c.c'])
 
 test('T14624', [omit_ways(['ghci'])], compile_and_run, ['T14624_c.c'])
 
 test('T15933', extra_files(['T15933_c.c', 'T15933.h']), makefile_test, ['T15933'])
 
-test('T16650a', [omit_ways(['ghci'])], compile_and_run, ['T16650a_c.c'])
+test('T16650a', [omit_ways(['ghci']), js_skip_csources], compile_and_run, ['T16650a_c.c'])
 
-test('T16650b', [omit_ways(['ghci'])], compile_and_run, ['T16650b_c.c'])
+test('T16650b', [omit_ways(['ghci']), js_skip_csources], compile_and_run, ['T16650b_c.c'])
 
-test('T16650c', [omit_ways(['ghci'])], compile_and_run, ['T16650c_c.c'])
+test('T16650c', [omit_ways(['ghci']), js_skip_csources], compile_and_run, ['T16650c_c.c'])
 
-test('T16650d', [omit_ways(['ghci'])], compile_and_run, ['T16650d_c.c'])
+test('T16650d', [omit_ways(['ghci']), js_skip_csources], compile_and_run, ['T16650d_c.c'])
 
-test('PrimFFIInt8', [omit_ways(['ghci'])], compile_and_run, ['PrimFFIInt8_c.c'])
+test('PrimFFIInt8', [omit_ways(['ghci']), js_skip_csources], compile_and_run, ['PrimFFIInt8_c.c'])
 
-test('PrimFFIWord8', [omit_ways(['ghci'])], compile_and_run, ['PrimFFIWord8_c.c'])
+test('PrimFFIWord8', [omit_ways(['ghci']), js_skip_csources], compile_and_run, ['PrimFFIWord8_c.c'])
 
-test('PrimFFIInt16', [omit_ways(['ghci'])], compile_and_run, ['PrimFFIInt16_c.c'])
+test('PrimFFIInt16', [omit_ways(['ghci']), js_skip_csources], compile_and_run, ['PrimFFIInt16_c.c'])
 
-test('PrimFFIWord16', [omit_ways(['ghci'])], compile_and_run, ['PrimFFIWord16_c.c'])
+test('PrimFFIWord16', [omit_ways(['ghci']), js_skip_csources], compile_and_run, ['PrimFFIWord16_c.c'])
 
-test('PrimFFIInt32', [omit_ways(['ghci'])], compile_and_run, ['PrimFFIInt32_c.c'])
+test('PrimFFIInt32', [omit_ways(['ghci']), js_skip_csources], compile_and_run, ['PrimFFIInt32_c.c'])
 
-test('PrimFFIWord32', [omit_ways(['ghci'])], compile_and_run, ['PrimFFIWord32_c.c'])
+test('PrimFFIWord32', [omit_ways(['ghci']), js_skip_csources], compile_and_run, ['PrimFFIWord32_c.c'])
 
-test('T493', [omit_ways(['ghci'])], compile_and_run, ['T493_c.c'])
+test('T493', [omit_ways(['ghci']), js_skip_csources], compile_and_run, ['T493_c.c'])
 
-test('UnliftedNewtypesByteArrayOffset', [omit_ways(['ghci'])], compile_and_run, ['UnliftedNewtypesByteArrayOffset_c.c'])
+test('UnliftedNewtypesByteArrayOffset', [omit_ways(['ghci']), js_skip_csources], compile_and_run, ['UnliftedNewtypesByteArrayOffset_c.c'])
 
-test('T17471', [omit_ways(['ghci'])], compile_and_run,
+test('T17471', [omit_ways(['ghci']), js_skip_csources], compile_and_run,
      ['T17471_c.c -optc-D -optcFOO'])
 
 test('IncallAffinity',
@@ -226,7 +230,7 @@ test('IncallAffinity',
      compile_and_run,
      ['IncallAffinity_c.c -no-hs-main'])
 
-test('T19237', normal, compile_and_run, ['T19237_c.c'])
+test('T19237', js_skip_csources, compile_and_run, ['T19237_c.c'])
 
 test('T21305', [cmm_src,omit_ways(['ghci'])], multi_compile_and_run,
                  ['T21305', [('T21305_cmm.cmm', '')], ''])


=====================================
testsuite/tests/generics/all.T
=====================================
@@ -20,9 +20,9 @@ test('GenCannotDoRep1_8', normal, compile_fail, [''])
 test('GFullyStrict', normal, compile_and_run, [''])
 
 test('T5462Yes1', [extra_files(['GEnum/', 'GEq/', 'GFunctor/']),
-                   outputdir('out_T5462Yes1')]
+                   outputdir('out_T5462Yes1'), js_skip_csources]
     , multimod_compile_and_run, ['T5462Yes1', '-iGEq -iGEnum -iGFunctor'])
-test('T5462Yes2', [extra_files(['GFunctor/']), outputdir('out_T5462Yes2')]
+test('T5462Yes2', [extra_files(['GFunctor/']), outputdir('out_T5462Yes2'), js_skip_csources]
     , multimod_compile_and_run, ['T5462Yes2', '-iGFunctor'])
 test('T5462No1', [extra_files(['GFunctor/']), outputdir('out_T5462No1')]
     , multimod_compile_fail, ['T5462No1', '-iGFunctor'])


=====================================
testsuite/tests/rep-poly/all.T
=====================================
@@ -40,9 +40,9 @@ test('RepPolyArgument', normal, compile_fail, [''])
 test('RepPolyArrowCmd', normal, compile_fail, [''])
 test('RepPolyArrowFun', normal, compile_fail, [''])
 test('RepPolyBackpack1', normal, backpack_compile_fail, [''])
-test('RepPolyBackpack2', normal, backpack_run, [''])
+test('RepPolyBackpack2', js_skip_csources, backpack_run, [''])
 test('RepPolyBackpack3', normal, backpack_compile_fail, [''])
-test('RepPolyBackpack4', normal, backpack_run, [''])
+test('RepPolyBackpack4', js_skip_csources, backpack_run, [''])
 test('RepPolyBackpack5', normal, backpack_run, [''])
 test('RepPolyBinder', normal, compile_fail, [''])
 test('RepPolyCase1', normal, compile_fail, [''])


=====================================
testsuite/tests/rts/all.T
=====================================
@@ -276,7 +276,7 @@ test('T7037', [], makefile_test, ['T7037'])
 test('T7087', exit_code(1), compile_and_run, [''])
 test('T7160', omit_ways(['nonmoving_thr', 'nonmoving_thr_ghc']), compile_and_run, [''])
 
-test('T7040', [omit_ways(['ghci'])], compile_and_run, ['T7040_c.c'])
+test('T7040', [omit_ways(['ghci']), js_skip_csources], compile_and_run, ['T7040_c.c'])
 
 test('T7040_ghci',
      [extra_files(['T7040_c.h']),
@@ -388,7 +388,7 @@ test('T9839_05',
 test('T10590', [ignore_stderr, when(opsys('mingw32'), skip)], compile_and_run, [''])
 
 # 20000 was easily enough to trigger the bug with 7.10
-test('T10904', [ omit_ways(['ghci']), extra_run_opts('20000') ],
+test('T10904', [ omit_ways(['ghci']), extra_run_opts('20000'), js_skip_csources ],
                compile_and_run, ['T10904lib.c'])
 
 test('T10728', [extra_run_opts('+RTS -maxN3 -RTS'), only_ways(['threaded2'])],
@@ -483,10 +483,10 @@ test('keep-cafs',
 
 # Test proper functioning of C++ exceptions within a C++ program.
 # On darwin, this requires -fcompact-unwind.
-test('T11829', [ check_errmsg("This is a test") ], compile_and_run,
+test('T11829', [ check_errmsg("This is a test"), js_skip_csources], compile_and_run,
      ['T11829_c.cpp -package system-cxx-std-lib'])
 
-test('T16514', normal, compile_and_run, ['T16514_c.c'])
+test('T16514', js_skip_csources, compile_and_run, ['T16514_c.c'])
 test('test-zeroongc', extra_run_opts('-DZ'), compile_and_run, ['-debug'])
 
 test('T13676',



View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/ebe0e1fb3941fb9e6681edc453b2c73f71ec2b23...7287a0521bf21cb800ff3455b744b5d3b3ab450f

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/ebe0e1fb3941fb9e6681edc453b2c73f71ec2b23...7287a0521bf21cb800ff3455b744b5d3b3ab450f
You're receiving this email because of your account on gitlab.haskell.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-commits/attachments/20221007/8ff231e6/attachment-0001.html>


More information about the ghc-commits mailing list