forked from bytecodealliance/wasm-micro-runtime
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'bytecodealliance:main' into main
- Loading branch information
Showing
15 changed files
with
511 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,6 +21,7 @@ on: | |
- "tests/wamr-test-suites/**" | ||
- "wamr-compiler/**" | ||
- "wamr-sdk/**" | ||
- "test-tools/wamr-ide/**" | ||
# will be triggered on push events | ||
push: | ||
branches: | ||
|
@@ -38,6 +39,7 @@ on: | |
- "tests/wamr-test-suites/**" | ||
- "wamr-compiler/**" | ||
- "wamr-sdk/**" | ||
- "test-tools/wamr-ide/**" | ||
# allow to be triggered manually | ||
workflow_dispatch: | ||
|
||
|
@@ -545,3 +547,117 @@ jobs: | |
if: env.TEST_ON_X86_32 == 'true' | ||
run: ./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: | ||
needs: | ||
[ | ||
build_iwasm | ||
] | ||
runs-on: ubuntu-22.04 | ||
env: | ||
PYTHON_VERSION: '3.10' | ||
PYTHON_UBUNTU_STANDALONE_BUILD: https://github.com/indygreg/python-build-standalone/releases/download/20230507/cpython-3.10.11+20230507-x86_64-unknown-linux-gnu-install_only.tar.gz | ||
|
||
steps: | ||
- name: checkout | ||
uses: actions/checkout@v3 | ||
|
||
- name: install dependencies | ||
run: | | ||
rustup target add wasm32-wasi | ||
sudo apt update && sudo apt-get install -y lld ninja-build | ||
npm install | ||
working-directory: test-tools/wamr-ide/VSCode-Extension | ||
|
||
- name: build iwasm with source debugging feature | ||
run: | | ||
mkdir build | ||
cd build | ||
cmake .. -DWAMR_BUILD_DEBUG_INTERP=1 | ||
make | ||
working-directory: product-mini/platforms/linux | ||
|
||
- name: Cache LLDB | ||
id: cache-lldb | ||
uses: actions/cache@v3 | ||
env: | ||
cache-name: cache-lldb-vscode | ||
with: | ||
path: test-tools/wamr-ide/VSCode-Extension/resource/debug/linux | ||
key: ${{ env.cache-name }}-${{ hashFiles('build-scripts/lldb-wasm.patch') }}-${{ env.PYTHON_UBUNTU_STANDALONE_BUILD }} | ||
|
||
- if: ${{ steps.cache-lldb.outputs.cache-hit != 'true' }} | ||
name: get stand-alone python ubuntu | ||
run: | | ||
wget ${{ env.PYTHON_UBUNTU_STANDALONE_BUILD }} -O python.tar.gz | ||
tar -xvf python.tar.gz | ||
working-directory: core/deps | ||
|
||
- if: ${{ steps.cache-lldb.outputs.cache-hit != 'true' }} | ||
name: download llvm | ||
run: | | ||
wget https://github.com/llvm/llvm-project/archive/1f27fe6128769f00197925c3b8f6abb9d0e5cd2e.zip | ||
unzip -q 1f27fe6128769f00197925c3b8f6abb9d0e5cd2e.zip | ||
mv llvm-project-1f27fe6128769f00197925c3b8f6abb9d0e5cd2e llvm-project | ||
working-directory: core/deps | ||
|
||
- if: ${{ steps.cache-lldb.outputs.cache-hit != 'true' }} | ||
name: apply wamr patch | ||
run: | | ||
git init | ||
git config user.email "[email protected]" | ||
git config user.name "github action" | ||
git apply ../../../build-scripts/lldb-wasm.patch | ||
working-directory: core/deps/llvm-project | ||
|
||
- if: ${{ steps.cache-lldb.outputs.cache-hit != 'true' }} | ||
name: build lldb ubuntu | ||
run: | | ||
echo "start to build lldb..." | ||
mkdir -p wamr-lldb | ||
cmake -S ./llvm -B build \ | ||
-G Ninja \ | ||
-DCMAKE_INSTALL_PREFIX=../wamr-lldb \ | ||
-DCMAKE_BUILD_TYPE:STRING="Release" \ | ||
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON \ | ||
-DLLVM_ENABLE_PROJECTS="clang;lldb" \ | ||
-DLLVM_TARGETS_TO_BUILD:STRING="X86;WebAssembly" \ | ||
-DLLVM_BUILD_BENCHMARKS:BOOL=OFF \ | ||
-DLLVM_BUILD_DOCS:BOOL=OFF \ | ||
-DLLVM_BUILD_EXAMPLES:BOOL=OFF \ | ||
-DLLVM_BUILD_LLVM_DYLIB:BOOL=OFF \ | ||
-DLLVM_BUILD_TESTS:BOOL=OFF \ | ||
-DLLVM_INCLUDE_BENCHMARKS:BOOL=OFF \ | ||
-DLLVM_INCLUDE_DOCS:BOOL=OFF \ | ||
-DLLVM_INCLUDE_EXAMPLES:BOOL=OFF \ | ||
-DLLVM_INCLUDE_TESTS:BOOL=OFF \ | ||
-DLLVM_ENABLE_BINDINGS:BOOL=OFF \ | ||
-DLLVM_ENABLE_LIBXML2:BOOL=ON \ | ||
-DLLVM_ENABLE_LLD:BOOL=ON \ | ||
-DLLDB_ENABLE_PYTHON:BOOL=ON \ | ||
-DLLDB_EMBED_PYTHON_HOME=ON \ | ||
-DLLDB_PYTHON_HOME=.. \ | ||
-DLLDB_PYTHON_RELATIVE_PATH=lib/lldb-python \ | ||
-DPython3_EXECUTABLE="$(pwd)/../python/bin/python${{ env.PYTHON_VERSION }}" | ||
cmake --build build --target lldb install --parallel $(nproc) | ||
working-directory: core/deps/llvm-project | ||
|
||
- if: ${{ steps.cache-lldb.outputs.cache-hit != 'true' }} | ||
name: copy lldb to extension folder | ||
run: | | ||
mkdir -p bin | ||
mkdir -p lib | ||
cp ../../../../../../core/deps/llvm-project/lldb/tools/lldb-vscode/package.json ./ | ||
cp -r ../../../../../../core/deps/llvm-project/lldb/tools/lldb-vscode/syntaxes/ ./ | ||
cp ../../../../../../core/deps/llvm-project/build/bin/lldb* bin | ||
cp ../../../../../../core/deps/llvm-project/build/lib/liblldb*.so lib | ||
cp ../../../../../../core/deps/llvm-project/build/lib/liblldb*.so.* lib | ||
cp -R ../../../../../../core/deps/llvm-project/build/lib/lldb-python lib | ||
cp -R ../../../../../../core/deps/python/lib/python* lib | ||
cp ../../../../../../core/deps/python/lib/libpython${{ env.PYTHON_VERSION }}.so.1.0 lib | ||
working-directory: test-tools/wamr-ide/VSCode-Extension/resource/debug/linux | ||
|
||
- name: run tests | ||
timeout-minutes: 5 | ||
run: xvfb-run npm run test | ||
working-directory: test-tools/wamr-ide/VSCode-Extension |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
engine-strict=true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# compile with debug symbols and no optimization | ||
rustc --target wasm32-wasi ./test.rs -g -C opt-level=0 |
35 changes: 35 additions & 0 deletions
35
test-tools/wamr-ide/VSCode-Extension/resource/test/test.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
/* | ||
* Copyright (C) 2019 Intel Corporation. All rights reserved. | ||
* SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | ||
*/ | ||
|
||
use std::collections::HashMap; | ||
use std::collections::VecDeque; | ||
use std::cell::RefCell; | ||
|
||
fn main() { | ||
let mut vector = Vec::from([1, 2, 3, 4]); | ||
vector.push(12); | ||
|
||
let mut map: HashMap<&str, f64> = HashMap::from([ | ||
("Mercury", 0.4), | ||
("Venus", 0.7), | ||
("Earth", 1.0), | ||
("Mars", 1.5), | ||
]); | ||
map.insert("Venus", 2.5); | ||
map.insert("Sun", 312.2); | ||
|
||
let string = "this is a string"; | ||
|
||
let tmp = String::from("hello world"); | ||
let slice = &tmp[1..5]; | ||
|
||
let mut deque = VecDeque::from([1, 2, 3]); | ||
deque.push_back(4); | ||
deque.push_back(5); | ||
|
||
let ref_cell = RefCell::new(5); | ||
|
||
println!("Hello, world!"); // BP_MARKER_1 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
/* | ||
* Copyright (C) 2019 Intel Corporation. All rights reserved. | ||
* SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | ||
*/ | ||
|
||
import * as path from 'path'; | ||
import * as os from 'os'; | ||
|
||
import { runTests } from '@vscode/test-electron'; | ||
|
||
async function main() { | ||
try { | ||
// The folder containing the Extension Manifest package.json | ||
// Passed to `--extensionDevelopmentPath` | ||
const extensionDevelopmentPath = path.resolve(__dirname, '../../'); | ||
|
||
// The path to the extension test script | ||
// Passed to --extensionTestsPath | ||
const extensionTestsPath = path.resolve(__dirname, './suite/index'); | ||
|
||
// Download VS Code, unzip it and run the integration test | ||
await runTests({ | ||
extensionDevelopmentPath, | ||
extensionTestsPath, | ||
launchArgs: ['--user-data-dir', `${os.tmpdir()}`] | ||
}); | ||
} catch (err) { | ||
console.error('Failed to run tests'); | ||
process.exit(1); | ||
} | ||
} | ||
|
||
main(); |
Oops, something went wrong.