Skip to content

Commit 2bc359a

Browse files
committed
テストスクリプトを使う
1 parent 13636a5 commit 2bc359a

File tree

2 files changed

+36
-1
lines changed

2 files changed

+36
-1
lines changed

.github/workflows/build-debug.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -238,4 +238,4 @@ jobs:
238238
- name: E2E Test sora-python-sdk
239239
working-directory: sora-python-sdk
240240
run: |
241-
lldb-18 -o 'settings set target.process.follow-fork-mode child' -o run -o continue -o 'bt all' -o 'exit' -- uv run pytest tests -s
241+
lldb-18 --batch -o 'command script import test_with_llvm.py' -o 'test'

test_with_llvm.py

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
import sys
2+
import time
3+
4+
import lldb
5+
6+
7+
def test(debugger, command, result, internal_dict):
8+
debugger.HandleCommand("settings set target.process.follow-fork-mode child")
9+
10+
target = debugger.CreateTargetWithFileAndArch("uv", lldb.LLDB_ARCH_DEFAULT)
11+
process = target.LaunchSimple(["run", "pytest", "tests", "-s"], None, None)
12+
13+
if not process:
14+
print("Error: could not launch process")
15+
return
16+
17+
while True:
18+
time.sleep(1.0)
19+
state = process.GetState()
20+
21+
if state == lldb.eStateExited:
22+
exit_status = process.GetExitStatus()
23+
sys.exit(exit_status)
24+
elif state == lldb.eStateStopped:
25+
thread = process.GetSelectedThread()
26+
if thread.GetStopReason() == lldb.eStopReasonExec:
27+
process.Continue()
28+
continue
29+
debugger.HandleCommand("bt all")
30+
sys.exit(1)
31+
32+
33+
# LLDBにスクリプトを初期化してコマンドを追加
34+
def __lldb_init_module(debugger, internal_dict):
35+
debugger.HandleCommand("command script add -f test_with_llvm.test test")

0 commit comments

Comments
 (0)