#!/bin/sh
#
# Test results last captured at "Wed Mar  9 19:49:27 PST 2005"
#
# This is an IBIS icm test program
#
# It is a self-contained package of all of the 
# files and data required to run an icm parser test.
#
# Usage:  ./test_072  <arg>
#
# <nothing>               = Run the test silently in GNU check mode
# "Brief"                 = Run the test.
#                           If there is no error, produce a one line summary
#                           Otherwise, produce a full test report.
# "Full"                  = Run the test and always produce a full test report
# "Capture"               = Capture test results and REWRITE the test program
# "Extract"               = Extract the .icm and .out files
#

Test=`basename $0`
Synopsis="[Begin ICM Family] is a required keyword"
ExitStatus="1"
Counters="ERRORS: 35 WARNINGS: 1"
ExtraFiles="test_model_1.jpg"

Description=`grep -v '^EOF$' <<'EOF'
This file lacks a required [Begin ICM Family] keyword

Errors are expected.
EOF`

Output=`grep -v '^EOF$' <<'EOF'
IBIS ICM Parser, version 1.1.0
ERROR (Line 36/Col 1) syntax error, unexpected MANUFACTURER
ERROR (Line 36/Col 31) Orphaned line.
ERROR (Line 37/Col 1) syntax error, unexpected ICM_FAMILY_DESCRIPTION
ERROR (Line 37/Col 67) Orphaned line.
ERROR (Line 38/Col 65) Orphaned line.
ERROR (Line 41/Col 1) syntax error, unexpected ICM_MODEL_LIST
ERROR (Line 44/Col 62) Orphaned line.
ERROR (Line 50/Col 1) syntax error, unexpected BEGIN_ICM_MODEL
ERROR (Line 50/Col 29) Orphaned line.
ERROR (Line 51/Col 27) Orphaned line.
ERROR (Line 52/Col 8) Orphaned line.
ERROR (Line 54/Col 1) syntax error, unexpected TREE_PATH_DESCRIPTION
ERROR (Line 55/Col 21) Orphaned line.
ERROR (Line 56/Col 23) Orphaned line.
ERROR (Line 57/Col 21) Orphaned line.
ERROR (Line 59/Col 1) syntax error, unexpected END_ICM_MODEL
ERROR (Line 62/Col 1) syntax error, unexpected ICM_PIN_MAP
ERROR (Line 62/Col 20) Orphaned line.
ERROR (Line 63/Col 22) Orphaned line.
ERROR (Line 64/Col 16) Orphaned line.
ERROR (Line 65/Col 19) Orphaned line.
ERROR (Line 66/Col 9) Orphaned line.
ERROR (Line 68/Col 11) Orphaned line.
ERROR (Line 69/Col 11) Orphaned line.
ERROR (Line 71/Col 1) syntax error, unexpected ICM_PIN_MAP
ERROR (Line 71/Col 20) Orphaned line.
ERROR (Line 72/Col 22) Orphaned line.
ERROR (Line 73/Col 16) Orphaned line.
ERROR (Line 74/Col 19) Orphaned line.
ERROR (Line 75/Col 9) Orphaned line.
ERROR (Line 77/Col 12) Orphaned line.
ERROR (Line 78/Col 12) Orphaned line.
ERROR (Line 80/Col 1) syntax error, unexpected END_ICM_FAMILY
ERROR (Line 83/Col 1) [Begin ICM Section] must follow either [End ICM Family] or a previous [End ICM Section].
ERROR (Line 4/Col 1) Missing ICM Family (due to previous errors?)
WARNING (Line 83/Col 1) Section 'SectA' was defined but not used.
Finished. ERRORS: 35 WARNINGS: 1
EOF`

ICM=`grep -v '^EOF$' <<'EOF'

This line is ignored
|**********************************************************************
[Begin Header]
[ICM Ver]             1.1
[File Name]           test_072.icm
[File Rev]            0.1
[Date]                October 8, 2003
[Source]              Kelly C. Green

[Notes]               This is the minimum correct file

                      It will be used as a basis for systematic
                      feature tests

[Disclaimer]          No license, express or implied, by estoppel or 
                      otherwise, to any intellectual property rights is 
                      granted by this document. 

                      No warranty of any kind.  No support of any kind.
                      Use this file entirely at your own risk.

[Copyright]           None - public domain
[Support]             http://www.vhdl.org/pub/ibis/
[Redistribution]      Yes    
[Redistribution Text] You may do anything you wish to this file.
[End Header]

|**********************************************************************
|
[Comment Char] |_char
|
|**********************************************************************


[Manufacturer]            None
[ICM Family Description]  This file is a template from which most 
                          subsequent test files will be derived.

|**********************************************************************
[ICM Model List] 
|  Name             Mating   Min_Slew_Time   Image
|
   TestModel1       Mated    100ps           test_model_1.jpg
|
|          SectA
| Port1 >---------< Port2
|
|**********************************************************************
[Begin ICM Model] TestModel1
ICM_model_type SLM_general
SGR 1:1
|
[Tree Path Description]
  Model_pinmap Port1
  Section Mult=1 SectA
  Model_pinmap Port2
|
[End ICM Model]
|
|**********************************************************************
[ICM Pin Map] Port1
Pin_order Row_ordered
Num_of_rows = 1
Num_of_columns = 2
Pin_list
|Pin Name
A1 SIG1_IN
A2 SIG2_IN

[ICM Pin Map] Port2
Pin_order Row_ordered
Num_of_rows = 1
Num_of_columns = 2
Pin_list
|Pin Name
B1 SIG1_OUT
B2 SIG2_OUT

[End ICM Family]
|
|**********************************************************************
[Begin ICM Section] SectA
[Derivation Method] Lumped
[Resistance Matrix] Diagonal_matrix
1.0mohm
1.0e-3
[Inductance Matrix] Diagonal_matrix
4.0nh
4.0e-9
[Capacitance Matrix] Diagonal_matrix
2.0pf
2.0e-12
[End ICM Section]

|**********************************************************************
[End]
|**********************************************************************
This line is ignored
EOF`

#
# we are either running the test directly in the test directory
# or are running make check.  make sets the srcdir variable
# so we can tell the difference easily
#

if [ -z "${srcdir}" ]
then
    srcdir="."
    exedir="../../src"
else
    srcdir="${srcdir}/v_1_1"
    exedir="../src"
fi

export srcdir exedir Test Synopsis ExitStatus Counters ExtraFiles Description Output ICM

exec ${srcdir}/run_test "$@"
