Skip to content

Commit

Permalink
debug: refactor test script
Browse files Browse the repository at this point in the history
  • Loading branch information
cpunion committed Sep 30, 2024
1 parent 387c440 commit 2732f60
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
1 change: 1 addition & 0 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ jobs:
bash .github/workflows/test_llgo.sh
- name: LLDB tests
if: ${{startsWith(matrix.os, 'macos')}}
run: |
echo "Test lldb with llgo plugin on ${{matrix.os}} with LLVM ${{matrix.llvm}}"
bash _lldb/runtest.sh -v
Expand Down
17 changes: 16 additions & 1 deletion _lldb/runtest.sh
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,23 @@ build_project "$package_path" || exit 1
# Set up the result file path
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
"$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
if [ -f "$result_file" ]; then
Expand Down

0 comments on commit 2732f60

Please sign in to comment.