A simplified, high-performance testing framework for WebAssembly debugging functionality in WebKit's JavaScriptCore with intelligent parallel execution.
Single Test Execution: One test at a time using port 12340
Framework Process (PID: 12345):
โโโ Main Thread (TID: 100) - coordinates execution
โโโ Per Test:
โโโ JSC Process (PID: 12346)
โโโ LLDB Process (PID: 12347)
โโโ 4 Monitor Threads (TIDs: 101-104): JSC stdout/stderr, LLDB stdout/stderr
Total: 3 Processes, 5 Threads per test
Simple, reliable execution for debugging individual tests
--parallel)Multi-Worker Execution: ThreadPoolExecutor with smart worker calculation
Example: 3 Tests, 2 Workers
Framework Process (PID: 12345):
โโโ Main Thread (TID: 100) - coordinates execution
โโโ Worker Thread 1 (TID: 101) - TestA (Port: 12340)
โ โโโ JSC Process (PID: 12346)
โ โโโ LLDB Process (PID: 12347)
โ โโโ 4 Monitor Threads (TIDs: 103-106): JSC stdout/stderr, LLDB stdout/stderr
โโโ Worker Thread 2 (TID: 102) - TestB (Port: 12341)
โโโ JSC Process (PID: 12348)
โโโ LLDB Process (PID: 12349)
โโโ 4 Monitor Threads (TIDs: 107-110): JSC stdout/stderr, LLDB stdout/stderr
Peak Concurrent: 5 Processes, 11 Threads
Total Used: 7 Processes, 15 Threads (when TestA finishes, Worker 1 picks up TestC)
lib/
โโโ core/ # Core framework components
โ โโโ base.py # BaseTestCase with pattern matching
โ โโโ environment.py # WebKit environment setup
โ โโโ registry.py # Test case registry
โ โโโ utils.py # Logging with PID/TID support
โโโ discovery/ # Test discovery system
โ โโโ auto_discovery.py # Automatic test case discovery
โโโ runners/ # Test execution engines
โโโ sequential.py # Sequential test runner
โโโ parallel.py # Parallel test execution
โโโ process_manager.py # Per-test process isolation
tests/ # Auto-discovered test cases
โโโ add.py # WebAssembly debugging tests
โโโ ... # Additional test cases
Create file in tests/my_test.py
from lib.core.base import BaseTestCase class MyTestCase(BaseTestCase): def execute(self): # Setup debugging session (JSC + LLDB) self.setup_debugging_session_or_raise("resources/c-wasm/add/main.js") # Send LLDB commands self.send_lldb_command_or_raise("b main") self.send_lldb_command_or_raise("c") # Validate results self.send_lldb_command_or_raise("dis")
Auto-Discovery: Test automatically appears in --list and runs with framework. No manual registration required.
The test framework requires a TOT (Tip of Tree) built LLDB with WebAssembly debugging support, not the system LLDB. The LLDB path is hardcoded in lib/core/environment.py:
hardcoded_lldb = "/Users/yijiahuang/git/WebKit/llvm/build/bin/lldb"
Why TOT LLDB is Required:
--plugin wasm)Fallback Behavior:
lldbTo build the required LLDB, follow the WebKit LLVM build instructions.
# Run all tests (sequential) python3 test-wasm-debugger.py # Run all tests in parallel (auto-detects optimal workers) python3 test-wasm-debugger.py --parallel # Run with specific number of parallel workers python3 test-wasm-debugger.py --parallel=4 # Run specific test with verbose logging python3 test-wasm-debugger.py --test AddTestCase --verbose # List all available tests python3 test-wasm-debugger.py --list # Use specific build configuration python3 test-wasm-debugger.py --debug # Force Debug build python3 test-wasm-debugger.py --release # Force Release build