taste-create-msc 789 Bytes
Newer Older
Maxime Perrotin's avatar
Maxime Perrotin committed
1 2 3 4 5
#!/bin/bash -e

# TASTE MSC Editor
# Create a new MSC file for a given Provided interface of a function

Maxime Perrotin's avatar
Maxime Perrotin committed
6
if [ -t 1 ] ; then
Maxime Perrotin's avatar
Maxime Perrotin committed
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38
    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
Maxime Perrotin's avatar
Maxime Perrotin committed
39
    $EDITOR -o $MSC_FILENAME
Maxime Perrotin's avatar
Maxime Perrotin committed
40 41 42 43 44 45 46
fi

if [ -z $NONINTERACTIVE ]
then
    echo -e "${INFO} MSC created"
    echo -e "${INFO} Run taste-edit-msc ${MSC_FILENAME} to edit"
fi