File: testQucs.sh

package info (click to toggle)
adms 2.3.7-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,592 kB
  • sloc: xml: 7,167; perl: 4,866; ansic: 3,147; lex: 1,128; yacc: 691; sh: 323; makefile: 110
file content (70 lines) | stat: -rw-r--r-- 1,157 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
#!/bin/bash

###
# This script runs admsXml with files present in the Qucs project.
#
#  - Run this script from the directory ~/git/ADMS/testcases
###

#
# Request admsXml as argument
#
if [ -z "$1" ]
then
  echo "  Missing path to admsXml executable."
  echo "  Example: $ sh testQucs.sh /usr/local/admsXml"
  exit 1
else
  ADMSXML=$1
  echo "  Running admsXml for Qucs"
  echo "  Using: $ADMSXML"
fi

#
# Clone Qucs sources.
#
if [ ! -d "qucs" ]
then
 git clone --depth=1 --branch=master https://github.com/Qucs/qucs.git qucs
fi

cd qucs/qucs-core/src/components/verilog

#
# List of XML scripts (order matters)
#
arrayXML=(analogfunction.xml
          qucsVersion.xml
          qucsMODULEdefs.xml
          qucsMODULEguiJSONsymbol.xml
          qucsMODULEcore.xml
          qucsMODULEgui.xml)

#
# Turn list of scripts in a command: "-e script1 [-e script2]"
#
XML=""
for script in "${arrayXML[@]}"
do
  XML=$XML" -e $script"
done

#
# Process each Verilog-A file.
#
arrayVA=($(ls *.va))
for VA in "${arrayVA[@]}"
do
  cmd="$ADMSXML $XML $VA"
  echo "---"
  echo "$cmd"

  # Run
  $cmd

  # Stop on error
  if [[ $? -ne 0 ]] ; then
    exit 1
  fi
done