1 # this file is part of gnucap
2 # (c) 2013 Felix Salfelder
5 GNUCAP = $(top_builddir)/src/gnucap
7 # needed for gnucap-run.sh
8 AM_TESTS_ENVIRONMENT = \
9 export PATH='../src:$(PATH)'\
12 MAKEFLAGS=--no-print-directory \
14 AM_TESTS_FD_REDIRECT = 9>&2
15 TEST_EXTENSIONS = .gc .ckt
17 GC_LOG_COMPILER = $(top_srcdir)/tests/gc_log_compiler
18 CKT_LOG_COMPILER = $(top_srcdir)/tests/ckt_log_compiler
19 SH_LOG_COMPILER = $(SHELL)
21 AM_CKT_LOG_FLAGS = $(srcdir)
32 patchlev_fake_%.h: $(top_builddir)/include/patchlev.h
33 sed 's/e VERSION_REVISION.*/e VERSION_REVISION $*/' < $< > $@
34 patchlev_other.h: $(top_builddir)/include/patchlev.h
35 sed 's/e VERSION_CURRENT .*/e VERSION_CURRENT 99999/' < $< > $@
37 BUILT_SOURCES = patchlev_fake_999.h patchlev_fake_0.h patchlev_other.h
39 transform=s&\.real$$&&;$(program_transform_name)
40 plugindir_transformed = ${libdir}/$(shell echo gnucap | sed -e "$(transform)")
41 plugindir:= $(plugindir_transformed)
42 plugin_PROGRAMS = gnucap-testfilter
43 gnucap_testfilter_SOURCES = filter.c
45 $(empty)install-pluginPROGRAMS: transform=
126 bm_table.error1.ckt \
156 d_bjt-diffpair-ccs.ckt \
157 d_bjt-diffpair-cjc.ckt \
158 d_bjt-diffpair-dc.ckt \
159 d_bjt-diffpair-nocap.ckt \
160 d_bjt-diffpair-tf.ckt \
161 d_bjt-diffpair-tran.ckt \
162 d_bjt-diffpair-tr.ckt \
163 d_bjt-diffpair-tr2.ckt \
168 d_bjt-schmitt-bypass.ckt \
169 d_bjt-schmitt-nobypass.ckt \
241 d_mos1.lin1.late.ckt \
242 d_mos1.lin1.none.ckt \
270 d_mos2.lin1.late.ckt \
367 d_mos7.nand1.nobypass.ckt \
376 d_mos8c2.nand1.nobypass.ckt \
394 d_subckt.error1.ckt \
395 d_subckt.error2.ckt \
396 d_subckt.error3.ckt \
397 d_subckt.error4.ckt \
401 d_switch.c1.inc.ckt \
402 d_switch.c1.noinc.ckt \
408 d_switch.error1.ckt \
409 d_switch.error2.ckt \
410 d_switch.error3.ckt \
412 d_switch.nro.1e.ckt \
413 d_switch.nro.1g.ckt \
414 d_switch.nro.1gr.ckt \
417 d_switch.nro.3h.ckt \
419 d_switch.v.cont.ckt \
427 d_trln.tr.100.im.ckt \
428 d_trln.tr.100.nim.ckt \
429 d_trln.tr.300.im.ckt \
430 d_trln.tr.300.nim.ckt \
459 eq4-9217.tran.nopreq.ckt \
475 m_expression.error.1.ckt \
484 opamp-ol-disto.2.ckt \
522 XFAIL_TESTS = list.1.ckt
525 XFAIL_TESTS += lang_verilog.3.gc
527 # typename issue, some other bugs
528 XFAIL_TESTS += lang_spectre.2.gc
530 # something wrong with .op command
531 XFAIL_TESTS += lang_spice.1b.gc
534 XFAIL_TESTS += d_bjt-diffpair-tr2.ckt
536 # interactive mode broken?
537 XFAIL_TESTS += c_attach.1.gc
540 XFAIL_TESTS+= param.2c.ckt
542 # logic is broken. needs work
544 d_logic_nand-dc.ckt \
553 d_logic_tr_mb1a.ckt \
554 d_logic_tr_mb1b.ckt \
555 d_logic_tr_mb2a.ckt \
556 d_logic_tr_mb2b.ckt \
557 d_logic_tr_mn1a.ckt \
558 d_logic_tr_mn1b.ckt \
559 d_logic_tr_mn2a.ckt \
562 # these are really broken...
570 # functions need to return expressions, not doubles
571 XFAIL_TESTS+= c_measure.1.ckt
573 # something wrong with probes
574 XFAIL_TESTS+= print_v.sh
576 # these tests require gsl
584 GSL_TESTS_LOG = $(GSL_TESTS:%.gc=%.log)
587 # don't skip GSL tests
589 $(GSL_TESTS_LOG): GC_LOG_FLAGS=SKIP
593 d_bti.2.log: GC_LOG_FLAGS += SKIP
608 bm_pulse.periodic.gc \
667 lang_verilog.comm.gc \
700 spice_comment_continuation.gc \
725 #this is not ready yet.
726 XFAIL_TESTS+= s_tr.cont.gc
727 XFAIL_TESTS+= s_tr.lrc.gc
730 XFAIL_TESTS+= d_coil.brl.3.gc
733 XFAIL_TESTS+= c_for.3.gc
736 XFAIL_TESTS+= ddc_v.1.gc
739 XFAIL_TESTS+= ac_noise.gc
742 XFAIL_TESTS+= d_mos.l0.gc
744 # does not converge (why?)
745 XFAIL_TESTS+= mosbug.2.gc
747 CUSTOM_TESTS = c_attach.1.sh nosuchfile.sh
749 AUTO_TESTS = $(CKT_TESTS) $(CUSTOM_TESTS)
751 gsl_tests: $(GSL_TESTS:%.gc=%.log)
752 gc_tests: $(GC_TESTS:%.gc=%.log)
753 uf_tests: $(UF_TESTS:%.gc=%.log)
754 ckt_tests: $(CKT_TESTS:%.ckt=%.log)
755 logic_tests: $(LOGIC_TESTS:%.ckt=%.log)
762 # $(AUTO_TESTS:%.sh=%.out): .P $(FILTER)
763 $(GC_TESTS:%.gc=%.gc.out): .P $(FILTER)
764 $(GC_TESTS:%.gc=%.log): .P $(FILTER)
765 $(CKT_TESTS:%.ckt=%.log): .P $(FILTER)
766 $(CKT_TESTS:%.ckt=%.ckt.out): .P $(FILTER)
767 # $(LOGIC_TESTS:%.ckt=%.log): .P $(FILTER)
768 $(LOGIC_TESTS:%=%.out): .P $(FILTER)
769 $(UF_TESTS:%.gc=%.gc.out): .P $(FILTER)
770 $(UF_TESTS:%.gc=%.log): .P $(FILTER)
772 # $(CKT_TESTS): %.sh: %.out
775 $(CKT_TESTS:%.ckt:%.log): gnucap_run.log
777 # this will trigger a warning in autogen.sh
778 # (apparently this warning is s bug)
779 c_getckt.ckt.out: | $(PWD)/d_cccs.1.ckt
780 c_lib.1.ckt.out: | $(PWD)/c_lib.1.ckt
782 lang_spice.1a.log lang_verilog.1a.log: soclean | $(PWD)/bm_wrapper.cc
783 lang_spice.1a.gc.out lang_verilog.1a.gc.out: POSTDIFF+= '/^CXX/d'
785 $(GSL_TESTS:%=%.out) $(UF_TESTS:%=%.out): POSTDIFF+='/already·installed/{N;d}'
833 '1,/^core-lib·version/d' \
837 #PREDIFF+='1,/^default·plugins/d'
839 # permit different control values
840 d_logic_tr_%.out: POSTDIFF+= '3·s/[01]\.········$$/X.········/'
843 trcurve.ckt.out: POSTDIFF+= '54·s/-196\.E-24/·0.······/g' \
844 '411·s/727\.2E-18/0.·······/g' \
845 '411·s/317\.6E-18/0.·······/g' \
846 '462·s/795\.6E-18/0.·······/g' \
847 '462·s/378\.2E-18/0.·······/g' \
848 '513·s/864\.E-18/0.······/g' \
849 '513·s/438\.4E-18/0.·······/g'
851 $(CKT_TESTS:%=%.out) $(LOGIC_TESTS:%=%.out): %.ckt.out: %.ckt
852 @LD_LIBRARY_PATH='../plugins/.libs$(LD_LIBRARY_PATH:%=:$(LD_LIBRARY_PATH))' \
853 ../src/gnucap $(GNUCAP_PLUGINS:%=-a %) $(GNUCAP_ARGS) -b $< | \
854 sed $(subst ·, ,$(PREDIFF:%=-e %)) \
855 $(if $(POSTDIFF),| sed) $(subst ·, ,$(POSTDIFF:%=-e %)) > $*.ckt.out
858 d_vcg.%.out: POSTDIFF+= '27·s/975\.[0-9][0-9]f/0.·····/'
861 bm_poly.%.out: POSTDIFF+= '30·s/-.\.f/·0.·/g'
862 bm_poly.%.out: POSTDIFF+= '30·s/-..\.f/·0.··/g'
864 # output seems to depend on lapack/architecture.
865 ddc_cc.gc.out: POSTDIFF+= 's/NaN/0.·/g'
868 trcurve2.ckt.out: POSTDIFF+= 's/·[0-9]\.E-21/·0.····/'
869 trcurve2.ckt.out: POSTDIFF+= 's/·[0-9][0-9]\.E-21/·0.·····/'
870 trcurve2.ckt.out: POSTDIFF+= '11·s/.....E-30/0.·······/g'
871 trcurve2.ckt.out: POSTDIFF+= '17·s/3\.628E-21/0.·······/g'
872 trcurve2.ckt.out: POSTDIFF+= '17·s/110\.4E-30/0.·······/g'
873 trcurve2.ckt.out: POSTDIFF+= '23·s/5\.094E-2./0.·······/g'
874 trcurve2.ckt.out: POSTDIFF+= '23·s/73\.45E-21/0.·······/g'
875 trcurve2.ckt.out: POSTDIFF+= '29·s/630\.3E-24/0.·······/'
876 trcurve2.ckt.out: POSTDIFF+= '35·s/7\.08E-21/0.······/'
877 trcurve2.ckt.out: POSTDIFF+= '35·s/13\.28E-21/0.·······/'
878 trcurve2.ckt.out: POSTDIFF+= 's/[0-9]....E-30/0.·······/g'
880 # negative zeroes? nice, but should not be machine dependent
881 bm_sffm.%.out: POSTDIFF+= 's/-0\.000\>/·0.000/g'
883 bm_table.2.4.ckt.out: POSTDIFF+= '54·s/[- ][0-9]\.f/·0.·/g'
885 c_attach.1.out: POSTDIFF+= 's\#`.*/tests\#`.../tests\#g'
887 FILTER = ./gnucap-testfilter
890 @echo "#!/bin/sh" > $@
892 @echo "exec 2>&9" >> $@
893 @echo "$(FILTER) $*.out < $< | diff -up - $< --label $< || exit 1" >> $@
894 @echo "rm $*.out" >> $@
898 $(CKT_TESTS:%.ckt=%.sh): %.sh: %.ckt.ref
899 $(AM_V_GEN)$(testgen)
901 $(UF_TESTS:%=%.out) $(GC_TESTS:%=%.out): %.gc.out: %.gc
902 $(AM_V_GEN)GNUCAP_PREQ=1 $(GNUCAP) $(GNUCAP_PLUGINS:%=-a ../modules/.libs/%) $(GNUCAP_ARGS) < $< | \
903 sed $(subst ·, ,$(PREDIFF:%=-e %)) \
904 $(if $(POSTDIFF),| sed) $(subst ·, ,$(POSTDIFF:%=-e %)) > $*.gc.out
906 # $(UF_TESTS): GNUCAP_PLUGINS = 'public models-uf.so'
908 # nosuchfile.out c_attach.1.out: %.out: %.gc
909 # -$(GNUCAP) < $< | \
910 # sed $(subst ·, ,$(PREDIFF:%=-e %)) \
911 # $(if $(POSTDIFF),| sed) $(subst ·, ,$(POSTDIFF:%=-e %)) > $*.out
916 # make sure we don't chdir...
917 lang_verilog.1a.sh: LT=<
918 lang_spice.1.sh: LT=<
921 nosuchfile.sh: %.sh: %.gc Makefile %.ref
922 @echo "#!/bin/sh" > $@
924 @echo "GNUCAP=\$${GNUCAP-gnucap}" >> $@
925 @echo "eval \$$REDIRECT" >> $@
926 @echo "\$$GNUCAP \$$GNUCAP_ARGS $(LT) $I $< | sed $(subst ·, ,$(PREDIFF:%=-e %)) \\" >> $@
927 @echo "$(if $(POSTDIFF),| sed) $(subst ·, ,$(POSTDIFF:%=-e %)) > $*.out" >> $@
928 @echo "$(FILTER) $*.out < $(lastword $+) | diff -up - $(lastword $+) --label $(lastword $+) || exit 1" >> $@
929 @echo "rm $*.out" >> $@
932 CLEANFILES = *.out $(AUTO_TESTS) core \
934 patchlev_fake_999.h \
945 CLEANFILES+= d_cccs.1.ckt c_lib.1.ckt bm_wrapper.so
948 EXTRA_DIST = gnucap_run.sh \
951 $(CKT_TESTS) $(CKT_TESTS:%=%.ref) \
952 $(LOGIC_TESTS) $(LOGIC_TESTS:%=%.ref) \
953 $(GC_TESTS) $(GC_TESTS:%.gc=%.ref) \
954 $(UF_TESTS) $(UF_TESTS:%.gc=%.ref) \
957 bm_generator.doc bm_pulse.doc bm_pwl.doc bm_sin.doc d_cap.doc d_diode.doc \
958 d_.doc d_subckt.doc u_.doc \
984 AM_CPPFLAGS = -I$(top_builddir)/src -I$(top_srcdir)/src
985 AM_DEFAULT_SOURCE_EXT = .cc
986 AM_LDFLAGS = -module -avoid-version -rpath /dev/null
987 check_LTLIBRARIES = bogus.la bogus1.la bogus2.la bogus3.la bogus4.la
989 # $(CUSTOM_TESTS:%.sh=%.log): %.log: %.out
991 c_attach.1.out: empty.cc bogus.so d_vs.cc loadtestdir loadtestdirro attachclean
992 c_attach.2.out c_attach.2.log: bogus.so bogus1.so bogus2.so bogus3.so bogus4.so
995 rm -f d_vs.so load*/*.so empty.so
999 cd $@; $(LN_S) $(top_srcdir)/src/d_cccs.cc .
1000 cd $@; $(LN_S) $(top_srcdir)/src/d_ccvs.cc .
1004 cp $(top_srcdir)/src/d_ccvs.cc $@
1009 d_vs.cc: | $(top_srcdir)/src/d_vs.cc
1012 bogus.so bogus1.so bogus2.so bogus3.so bogus4.so: %.so: %.la
1013 [ -f $@ ] || $(LN_S) .libs/$@ .
1015 .PHONY: c_attach.1.out attachclean soclean
1017 # bug: @@@ also catches incomplete
1018 # bug: case labels don't end with {
1020 grep -e ^@@@: -e ^@i@ *.log | sort -u | tr : " " | \
1021 $(AWK) '{printf "sed -i %s -e '"'"'%s s/\\({\\|:\\)\\(\\ \\|\\t\\)\\?\\(un\\|i\\)tested();$$/\\1/'"'"' # %s +%s\n", $$3, $$4, $$3, $$4}' > $@
1023 # checked in files. sort out later.
1035 rcd_cons_tw_more.sim \