Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Keywords to split and join command line arguments #2160

Closed
pekkaklarck opened this issue Sep 28, 2015 · 1 comment
Closed

Keywords to split and join command line arguments #2160

pekkaklarck opened this issue Sep 28, 2015 · 1 comment

Comments

@pekkaklarck
Copy link
Member

Keywords to split and join command line arguments would be handy when creating command to be executed. For example, keywords in the Process library typically accept a list of arguments, but more complex expressions to be run in shell need to be given as a single string.

*** Variables ***
${STR ARGS}     arg "second arg"
@{LIST ARGS}    arg    second arg

*** Test Cases ***
Command line to list
    ${args} =    Command line to list    ${STR ARGS}
    Should be equal    ${result}    ${LIST ARGS}
List to command line
    ${args} =    List to command line    ${LIST ARGS}
    Should be equal    ${result}    ${STR ARGS}

We noticed the need for these keywords when cleaning up Robot's own acceptance test execution system (#2091). We plan to use the names used above, but that can still change. Although the current plan is to add them to the Process library, the keywords themselves are generic.

@pekkaklarck pekkaklarck added this to the 2.9.2 milestone Sep 28, 2015
@pekkaklarck pekkaklarck self-assigned this Sep 28, 2015
pekkaklarck added a commit that referenced this issue Sep 28, 2015
- Added new 'Command Line To List' and 'List To Command Line' keywords to the
  Process library to ease splitting/joining cli args. Test and code review as
  well as documentation still missing. #2160

- Replaced simple 'shlex.split' usage in atests with the aforementioned
  Command Line To List keyword in Robot data and with enhanced shlex usage
  in Python libraries.

- Added output files to generic Robot/Rebot execution keywords to avoid output
  streams getting full and execution hang on Windows.

- Added 5 minute timeouts to Robot/Rebot execution keywords to avoid hanging
  in general.

Above fixes related to the overall atest execution cleanup (#2091).
@pekkaklarck
Copy link
Member Author

Implemented and tested in 334886c. Review would be nice and docs also missing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants