Commit 506a7f86 authored by Maxime Perrotin's avatar Maxime Perrotin

Add documentation in generated Python test code

parent 3dfe225c
......@@ -54,11 +54,13 @@ main(files) ::= <<
import os
import sys
import time
import signal
import Queue
taste_inst = os.popen('taste-config --prefix').readlines()[0].strip()
sys.path.append(taste_inst+'/share/asn1-editor')
# The following two lines are not needed as the tool is now installed with pip
#taste_inst = os.popen('taste-config --prefix').readlines()[0].strip()
#sys.path.append(taste_inst+'/share/asn1-editor')
from asn1_value_editor.Scenario import Scenario, PollerThread
from PySide.QtCore import QCoreApplication, Qt
......@@ -165,6 +167,25 @@ poller.slots.append(<inst.CleanName>.msg_q)}>}>}>
>>
PrintMscInstance(inst) ::= <<
# You may edit the scenario below or create new ones (use the @Scenario decorator)
# When you add new scenarios, they will all run in parallel.
#
# You can use these three API functions to communicate with the main binary:
# (1) queue.sendMsg('Name of your Provided Interface', 'Parameter value in ASN.1 format')
# The parameters are expressed textually in ASN.1 Value Notation
# (also called GSER). For example a record's syntax is:
# { fieldName1 value1, fieldName2 value2 }
# (2) queue.expectMsg ('Name of RI',
# 'Parameter value in Extended ASN.1 format',
# lineNo=optional line reference,
# ignoreOther=True/False)
# Extended ASN.1 format lets you replace a field value with a star (*)
# meaning that you do not want the tool to check it against any specific value
# ignoreOther: set to True if you want the tool to ignore other messages
# and want to trigger an error only when you get this message with the wrong parameters
# (3) (msgId, val) = queue.getNextMsg(timeout=10)
# if msgId == 'Name of an interface':
# print 'The value is', val.fieldName.Get()
@Scenario
def Exercise_<inst.CleanName>(queue): # queue is actually an instance of the Scenario class
'''<inst.CleanName> processing'''
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment