Repository navigation
[TEST] ExternalProcess: cover spaces in the executable path and arguments (#9460) - #9531
Conversation
…ents (OpenMS#9460) ExternalProcess_test only ran PATH-resolved tools (ls/cmd) with simple args. Adds a case (non-Windows) that creates an executable script at a path containing a space and runs it with a single argument that itself contains spaces, then asserts: - the spaces-in-path executable launches (RETURNSTATE::SUCCESS) and its stdout is captured intact, and - the spaced argument arrives as ONE argument (arg=[one two three]), i.e. it is not shell-split -- boost::process receives argv as a vector. Windows is guarded out (launching a freshly-written .bat needs a cmd shim; the existing cmd-based section covers it). Verified: builds clean and the test runs PASSED. Co-Authored-By: Claude Opus 4.8 <[email protected]>
|
@timosachsenberg The following names might be missing from the
Please consider applying the following patch: --- AUTHORS 2026-06-15 15:38:29.783226260 +0000
+++ AUTHORS.new 2026-06-15 15:38:35.001709761 +0000
@@ -23,8 +23,8 @@
- Chirag Dave
- Chris Bauer
- Chris Bielow
- - Christie Mathews
- Christian Ehrlich
+ - Christie Mathews
- Clemens Groepl
- Cornelia Friedle
- Daniel Jameson |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughA new ChangesExternalProcess spaces-in-path test
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
What
Adds an
ExternalProcess_testcase (non-Windows) that:…/open ms space dir/my script.sh),ExternalProcess::runwith a single argument that itself contains spaces ("one two three"),RETURNSTATE::SUCCESS), its stdout is captured intact (MARKER_STDOUT_OK), and the spaced argument arrived as one argument (arg=[one two three]), i.e. it was not shell-split.Why
Closes the §1 (Qt removal:
QProcess → boost::process)[AUTO]task in the OpenMS 3.6.0 pre-release testing plan (#9460):The existing section only ran PATH-resolved tools (
ls/cmd) with whitespace-free args, so neither the spaces-in-exe-path pitfall (thinkC:\Program Files\…//opt/My Tool/…) nor single-argument quoting was exercised.boost::processreceivesargvas a vector, so no shell re-quoting should occur — this pins that contract.Windows is guarded out (
#ifndef OPENMS_WINDOWSPLATFORM): launching a freshly-written.batthroughExternalProcessneeds acmdshim, and the existingcmd-based section already covers the Windows lane — matching the file's existing platform branching.Test plan
Tests only — no production code changed. Verified locally:
-fsyntax-onlyclean, full build green, test runs PASSED (both new assertionsok). The case confirmsExternalProcessalready handles spaces correctly (no bug surfaced — it's a regression guard).Part of #9460. Follows #9524, #9525, #9526, #9528, #9530.
🤖 Generated with Claude Code
Summary by CodeRabbit