Przeglądaj źródła

Enable GC spec test on ubuntu (#2461)

Huang Qi 2 lat temu
rodzic
commit
2e8d2c4e1a

+ 43 - 4
.github/workflows/compilation_on_android_ubuntu.yml

@@ -65,6 +65,7 @@ env:
   THREADS_TEST_OPTIONS: "-s spec -b -p -P"
   THREADS_TEST_OPTIONS: "-s spec -b -p -P"
   X86_32_TARGET_TEST_OPTIONS: "-m x86_32 -P"
   X86_32_TARGET_TEST_OPTIONS: "-m x86_32 -P"
   WASI_TEST_OPTIONS: "-s wasi_certification -w"
   WASI_TEST_OPTIONS: "-s wasi_certification -w"
+  GC_TEST_OPTIONS: "-s spec -G -b -P"
 
 
 jobs:
 jobs:
   build_llvm_libraries_on_ubuntu_2204:
   build_llvm_libraries_on_ubuntu_2204:
@@ -440,6 +441,7 @@ jobs:
             $SIMD_TEST_OPTIONS,
             $SIMD_TEST_OPTIONS,
             $THREADS_TEST_OPTIONS,
             $THREADS_TEST_OPTIONS,
             $WASI_TEST_OPTIONS,
             $WASI_TEST_OPTIONS,
+            $GC_TEST_OPTIONS,
           ]
           ]
         wasi_sdk_release:
         wasi_sdk_release:
           [
           [
@@ -471,10 +473,29 @@ jobs:
             test_option: $MULTI_MODULES_TEST_OPTIONS
             test_option: $MULTI_MODULES_TEST_OPTIONS
           - running_mode: "multi-tier-jit"
           - running_mode: "multi-tier-jit"
             test_option: $SIMD_TEST_OPTIONS
             test_option: $SIMD_TEST_OPTIONS
+          # aot and jit don't support GC
+          - running_mode: "aot"
+            test_option: $GC_TEST_OPTIONS
+          - running_mode: "jit"
+            test_option: $GC_TEST_OPTIONS
+          - running_mode: "multi-tier-jit"
+            test_option: $GC_TEST_OPTIONS
+          - running_mode: "fast-jit"
+            test_option: $GC_TEST_OPTIONS
     steps:
     steps:
       - name: checkout
       - name: checkout
         uses: actions/checkout@v3
         uses: actions/checkout@v3
 
 
+      - name: Set-up OCaml
+        uses: ocaml/setup-ocaml@v2
+        if: matrix.test_option == '$GC_TEST_OPTIONS'
+        with:
+          ocaml-compiler: 4.13
+
+      - name: Set-up Ocamlbuild
+        if: matrix.test_option == '$GC_TEST_OPTIONS'
+        run: opam install ocamlbuild
+
       - name: download and install wasi-sdk
       - name: download and install wasi-sdk
         if: matrix.test_option == '$WASI_TEST_OPTIONS'
         if: matrix.test_option == '$WASI_TEST_OPTIONS'
         run: |
         run: |
@@ -489,9 +510,10 @@ jobs:
 
 
       - name: set env variable(if x86_32 test needed)
       - name: set env variable(if x86_32 test needed)
         if: >
         if: >
-          (matrix.test_option == '$DEFAULT_TEST_OPTIONS' || matrix.test_option == '$THREADS_TEST_OPTIONS'
-           || matrix.test_option == '$WASI_TEST_OPTIONS')
-          && matrix.running_mode != 'fast-jit' && matrix.running_mode != 'jit' && matrix.running_mode != 'multi-tier-jit'
+          ((matrix.test_option == '$DEFAULT_TEST_OPTIONS' || matrix.test_option == '$THREADS_TEST_OPTIONS'
+            || matrix.test_option == '$WASI_TEST_OPTIONS')
+           && matrix.running_mode != 'fast-jit' && matrix.running_mode != 'jit' && matrix.running_mode != 'multi-tier-jit')
+           || (matrix.test_option == '$GC_TEST_OPTIONS')
         run: echo "TEST_ON_X86_32=true" >> $GITHUB_ENV
         run: echo "TEST_ON_X86_32=true" >> $GITHUB_ENV
 
 
       #only download llvm libraries in jit and aot mode
       #only download llvm libraries in jit and aot mode
@@ -528,9 +550,18 @@ jobs:
 
 
       - name: run tests
       - name: run tests
         timeout-minutes: 20
         timeout-minutes: 20
+        if: matrix.test_option != '$GC_TEST_OPTIONS'
         run: ./test_wamr.sh ${{ matrix.test_option }} -t ${{ matrix.running_mode }}
         run: ./test_wamr.sh ${{ matrix.test_option }} -t ${{ matrix.running_mode }}
         working-directory: ./tests/wamr-test-suites
         working-directory: ./tests/wamr-test-suites
 
 
+      - name: run gc tests
+        timeout-minutes: 20
+        if: matrix.test_option == '$GC_TEST_OPTIONS'
+        run: |
+          eval $(opam env)
+          ./test_wamr.sh ${{ matrix.test_option }} -t ${{ matrix.running_mode }}
+        working-directory: ./tests/wamr-test-suites
+
       #only install x32 support libraries when to run x86_32 cases
       #only install x32 support libraries when to run x86_32 cases
       - name: install x32 support libraries
       - name: install x32 support libraries
         if: env.TEST_ON_X86_32 == 'true'
         if: env.TEST_ON_X86_32 == 'true'
@@ -544,10 +575,18 @@ jobs:
 
 
       - name: run tests x86_32
       - name: run tests x86_32
         timeout-minutes: 20
         timeout-minutes: 20
-        if: env.TEST_ON_X86_32 == 'true'
+        if: env.TEST_ON_X86_32 == 'true' && matrix.test_option != '$GC_TEST_OPTIONS'
         run: ./test_wamr.sh ${{ env.X86_32_TARGET_TEST_OPTIONS }} ${{ matrix.test_option }} -t ${{ matrix.running_mode }}
         run: ./test_wamr.sh ${{ env.X86_32_TARGET_TEST_OPTIONS }} ${{ matrix.test_option }} -t ${{ matrix.running_mode }}
         working-directory: ./tests/wamr-test-suites
         working-directory: ./tests/wamr-test-suites
 
 
+      - name: run gc tests x86_32
+        timeout-minutes: 20
+        if: env.TEST_ON_X86_32 == 'true' && matrix.test_option == '$GC_TEST_OPTIONS'
+        run: |
+          eval $(opam env)
+          ./test_wamr.sh ${{ env.X86_32_TARGET_TEST_OPTIONS }} ${{ matrix.test_option }} -t ${{ matrix.running_mode }}
+        working-directory: ./tests/wamr-test-suites
+
   test-wamr-ide:
   test-wamr-ide:
     needs:
     needs:
       [
       [