Skip to content

Commit d357fa2

Browse files
author
Mohammad Azim Khan
committed
Updated README.md with review suggestion and authcrypt.log with stricter regex
1 parent fd508b2 commit d357fa2

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

tests/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Examples are tested using tool [mbedhtrun](https://github.com/ARMmbed/htrun) and
44

55
## How to create templated log
66

7-
The idea is to check that repeated execution of the examples produce same serial output. An example produces serial output when code contains ```printf``` statements. Serial output may change for ligitimate reasons like use of random data or data and time stamps. Thats why the log is converted to a template. This means that either the text/lines that differ in every execution are removed or they are converted into regular expressions. See the example below:
7+
The idea is to check that repeated execution of the example produces serial output that matches expected pattern. An example produces serial output when code contains ```printf``` statements. Serial output may change for legitimate reasons like use of random data or date and time stamps. That's why the log is converted to a template. This means that either the text/lines that differ in every execution are removed or they are converted into regular expressions. See the example below:
88

99
```
1010
@@ -94,7 +94,7 @@ Hello world! Hello world!
9494
9595
```
9696

97-
Please observe above that all the lines that have data that changes from execution to execution (on right) have been removed. It makes it possible htrun to compare these logs. htrun matches lines from the compare log (on left) one by one. It keeps on looking for a line until it matches. Once matched it moves on to match the next line. If it finds all lines from the compare log in the target serial output stream. Then it halts and passes the examples.
97+
Please observe above that all the lines that have data that changes from execution to execution (on right) have been removed enabling htrun to compare these logs. htrun matches lines from the compare log (on left) one by one. It keeps on looking for a line until it matches. Once matched it moves on to match the next line. If it finds all lines from the compare log in the target serial output stream. Then it halts and the test passes.
9898

9999
Another example with regular examples is shown below:
100100

tests/authcrypt.log

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
plaintext message: [0-9a-fA-F]*
2-
ciphertext: [0-9a-fA-F]*
3-
decrypted: [0-9a-fA-F]*
1+
plaintext message: [0-9a-fA-F]+
2+
ciphertext: [0-9a-fA-F]+
3+
decrypted: [0-9a-fA-F]+
44
DONE

0 commit comments

Comments
 (0)