4 tmp
="`echo "x
$1" | sed -e 's:.*/tests/::' -e 's:\\.out$::' -e 's:^x\\./::'`"
5 stem
="`echo "${tmp}" | sed -E -e 's:-spice-.*:@@@:' -e 's:(-[^-@]*|@@@)$::'`"
6 backend
="`echo "${tmp}" | sed -e "s
:^
${stem}-::"`"
8 GNETLIST
="${abs_top_builddir}/gnetlist-legacy/src/gnetlist-legacy"
9 GEDADATA
="${abs_top_srcdir}/gnetlist-legacy" # HACKHACKHACK
10 GEDADATARC
="${abs_top_builddir}/gnetlist-legacy/lib"
16 schematic
="${abs_srcdir}/${stem}.sch"
20 # create temporary run directory
23 # Create the files needed
24 if test -d "${srcdir}/${stem}-extras" ; then
25 for f
in "${srcdir}/${stem}-extras"/* ; do
26 cp "${f}" "${rundir}/"
30 (echo refdes
; echo value
; echo device
) > "${rundir}/attribs"
32 cat > "${rundir}/gafrc" << EOF
33 ;; We want to point at the scheme code that hasn't been installed yet so that
34 ;; 'make check' during development can work correctly.
35 (scheme-directory "${abs_top_srcdir}/gnetlist-legacy/scheme")
36 (scheme-directory "${abs_top_builddir}/gnetlist-legacy/scheme")
37 (scheme-directory "${abs_top_srcdir}/libgeda/scheme")
38 (scheme-directory "${abs_top_builddir}/libgeda/scheme")
40 ;; We want to use the symbols that haven't been installed yet
43 (string-join (list "${abs_top_srcdir}/symbols/" x) "")))
44 '("io" "74" "analog" "power" "misc" "diode" "linear" "connector" "switch"
45 "asic" "spice" "cascade" "titleblock" "memory"))
47 ;; Rather than checking what m4 and pcb's m4 files do with
48 ;; the output we produce, just see what output gnetlist-legacy produces.
49 (define gsch2pcb:pcb-m4-command-line "cat - >>")
52 if test -d "${srcdir}/${stem}-symbols" ; then
53 cat >> "${rundir}/gafrc" << EOF
54 (component-library "${abs_srcdir}/${stem}-symbols")
57 if test -d "${srcdir}/${stem}-sources" ; then
58 cat >> "${rundir}/gafrc" << EOF
59 (source-library "${abs_srcdir}/${stem}-sources")
67 args
="-O nomunge_mode"
71 args
="-O include_mode"
73 spice-sdb-include-nomunge
)
75 args
="-O include_mode -O nomunge_mode"
81 spice-sdb-sort-nomunge
)
83 args
="-O sort_mode -O nomunge_mode"
88 echo "${GNETLIST} -g ${backend} ${args} ${schematic}"
89 (cd "${rundir}" && "${GNETLIST}" -g "${backend}" ${args} "${schematic}")
92 echo "${GNETLIST} -g ${backend} -o - ${args} ${schematic} > stdout.net"
93 (cd "${rundir}" && "${GNETLIST}" -g "${backend}" \
94 -o - ${args} "${schematic}" > stdout.net
)
97 echo "${GNETLIST} -g ${backend} -v -o verbose.net ${args} ${schematic}"
98 (cd "${rundir}" && "${GNETLIST}" -g "${backend}" -v \
99 -o verbose.net
${args} "${schematic}")
102 # OK, now check results of run.
105 out
="${rundir}/output.net"
106 std
="${rundir}/stdout.net"
107 vrb
="${rundir}/verbose.net"
109 # Hack to help with vams backend
110 if [ -f "${rundir}/default_entity_arc.net" ]; then
111 mv "${rundir}/default_entity_arc.net" "${out}"
112 # vams intentionally outputs data into several files, so checking it with
113 # the option '-o verbose.net' is nonsense
117 if test "X${REGEN}" = "X1" ; then
118 # copy output on top of golden output
120 echo "Regenerated ${ref}"
122 elif test ${rc1} -ne 0 ; then
123 echo "FAILED: gnetlist-legacy -g ${backend} returned ${rc1}"
125 elif test ${rc2} -ne 0 ; then
126 echo "FAILED: gnetlist-legacy -g ${backend} -o - returned ${rc2}"
128 elif test ${rc3} -ne 0 ; then
129 echo "FAILED: gnetlist-legacy -g ${backend} -v returned ${rc3}"
132 sed '/gnetlist -g/d' "${ref}" > "${out}.tmp1"
133 sed '/gnetlist-legacy -g/d' "${out}" > "${out}.tmp2"
134 sed '/gnetlist-legacy -g/d' "${std}" > "${out}.tmp3"
135 sed '/gnetlist-legacy -g/d' "${vrb}" > "${out}.tmp4"
137 # Hack to help with allegro backend
138 # Device files are ignored as yet
139 if test "X${backend}" = "Xallegro" ; then
140 sed '/gnetlist-legacy -g/d' "${std}" |
sed '/^\$END$/ q' > "${out}.tmp3"
143 if ! diff "${out}.tmp1" "${out}.tmp2" >/dev
/null
; then
144 echo "FAILED: Wrong plain output. See diff ${ref} ${out}"
146 elif ! diff "${out}.tmp1" "${out}.tmp3" >/dev
/null
; then
147 echo "FAILED: Wrong stdout output. See diff ${ref} ${std}"
149 elif ! diff "${out}.tmp1" "${out}.tmp4" >/dev
/null
; then
150 echo "FAILED: Wrong verbose output. See diff ${ref} ${vrb}"
158 # Delete the run directory in prep for the next test