debug: refactor test script
This commit is contained in:
1
.github/workflows/go.yml
vendored
1
.github/workflows/go.yml
vendored
@@ -99,6 +99,7 @@ jobs:
|
|||||||
bash .github/workflows/test_llgo.sh
|
bash .github/workflows/test_llgo.sh
|
||||||
|
|
||||||
- name: LLDB tests
|
- name: LLDB tests
|
||||||
|
if: ${{startsWith(matrix.os, 'macos')}}
|
||||||
run: |
|
run: |
|
||||||
echo "Test lldb with llgo plugin on ${{matrix.os}} with LLVM ${{matrix.llvm}}"
|
echo "Test lldb with llgo plugin on ${{matrix.os}} with LLVM ${{matrix.llvm}}"
|
||||||
bash _lldb/runtest.sh -v
|
bash _lldb/runtest.sh -v
|
||||||
|
|||||||
@@ -40,8 +40,23 @@ build_project "$package_path" || exit 1
|
|||||||
# Set up the result file path
|
# Set up the result file path
|
||||||
result_file="/tmp/lldb_exit_code"
|
result_file="/tmp/lldb_exit_code"
|
||||||
|
|
||||||
|
# Prepare LLDB commands
|
||||||
|
lldb_commands=(
|
||||||
|
"command script import _lldb/llgo_plugin.py"
|
||||||
|
"command script import _lldb/test.py"
|
||||||
|
"script test.run_tests_with_result('${package_path}/debug.out', ['${package_path}/in.go'], $verbose, $interactive, $plugin_path, '$result_file')"
|
||||||
|
"quit"
|
||||||
|
)
|
||||||
|
|
||||||
|
# Run LLDB with prepared commands
|
||||||
|
lldb_command_string=""
|
||||||
|
for cmd in "${lldb_commands[@]}"; do
|
||||||
|
lldb_command_string+=" -o \"$cmd\""
|
||||||
|
done
|
||||||
|
|
||||||
|
|
||||||
# Run LLDB with the test script
|
# Run LLDB with the test script
|
||||||
"$LLDB_PATH" -o "command script import _lldb/test.py" -o "script test.run_tests_with_result('${package_path}/debug.out', ['${package_path}/in.go'], $verbose, $interactive, $plugin_path, '$result_file')" -o "quit"
|
eval "$LLDB_PATH $lldb_command_string"
|
||||||
|
|
||||||
# Read the exit code from the result file
|
# Read the exit code from the result file
|
||||||
if [ -f "$result_file" ]; then
|
if [ -f "$result_file" ]; then
|
||||||
|
|||||||
Reference in New Issue
Block a user