Files
hakorune/tools
tomoaki 1869396fd7 refactor(smoke): Consolidate LLVM detection to can_run_llvm() SSOT
**Problem**:
- LLVM availability check scattered across 9+ test files
- Duplicate grep patterns: `--version | grep -q "features.*llvm"`
- Hard to maintain when detection logic changes
- Potential SKIP hell when conditions diverge

**Solution** (Task 3 - Medium Priority):
- Create `can_run_llvm()` function in test_runner.sh (SSOT)
- Consolidate both detection methods:
  1. Primary: `--version | grep features.*llvm`
  2. Fallback: `strings | grep ny-llvmc|NYASH_LLVM_USE_HARNESS`
- Replace all inline checks with function call

**Files Changed**:
- test_runner.sh: Add can_run_llvm() + update run_nyash_llvm()
- 9 test files: Replace inline grep with can_run_llvm()
  - quick: phase285_weak_basic_llvm.sh
  - integration: phase284/285, json_{lint,pp,query}, parity tests

**Benefits**:
- Single point of maintenance (SSOT)
- Consistent LLVM detection across all tests
- Easy to extend (e.g., add Python llvmlite check)
- Prevents future SKIP divergence

**Verification**:
-  phase284_p2_return_in_loop_llvm: PASS
-  phase285_weak_basic_llvm: PASS
-  Quick profile: 154/154 PASS

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-26 17:31:19 +09:00
..