From 33e6fa06c309d6d397dd7ab4d79f2c229403a5b6 Mon Sep 17 00:00:00 2001 From: Maxime Perrotin Date: Mon, 3 Jul 2017 14:19:49 +0200 Subject: [PATCH] Add MSC handler scripts --- misc/helper-scripts/taste-create-msc | 46 ++++++++++++++++++++ misc/helper-scripts/taste-edit-msc | 31 +++++++++++++ misc/helper-scripts/taste-generate-skeletons | 4 +- 3 files changed, 79 insertions(+), 2 deletions(-) create mode 100755 misc/helper-scripts/taste-create-msc create mode 100755 misc/helper-scripts/taste-edit-msc diff --git a/misc/helper-scripts/taste-create-msc b/misc/helper-scripts/taste-create-msc new file mode 100755 index 0000000..3044cbb --- /dev/null +++ b/misc/helper-scripts/taste-create-msc @@ -0,0 +1,46 @@ +#!/bin/bash -e + +# TASTE MSC Editor +# Create a new MSC file for a given Provided interface of a function + +if [ -t 0 ] ; then + COLORON="\e[1m\e[32m" + REDCOLORON="\e[1m\e[31m" + COLOROFF="\e[0m" +else + COLORON="" + REDCOLORON="" + COLOROFF="" +fi + +INFO="${COLORON}[INFO]${COLOROFF}" +ERROR="${REDCOLORON}[ERROR]${COLOROFF}" + +FUNC_NAME=$1 +shift +PI_NAME=$1 +shift +MSC_FILENAME=$1 +shift + +echo -e "${INFO} Creating new MSC..." +echo -e "${INFO} Function: ${FUNC_NAME} PI: ${PI_NAME} Output: ${MSC_FILENAME}" + +EDITOR=taste-msc-editor + +echo 'msc testcase; + +end testcase; +' > $MSC_FILENAME + + +if [ -z $NONINTERACTIVE ] +then + $EDITOR $MSC_FILENAME +fi + +if [ -z $NONINTERACTIVE ] +then + echo -e "${INFO} MSC created" + echo -e "${INFO} Run taste-edit-msc ${MSC_FILENAME} to edit" +fi diff --git a/misc/helper-scripts/taste-edit-msc b/misc/helper-scripts/taste-edit-msc new file mode 100755 index 0000000..d5358e3 --- /dev/null +++ b/misc/helper-scripts/taste-edit-msc @@ -0,0 +1,31 @@ +#!/bin/bash -e + +# TASTE MSC Editor +# Edit a MSC file + +if [ -t 0 ] ; then + COLORON="\e[1m\e[32m" + REDCOLORON="\e[1m\e[31m" + COLOROFF="\e[0m" +else + COLORON="" + REDCOLORON="" + COLOROFF="" +fi + +INFO="${COLORON}[INFO]${COLOROFF}" +ERROR="${REDCOLORON}[ERROR]${COLOROFF}" + +MSC_FILENAME=$1 + +echo -e "${INFO} Opening MSC Editor..." +echo -e "${INFO} Filename: ${MSC_FILENAME}" + +EDITOR=taste-msc-editor + + +if [ -z $NONINTERACTIVE ] +then + $EDITOR $MSC_FILENAME +fi + diff --git a/misc/helper-scripts/taste-generate-skeletons b/misc/helper-scripts/taste-generate-skeletons index 33e4d2b..c8ab421 100755 --- a/misc/helper-scripts/taste-generate-skeletons +++ b/misc/helper-scripts/taste-generate-skeletons @@ -10,9 +10,9 @@ if [ ! -f "$1" ] then if [ -f InterfaceView.aadl ] then - INTERFACEVIEW=InterfaceView.aadl + INTERFACEVIEW=InterfaceView.aadl else - echo 'Error: interface view not found + echo 'Error: interface view not found Usage: [FORCE=1] taste-generate-skeletons [InterfaceView.aadl] [output-directory]' exit -1 fi -- GitLab