Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed atest issues on Windows and added kws to split/join cli args.
- 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).
- Loading branch information
1 parent
14d0827
commit 334886c
Showing
10 changed files
with
177 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
*** Settings *** | ||
Suite Setup Run Tests ${EMPTY} standard_libraries/process/commandline.robot | ||
Resource atest_resource.robot | ||
|
||
*** Test Cases *** | ||
Command line to list basics | ||
Check Test Case ${TESTNAME} | ||
|
||
Command line to list with internal quotes | ||
Check Test Case ${TESTNAME} | ||
|
||
Command line to list with unbalanced quotes | ||
Check Test Case ${TESTNAME} | ||
|
||
Command line to list with escaping | ||
Check Test Case ${TESTNAME} | ||
|
||
List to commandline basics | ||
Check Test Case ${TESTNAME} | ||
|
||
List to commandline with internal quotes | ||
Check Test Case ${TESTNAME} | ||
|
||
List to commandline with escaping | ||
Check Test Case ${TESTNAME} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
97 changes: 97 additions & 0 deletions
97
atest/testdata/standard_libraries/process/commandline.robot
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,97 @@ | ||
*** Settings *** | ||
Library Process | ||
|
||
*** Variables *** | ||
${C0} ${EMPTY} | ||
@{L0} @{EMPTY} | ||
${C1} hello | ||
@{L1} hello | ||
${C2} two args | ||
@{L2} two args | ||
${C3} "one arg" | ||
@{L3} one arg | ||
${C4} 'one arg again' | ||
@{L4} one arg again | ||
${C5} multiple "args passed this time" and 'it ought to work' | ||
@{L5} multiple args passed this time and it ought to work | ||
${C6} ä äŋd "öther nön-äcïï" ŝtüff 'hërë wë hävë' | ||
@{L6} ä äŋd öther nön-äcïï ŝtüff hërë wë hävë | ||
${C7} \u1234 "\u2603 \U0001F4A9" | ||
@{L7} \u1234 \u2603 \U0001F4A9 | ||
${C8} c:\\temp "c:\\program files" | ||
@{L8} c:\\temp c:\\program files | ||
${C9} "" '' | ||
@{L9} ${EMPTY} ${EMPTY} | ||
${BASICS} 10 | ||
|
||
*** Test Cases *** | ||
Command line to list basics | ||
[Template] Command line to list should succeed | ||
:FOR ${i} IN RANGE ${BASICS} | ||
\ ${C${i}} @{L${i}} | ||
"justone" justone | ||
|
||
Command line to list with internal quotes | ||
[Template] Command line to list should succeed | ||
"inter'nal quotes" inter'nal quotes | ||
'can be "surrounded"' can be "surrounded" | ||
"with ''other'' quotes" '"""' with ''other'' quotes """ | ||
|
||
Command line to list with unbalanced quotes | ||
[Template] Command line to list should fail | ||
"oo | ||
" | ||
' | ||
"foo"bar" | ||
foo'bar | ||
|
||
Command line to list with escaping | ||
[Template] Command line to list should succeed | ||
c:\\temp c:temp escaping=True | ||
c:\\\\temp c:\\temp escaping=True | ||
"c:\\temp" c:\\temp escaping=True | ||
'c:\\temp' c:\\temp escaping=True | ||
C:\\\\Program\\ Files\\\\Blaah C:\\Program Files\\Blaah escaping=True | ||
"C:\\Program Files\\Blaah" C:\\Program Files\\Blaah escaping=True | ||
'C:\\Program Files\\Blaah' C:\\Program Files\\Blaah escaping=True | ||
"internal \\"quotes\\"\\"" internal "quotes"" escaping=True | ||
'internal \\"quotes\\"\\"' internal \\"quotes\\"\\" escaping=True | ||
'internal \\'quotes\\'\\'' internal 'quotes'' escaping=True | ||
"internal \\'quotes\\'\\'" internal \\'quotes\\'\\' escaping=True | ||
\\\\\\" \\" escaping=True | ||
\\\\\\\\\\" \\\\" escaping=True | ||
\\\\\\"\\\\ \\"\\ escaping=True | ||
"\\\\\\"\\\\" \\"\\ escaping=True | ||
|
||
List to commandline basics | ||
[Template] List to command line should succeed | ||
:FOR ${i} IN RANGE ${BASICS} | ||
\ ${C${i}.replace("'", '"')} @{L${i}} | ||
|
||
List to commandline with internal quotes | ||
[Template] List to command line should succeed | ||
"internal \\"double' quotes" internal "double' quotes | ||
"will be \\"'escaped'\\"" ' \\" will be "'escaped'" ' " | ||
|
||
List to commandline with escaping | ||
[Template] List to command line should succeed | ||
c:\\temp c:\\temp | ||
"C:\\Program Files\\Blaah" C:\\Program Files\\Blaah | ||
\\\\\\" \\" | ||
\\\\\\\\\\" \\\\" | ||
|
||
*** Keywords *** | ||
Command line to list should succeed | ||
[Arguments] ${input} @{expected} &{config} | ||
${result} = Command line to list ${input} &{config} | ||
Should be equal ${result} ${expected} | ||
|
||
Command line to list should fail | ||
[Arguments] ${input} ${error}=No closing quotation | ||
Run keyword and expect error ValueError: Parsing '${input}' failed: ${error} | ||
... Command line to list ${input} | ||
|
||
List to command line should succeed | ||
[Arguments] ${expected} @{input} | ||
${result} = List to command line ${input} | ||
Should be equal ${result} ${expected} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters