Skip to content

Commit

Permalink
Lux 3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Håkan Mattsson committed Aug 22, 2024
1 parent 7888af0 commit 2042deb
Show file tree
Hide file tree
Showing 3 changed files with 54 additions and 82 deletions.
66 changes: 26 additions & 40 deletions doc/lux.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Lux - LUcid eXpect scripting
============================

Version 2.9.1 - 2023-10-25
Version 3.0 - 2024-08-21

* [Introduction](#../README)
* [Concepts](#main_concepts)
Expand Down Expand Up @@ -1526,6 +1526,8 @@ refers to a log directory name unique for each test case. The
directory is however not automatically created. It must be created
by you in the test script if you want to use it. If you have created
the directory, it will turn up as a link in the annotated event log.
The **environment variable** `LUX_BIN` is set to the directory where
the `lux` escript resides.

**\[include FileName\]**
Includes and runs the specified script at this point. The `FileName`
Expand Down Expand Up @@ -2949,8 +2951,11 @@ Snippet from the enclosed `.../lux/examples/fail.lux` file:
>
> # Multi-line expect
> """?
> erl
> Erlang/OTP.*
>
> Eshell.*
> $eprompt
> ${eprompt}
> """
>
> # Multi-line send
Expand All @@ -2967,7 +2972,7 @@ Snippet from the enclosed `.../lux/examples/fail.lux` file:
> [timeout 2]
> !5+13.
> # Next line will fail
> ?19
> ?expect_something_else_than_eighteen_will_fail
>
> [cleanup]
> # Save logs at fail
Expand Down Expand Up @@ -3066,55 +3071,37 @@ Here follow the output from the enclosed example test suite under
Evaluate `lux examples`

> .../lux> lux examples
> summary log : /Users/hmattsso/dev/lux/lux_logs/run_2023_10_25_13_33_18_81235/lux_summary.log
> summary log : /Users/hawk/dev/lux/lux_logs/run_2024_08_21_13_55_22_491584/lux_summary.log
> test case : examples/calc.lux
> progress : ..:...:.:...:..:.:.:....:.:..:.:..:..(....:..:.:.:.:.61????61)19
> result : FAIL at line 19:61 in shell calc
> expected*
> \d+>\s.*\.
> (.*)
> \d+>\s
> actual match_timeout
>
> 1>
> .. 2+1.
> 3
> 2>
> diff
> - \d+>\s.*\.
> - (.*)
> - \d+>\s
> +
> + 1>
> + .. 2+1.
> + 3
> + 2>
>
> progress : ..:..:.:....:..:.:.:....:..:.:...(...:..:.:.:...2+1=3.)(.:..:..)...:..:..:..(.:..:..)..(.:..:..)(...:.:....3*4=12.)(.:.:...)..(.:..:..)......:..:........
> result : SUCCESS
> test case : examples/fail.lux
> progress : ..:..:..:.:...:.:..:.:.:..:..:.:.:....:..:..32C..:..:..:..:..:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.
> result : FAIL at line 32 in shell calculator
> progress : ..:..:..:...:..:.:.:..:..:.:.:.....:.:..35C..:..:.:...:.:..:.:.:.:.:.:.:.:.:.:.
> result : FAIL at line 35 in shell calculator
> expected*
> 19
> expect_something_else_than_eighteen_will_fail
> actual match_timeout
>
> 3> 5+13.
> 3> 5+13.
> 18
> 4>
> diff
> - 19
> - expect_something_else_than_eighteen_will_fail
> +
> + 3> 5+13.
> + 3> 5+13.
> + 18
> + 4>
>
> test case : examples/intro.lux
> progress : ..:..:..:..:.:..:....:..:..:.:..:.:..:..:.:..:.:..:.:..:.:.....:..:.:.:....c.:.....:..:..:..:.:..:.:..:.:..:.
> progress : ..:..:..:..:.:.....:..:.:...:.:..:.:..:.:..:.:..:.:......:..:.:.:....c.:.....:..:.:...:.:..:..:.:..
> result : SUCCESS
> test case : examples/loop.lux
> progress : ..:...:.:.((.:..:.:.)(.:.:..:.)(.:.:..:.))((..:.:.:.)(.:.:..:.)(.:..:.:.)(.:.:..:.)(.:.:..:.))((.:.:..:.)(..:.:.:.)(.:..:.:.)(.:..:.)(.:.:..:.)(.:.:..:.)(.:.:..:.)(.:..:.))...:..:.:..:..:.:..:.:..:.:..:.:...:...:.:.:.((.i=1..:..:.:.:..z)(z..i=2...:.:.:.:..z)(z..i=3..:..:.:..z)(:...i=4..:.:..:.):.).c........:..:..:.:..:..:.:.
> progress : ..:..:.:..((.:..:.)(.:.:..)(.:.:..))((.:.:..)(.:.:..)(.:.:..)(.:.:..)(.:.:..))((.:.:..)(.:.:..)(.:.:..)(.:.:..)(.:.:..)(.:.:..)(.:.:..)(.:.:..))...:..:.:..:..:.:..:..:.:....:..:.:..((.i=1..:.:..:.:..z)(z..i=2..:..:.:.:..z)(z..i=3..:..:.:.:..z)(:.z..i=4...:.:.):)..c........:..:.:..:..:.:..:.
> result : SUCCESS
> test case : examples/loop_fail.lux
> progress : ..:..:..:.((.i=1..:..:.:..z)(z..i=2..:...z)(z..i=3...:.:.:..z))+5
> progress : ..:..:.:..:.((.i=1..:.:...z)(z..i=2..:..:..z)(z..i=3..:..:.:..z))+5
> result : FAIL at line 5 in shell break
> expected*
>
Expand All @@ -3128,7 +3115,7 @@ Evaluate `lux examples`
> test case : examples/skip.lux
> result : SKIP as variable TEST_SUNOS is not set
> test case : examples/unstable_warn.lux
> progress : ..:...:.:.:....7
> progress : ..:..:..:....7
> warning : 8: FAIL but UNSTABLE as variable TEST_DEVELOP is not set
> result : WARNING at line 7 in shell foo
> expected*
Expand All @@ -3143,19 +3130,18 @@ Evaluate `lux examples`
> progress : W
> warning : 3: Trailing whitespaces
> result : WARNING
> successful : 2
> successful : 3
> skipped : 1
> examples/skip.lux:6
> examples/skip.lux:6 - skip
> warnings : 2
> examples/unstable_warn.lux:8 - FAIL but UNSTABLE as variable TEST_DEVELOP is not set
> examples/warning.lux:3 - Trailing whitespaces
> failed : 4
> examples/calc.lux:19:61 - match_timeout
> examples/fail.lux:32 - match_timeout
> failed : 3
> examples/fail.lux:35 - match_timeout
> examples/loop_fail.lux:5 - Loop ended without match of break pattern "THIS WILL NEVER MATCH"
> examples/require_fail.lux:3 - FAIL as required variable YADA_MAKE is not set
> summary : FAIL
> file:///Users/hmattsso/dev/lux/lux_logs/run_2023_10_25_13_33_18_81235/lux_summary.log.html
> file:///Users/hawk/dev/lux/lux_logs/run_2024_08_21_13_55_22_491584/lux_summary.log.html
> .../lux> echo $?
> 1
Expand Down
68 changes: 27 additions & 41 deletions lux.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<body>
<h1>Lux - LUcid eXpect scripting</h1>

<p>Version 2.9.1 - 2023-10-25</p>
<p>Version 3.0 - 2024-08-21</p>

<ul>
<li><a href="#../README">Introduction</a></li>
Expand Down Expand Up @@ -1612,7 +1612,9 @@ <h3>Meta statements</h3>
refers to a log directory name unique for each test case. The
directory is however not automatically created. It must be created
by you in the test script if you want to use it. If you have created
the directory, it will turn up as a link in the annotated event log.</p>
the directory, it will turn up as a link in the annotated event log.
The <strong>environment variable</strong> <code>LUX_BIN</code> is set to the directory where
the <code>lux</code> escript resides.</p>

<p><strong>[include FileName]</strong> <br />
Includes and runs the specified script at this point. The <code>FileName</code>
Expand Down Expand Up @@ -3066,8 +3068,11 @@ <h2>A failing test case</h2>

# Multi-line expect
"""?
erl
Erlang/OTP.*

Eshell.*
$eprompt
${eprompt}
"""

# Multi-line send
Expand All @@ -3084,7 +3089,7 @@ <h2>A failing test case</h2>
[timeout 2]
!5+13.
# Next line will fail
?19
?expect_something_else_than_eighteen_will_fail

[cleanup]
# Save logs at fail
Expand Down Expand Up @@ -3198,55 +3203,37 @@ <h2>Warnings and avoiding failures</h2>

<blockquote>
<pre><code>.../lux&gt; lux examples
summary log : /Users/hmattsso/dev/lux/lux_logs/run_2023_10_25_13_33_18_81235/lux_summary.log
summary log : /Users/hawk/dev/lux/lux_logs/run_2024_08_21_13_55_22_491584/lux_summary.log
test case : examples/calc.lux
progress : ..:...:.:...:..:.:.:....:.:..:.:..:..(....:..:.:.:.:.61????61)19
result : FAIL at line 19:61 in shell calc
expected*
\d+&gt;\s.*\.
(.*)
\d+&gt;\s
actual match_timeout

1&gt;
.. 2+1.
3
2&gt;
diff
- \d+&gt;\s.*\.
- (.*)
- \d+&gt;\s
+
+ 1&gt;
+ .. 2+1.
+ 3
+ 2&gt;

progress : ..:..:.:....:..:.:.:....:..:.:...(...:..:.:.:...2+1=3.)(.:..:..)...:..:..:..(.:..:..)..(.:..:..)(...:.:....3*4=12.)(.:.:...)..(.:..:..)......:..:........
result : SUCCESS
test case : examples/fail.lux
progress : ..:..:..:.:...:.:..:.:.:..:..:.:.:....:..:..32C..:..:..:..:..:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.
result : FAIL at line 32 in shell calculator
progress : ..:..:..:...:..:.:.:..:..:.:.:.....:.:..35C..:..:.:...:.:..:.:.:.:.:.:.:.:.:.:.
result : FAIL at line 35 in shell calculator
expected*
19
expect_something_else_than_eighteen_will_fail
actual match_timeout

3&gt; 5+13.
3&gt; 5+13.
18
4&gt;
diff
- 19
- expect_something_else_than_eighteen_will_fail
+
+ 3&gt; 5+13.
+ 3&gt; 5+13.
+ 18
+ 4&gt;

test case : examples/intro.lux
progress : ..:..:..:..:.:..:....:..:..:.:..:.:..:..:.:..:.:..:.:..:.:.....:..:.:.:....c.:.....:..:..:..:.:..:.:..:.:..:.
progress : ..:..:..:..:.:.....:..:.:...:.:..:.:..:.:..:.:..:.:......:..:.:.:....c.:.....:..:.:...:.:..:..:.:..
result : SUCCESS
test case : examples/loop.lux
progress : ..:...:.:.((.:..:.:.)(.:.:..:.)(.:.:..:.))((..:.:.:.)(.:.:..:.)(.:..:.:.)(.:.:..:.)(.:.:..:.))((.:.:..:.)(..:.:.:.)(.:..:.:.)(.:..:.)(.:.:..:.)(.:.:..:.)(.:.:..:.)(.:..:.))...:..:.:..:..:.:..:.:..:.:..:.:...:...:.:.:.((.i=1..:..:.:.:..z)(z..i=2...:.:.:.:..z)(z..i=3..:..:.:..z)(:...i=4..:.:..:.):.).c........:..:..:.:..:..:.:.
progress : ..:..:.:..((.:..:.)(.:.:..)(.:.:..))((.:.:..)(.:.:..)(.:.:..)(.:.:..)(.:.:..))((.:.:..)(.:.:..)(.:.:..)(.:.:..)(.:.:..)(.:.:..)(.:.:..)(.:.:..))...:..:.:..:..:.:..:..:.:....:..:.:..((.i=1..:.:..:.:..z)(z..i=2..:..:.:.:..z)(z..i=3..:..:.:.:..z)(:.z..i=4...:.:.):)..c........:..:.:..:..:.:..:.
result : SUCCESS
test case : examples/loop_fail.lux
progress : ..:..:..:.((.i=1..:..:.:..z)(z..i=2..:...z)(z..i=3...:.:.:..z))+5
progress : ..:..:.:..:.((.i=1..:.:...z)(z..i=2..:..:..z)(z..i=3..:..:.:..z))+5
result : FAIL at line 5 in shell break
expected*

Expand All @@ -3260,7 +3247,7 @@ <h2>Warnings and avoiding failures</h2>
test case : examples/skip.lux
result : SKIP as variable TEST_SUNOS is not set
test case : examples/unstable_warn.lux
progress : ..:...:.:.:....7
progress : ..:..:..:....7
warning : 8: FAIL but UNSTABLE as variable TEST_DEVELOP is not set
result : WARNING at line 7 in shell foo
expected*
Expand All @@ -3275,19 +3262,18 @@ <h2>Warnings and avoiding failures</h2>
progress : W
warning : 3: Trailing whitespaces
result : WARNING
successful : 2
successful : 3
skipped : 1
examples/skip.lux:6
examples/skip.lux:6 - skip
warnings : 2
examples/unstable_warn.lux:8 - FAIL but UNSTABLE as variable TEST_DEVELOP is not set
examples/warning.lux:3 - Trailing whitespaces
failed : 4
examples/calc.lux:19:61 - match_timeout
examples/fail.lux:32 - match_timeout
failed : 3
examples/fail.lux:35 - match_timeout
examples/loop_fail.lux:5 - Loop ended without match of break pattern "THIS WILL NEVER MATCH"
examples/require_fail.lux:3 - FAIL as required variable YADA_MAKE is not set
summary : FAIL
file:///Users/hmattsso/dev/lux/lux_logs/run_2023_10_25_13_33_18_81235/lux_summary.log.html
file:///Users/hawk/dev/lux/lux_logs/run_2024_08_21_13_55_22_491584/lux_summary.log.html
.../lux&gt; echo $?
1
</code></pre>
Expand Down
2 changes: 1 addition & 1 deletion vsn.mk
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
# See the file "LICENSE" for information on usage and redistribution
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.

LUX_VSN=2.9.1
LUX_VSN=3.0

0 comments on commit 2042deb

Please sign in to comment.