forked from hawk/lux
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Experimental: Add pattern_mode command and config parameter
The setting affects which data that are matched agains fail and success patterns. [pattern_mode] [pattern_mode all] [pattern_mode skip] --pattern_mode=all --pattern_mode=skip
- Loading branch information
Håkan Mattsson
committed
Aug 23, 2023
1 parent
fd9b38a
commit f3b8efa
Showing
11 changed files
with
131 additions
and
2 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -75,6 +75,7 @@ | |
"mode" | ||
"multiplier" | ||
"newshell" | ||
"pattern_mode" | ||
"poll_timeout" | ||
"post_case" | ||
"progress" | ||
|
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,47 @@ | ||
[shell test] | ||
[timeout 30] | ||
|
||
[progress EXPECT SUCCESS] | ||
!echo "aaa<PROMPT>bbb<PROMPT>GOOD<PROMPT>ccc<PROMPT>" > tmp.txt | ||
?SH-PROMPT: | ||
[invoke match] | ||
|
||
[progress EXPECT FAST FAIL] | ||
!echo "aaa<PROMPT>bbb<PROMPT>BAD<PROMPT>ccc<PROMPT>" > tmp.txt | ||
?SH-PROMPT: | ||
[invoke match] | ||
|
||
[macro match] | ||
# When <PROMPT> is seen we know that the output is ready to be | ||
# matched. If something unexpected is seen before the <PROMPT> | ||
# instead we know it is wrong and then we want to fail fast. This | ||
# setup requires [pattern_mode skip]. | ||
|
||
[my old_mode=${LUX_PATTERN_MODE}] | ||
[my old_fail=${LUX_FAIL_PATTERN}] | ||
|
||
[pattern_mode skip] | ||
-<PROMPT> | ||
|
||
!cat tmp.txt | ||
"""? | ||
aaa<PROMPT> | ||
""" | ||
"""? | ||
bbb<PROMPT> | ||
""" | ||
"""? | ||
GOOD<PROMPT> | ||
""" | ||
"""? | ||
ccc<PROMPT> | ||
""" | ||
-${old_fail} | ||
[pattern_mode ${old_mode}] | ||
|
||
?SH-PROMPT: | ||
[endmacro] | ||
|
||
[cleanup] | ||
!rm -f tmp.txt | ||
?SH-PROMPT: |
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