Home Corporate Contacts TETware Knowledgebase |
ProductsSolutionsInformationDatasheetDocumentationFAQKnowledgebase |
Return to Knowledgebase Index25. Displaying scenario trees with tetscppThere is a useful program that you can build which shows you how thetcc
scenario parser interprets a scenario file.
It is not part of the official TETware release (and therefore is not
supported) but it enables you to look at the scenario tree without
having to go to the trouble of getting
tcc
to execute the scenario and
then digging around in journal and debug output.
The program is called
To build this program: cd $TET_ROOT/src/tet3/tcc make tetscpp The syntax of tetscpp
is as follows:
The following options are understood:
In addition, trace options may be specified using -T
in the usual way.
When the
tet_Tscen
flag (flag indicator
p )
is non-zero, the output
includes the address of the scentab element from which each output line
is derived.
(Trace options are described in the appendix entitled ``Trace and
debugging facilities'' in the TETware User Guide.)
Example 1 Here is the scenario from the distributed demonstration test suite that is described in the TETware Programmers Guide: all "starting scenario" :remote,000,001: /ts/tc1 /ts/tc2 "next is the last test case" /ts/tc3 :endremote: "done" The following output is generated when this scenario is processed by tetscpp -P :
scenario("all") { sceninfo("starting scenario"); remote(0, 1) { testcase("/ts/tc1", "all"); testcase("/ts/tc2", "all"); sceninfo("next is the last test case"); testcase("/ts/tc3", "all"); } sceninfo("done"); } Example 2 Consider the following two scenarios.
At first inspection they appear to be different but analysis with
all :timed_loop,18000: :parallel: :repeat,10: /tset/test1/tc1 /tset/test2/tc2 /tset/test3/tc3 :endrepeat: :repeat,30: :random: /tset/test4/tc4 /tset/test5/tc5 /tset/test6/tc6 /tset/test7/tc7 :endrandom: :endrepeat: :endparallel: :endtimed_loop: Scenario 2: all :timed_loop,18000:^loop1 loop1 :parallel:^list1 loop2 :repeat,10:^list2 loop3 :repeat,30;random:^list3 list1 ^loop2 ^loop3 list2 /tset/test1/tc1 /tset/test2/tc2 /tset/test3/tc3 list3 /tset/test4/tc4 /tset/test5/tc5 /tset/test6/tc6 /tset/test7/tc7 The way that tcc
would process either of these scenarios can be shown by executing the
following command:
tetscpp -Pce scenario-file The output from tetscpp
is as follows:
scenario("all") { timed_loop(18000) { parallel(1) { sequential() { repeat(10) { testcase("/tset/test1/tc1", "all"); testcase("/tset/test2/tc2", "all"); testcase("/tset/test3/tc3", "all"); } } sequential() { repeat(30) { random() { testcase("/tset/test4/tc4", "all"); testcase("/tset/test5/tc5", "all"); testcase("/tset/test6/tc6", "all"); testcase("/tset/test7/tc7", "all"); } } } } } } See also
|