add cram based unit tests

For improved QA etc. For the start with initial test cases for avl,
base64, jshn and list components. Moved runqueue and blobmsg from
examples to tests.  Converted just a few first test cases from
json-script example into the new cram based unit test, more to come.

Signed-off-by: Petr Štetiar <ynezz@true.cz>
This commit is contained in:
Petr Štetiar 2019-11-19 14:31:44 +01:00
parent 1fefb7c4d7
commit b0a5cd8a28
19 changed files with 594 additions and 7 deletions

View file

@ -0,0 +1,38 @@
[
[ "exec", "%EXECVAR%", "/%%/" ],
[ "if",
[ "eq", "EQVAR", "eqval" ],
[ "exec_if", "%VAR%", "%%", "jk" ]
],
[ "case", "CASEVAR", {
"caseval0": ["cmd_case_0", "cmd_case_arg0", "case_cmd_arg1"],
"caseval1": ["cmd_case_1", "cmd_case_arg0", "case_cmd_arg1"]
} ],
[ "if",
[ "and", [ "eq", "EQVAR", "eqval" ],
[ "has", "HASVAR" ],
[ "regex", "REGEXVAR0", "regexval" ],
[ "regex", "REGEXVAR1", [ "regexval10", "regexval11" ] ],
[ "not", [ "eq", "NOTEQVAR", "noteqval" ] ] ],
[ "exec_if_and", "%ANDVAR%" ]
],
[ "if",
[ "or", [ "eq", "EQVAR", "eqval" ],
[ "has", "HASVAR" ],
[ "regex", "REGEXVAR0", "regexval" ],
[ "regex", "REGEXVAR1", [ "regexval10", "regexval11" ] ],
[ "not", [ "eq", "NOTEQVAR", "noteqval" ] ] ],
[ "exec_if_or", "%ORVAR%" ]
],
[ "if",
[ "isdir", "%ISDIRVAR%" ],
[ "exec_isdir", "%ISDIRVAR%" ]
],
[ "return", "foobar" ],
[ "exec_non_reachable", "Arghhh" ]
]