diff --git a/ChangeLog b/ChangeLog index 84a624079..65172b716 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,14 @@ +2011-05-30 Robert Larice + * configure.ac , + * tests/bin/modelQaTestRoutines.pm , + * tests/bin/ngspice.pm , + * tests/bin/runQaTests.pl , + * tests/bin/run_cmc_check , + * tests/hisim/Makefile.am , + * tests/hisimhv/.cvsignore , + * tests/hisimhv/Makefile.am : + incorporate CMC test suite into make target 'check' + 2011-05-29 Holger Vogt * winmain.c, winmain.h: prototypes and forwards diff --git a/configure.ac b/configure.ac index 10936a623..5ed61d0e3 100644 --- a/configure.ac +++ b/configure.ac @@ -1106,6 +1106,8 @@ AC_CONFIG_FILES([Makefile tests/filters/Makefile tests/general/Makefile tests/hfet/Makefile + tests/hisim/Makefile + tests/hisimhv/Makefile tests/jfet/Makefile tests/mes/Makefile tests/mesa/Makefile diff --git a/tests/bin/modelQaTestRoutines.pm b/tests/bin/modelQaTestRoutines.pm index 01754af66..08f733e65 100644 --- a/tests/bin/modelQaTestRoutines.pm +++ b/tests/bin/modelQaTestRoutines.pm @@ -334,12 +334,13 @@ sub processTestSpec { } if (s/^modelParameters\s+//i) { foreach $arg (split(/\s+/,$_)) { - if ($arg !~ /.=./ && ! -r $arg) { + $arg_file = $main::srcdir . $arg; + if ($arg !~ /.=./ && ! -r $arg_file) { die("ERROR: model parameters must be name=value pairs or a file name, stopped"); } - if (-r $arg) { - if (!open(IF,"$arg")) { - die("ERROR: cannot open file $arg, stopped"); + if (-r $arg_file) { + if (!open(IF,"$arg_file")) { + die("ERROR: cannot open file $arg_file, stopped"); } while () { chomp;s/\s*=\s*/=/g; diff --git a/tests/bin/ngspice.pm b/tests/bin/ngspice.pm index 95a4932a5..b9af93aeb 100644 --- a/tests/bin/ngspice.pm +++ b/tests/bin/ngspice.pm @@ -10,7 +10,6 @@ # package simulate; -$simulatorCommand="ngspice"; $netlistFile="ngspiceCkt"; use strict; @@ -75,8 +74,8 @@ sub runNoiseTest { # Run simulations and get the results # - if (!open(SIMULATE,"$simulate::simulatorCommand < $simulate::netlistFile 2>/dev/null|")) { - die("ERROR: cannot run $main::simulatorName, stopped"); + if (!open(SIMULATE,"$main::simulatorCommand < $simulate::netlistFile 2>/dev/null|")) { + die("ERROR: cannot run $main::simulatorCommand, stopped"); } $inData=0; while () { @@ -202,8 +201,8 @@ sub runAcTest { # Run simulations and get the results # - if (!open(SIMULATE,"$simulate::simulatorCommand < $simulate::netlistFile 2>/dev/null|")) { - die("ERROR: cannot run $main::simulatorName, stopped"); + if (!open(SIMULATE,"$main::simulatorCommand < $simulate::netlistFile 2>/dev/null|")) { + die("ERROR: cannot run $main::simulatorCommand, stopped"); } $inData=0; while () { @@ -340,8 +339,8 @@ sub runDcTest { # Run simulations and get the results # - if (!open(SIMULATE,"$simulate::simulatorCommand < $simulate::netlistFile 2>/dev/null|")) { - die("ERROR: cannot run $main::simulatorName, stopped"); + if (!open(SIMULATE,"$main::simulatorCommand < $simulate::netlistFile 2>/dev/null|")) { + die("ERROR: cannot run $main::simulatorCommand, stopped"); } $inResults=0; while () { diff --git a/tests/bin/runQaTests.pl b/tests/bin/runQaTests.pl index bf85135fb..e2196a965 100755 --- a/tests/bin/runQaTests.pl +++ b/tests/bin/runQaTests.pl @@ -84,6 +84,7 @@ $printWarnings=1; @prog=split("/",$0); $programDirectory=join("/",@prog[0..$#prog-1]); $prog=$prog[$#prog]; +$srcdir=""; # # These variables are only defined once in this file, @@ -160,10 +161,14 @@ for (;;) { $forceSimulation=0; } elsif ($ARGV[0] =~ /^-sv/i) { $onlyDoSimulatorVersion=1; + } elsif ($ARGV[0] =~ /^--executable=(.*)/i) { + $simulatorCommand=$1; } elsif ($ARGV[0] =~ /^-s/) { shift(@ARGV); if ($#ARGV<0) {die("ERROR: no simulator specified for -s option, stopped")} $simulatorName=$ARGV[0]; + } elsif ($ARGV[0] =~ /^--srcdir=(.*)/i) { + $srcdir=$1; } elsif ($ARGV[0] =~ /^-t/) { shift(@ARGV); if ($#ARGV<0) {die("ERROR: no test(s) specified for -t option, stopped")} @@ -193,6 +198,9 @@ if ($#ARGV<0 && !$onlyDoPlatformVersion && !($onlyDoSimulatorVersion && defined( if (!$onlyDoPlatformVersion && !defined($simulatorName)) { &usage();exit(0); } +if(!defined($simulatorCommand)) { + $simulatorCommand=$simulatorName; +} # # Source perl modules with subroutines that are called to do all the work @@ -226,7 +234,7 @@ if (!$onlyDoComparison) { } $qaSpecFile=$ARGV[0]; $resultsDirectory="results"; -$refrnceDirectory="reference"; +$refrnceDirectory=$main::srcdir . "reference"; undef(%Defined); $Defined{$simulatorName}=1; # any `ifdef's in the QA spec file for $simulatorName are automatically inlcuded diff --git a/tests/bin/run_cmc_check b/tests/bin/run_cmc_check index b754b2d03..0b28149c8 100755 --- a/tests/bin/run_cmc_check +++ b/tests/bin/run_cmc_check @@ -14,7 +14,7 @@ qaSpecFile="qaSpec" qaResultsDirectory="results" -testProgramName="../../bin/runQaTests.pl" +testProgramName="$(dirname $0)/runQaTests.pl" testProgramFlags="-nwV" #testProgramFlags="-d" @@ -129,6 +129,22 @@ all() { } +while test $# -gt 0; do + case "$1" in + --srcdir=* | --executable=*) + testProgramFlags="$testProgramFlags $1" + shift + ;; + -qa) + qaSpecFile="$2" + shift ; shift + ;; + *) + break + ;; + esac +done + for arg in $@ ; do case "$arg" in all | clean | spice | ngspice) diff --git a/tests/hisim/Makefile.am b/tests/hisim/Makefile.am new file mode 100644 index 000000000..868e395af --- /dev/null +++ b/tests/hisim/Makefile.am @@ -0,0 +1,17 @@ +## Process this file with automake to produce Makefile.in + + +TESTS = nmos/qaSpec pmos/qaSpec + +TESTS_ENVIRONMENT = \ + $(SHELL) $(top_srcdir)/tests/bin/check_cmc.sh \ + $(top_builddir)/src/ngspice + +EXTRA_DIST = \ + $(TESTS) \ + $(TESTS:.cir=.out) + +MAINTAINERCLEANFILES = Makefile.in + +clean-local: + rm -rf results ngspiceCkt diff --git a/tests/hisimhv/.cvsignore b/tests/hisimhv/.cvsignore new file mode 100644 index 000000000..3dda72986 --- /dev/null +++ b/tests/hisimhv/.cvsignore @@ -0,0 +1,2 @@ +Makefile.in +Makefile diff --git a/tests/hisimhv/Makefile.am b/tests/hisimhv/Makefile.am new file mode 100644 index 000000000..9706359b6 --- /dev/null +++ b/tests/hisimhv/Makefile.am @@ -0,0 +1,17 @@ +## Process this file with automake to produce Makefile.in + + +TESTS = nmos/qaSpec.basic pmos/qaSpec.basic + +TESTS_ENVIRONMENT = \ + $(SHELL) $(top_srcdir)/tests/bin/check_cmc.sh \ + $(top_builddir)/src/ngspice + +EXTRA_DIST = \ + $(TESTS) \ + $(TESTS:.cir=.out) + +MAINTAINERCLEANFILES = Makefile.in + +clean-local: + rm -rf results ngspiceCkt