qa tests, avoid repeated exection of ngspice for version detection
This commit is contained in:
parent
cbd323ff85
commit
8aa7535cff
|
|
@ -750,6 +750,7 @@ sub platform {
|
|||
|
||||
use Config;
|
||||
my($osName,$osVer,$archName)=($modelQa::Config{osname},$modelQa::Config{osvers},$modelQa::Config{archname});
|
||||
my($rv);
|
||||
|
||||
if ($osName !~ /win/i) {
|
||||
open(UNAME,"uname -p|") or die("ERROR: cannot determine processore and OS information, stopped");
|
||||
|
|
@ -760,7 +761,9 @@ sub platform {
|
|||
open(UNAME,"uname -s|");chomp($osName=<UNAME>);close(UNAME);
|
||||
open(UNAME,"uname -r|");chomp($osVer =<UNAME>);close(UNAME);
|
||||
}
|
||||
return("${archName}_${osName}_${osVer}");
|
||||
$rv = "${archName}_${osName}_${osVer}";
|
||||
$rv =~ s/\s+/-/g;
|
||||
return($rv);
|
||||
}
|
||||
|
||||
1;
|
||||
|
|
|
|||
|
|
@ -79,6 +79,7 @@ $listVariants=0;
|
|||
$onlyDoSimulatorVersion=0;
|
||||
$onlyDoPlatformVersion=0;
|
||||
$onlyDoComparison=0;
|
||||
$onlyTuple=0;
|
||||
$forceSimulation=1;
|
||||
$printWarnings=1;
|
||||
@prog=split("/",$0);
|
||||
|
|
@ -185,6 +186,14 @@ for (;;) {
|
|||
$verbose=1;
|
||||
} elsif ($ARGV[0] =~ /^-V/) {
|
||||
$verbose=1;$reallyVerbose=1;
|
||||
} elsif ($ARGV[0] =~ /^--tuple/) {
|
||||
$onlyTuple=1;
|
||||
} elsif ($ARGV[0] =~ /^--version=(.*)/i) {
|
||||
$version=$1;
|
||||
} elsif ($ARGV[0] =~ /^--platform=(.*)/i) {
|
||||
$platform=$1;
|
||||
} elsif ($ARGV[0] =~ /^--vaVersion=(.*)/i) {
|
||||
$vaVersion=$1;
|
||||
} elsif ($ARGV[0] =~ /^-/) {
|
||||
&usage();
|
||||
die("ERROR: unknown flag $ARGV[0], stopped");
|
||||
|
|
@ -196,10 +205,10 @@ for (;;) {
|
|||
if ($onlyDoSimulatorVersion && !defined($simulatorName) && defined($ARGV[0])) {
|
||||
$simulatorName=$ARGV[0]; # assume -sv simulatorName was specified
|
||||
}
|
||||
if ($#ARGV<0 && !$onlyDoPlatformVersion && !($onlyDoSimulatorVersion && defined($simulatorName))) {
|
||||
if ($#ARGV<0 && !$onlyDoPlatformVersion && !($onlyDoSimulatorVersion && defined($simulatorName)) && !$onlyTuple) {
|
||||
&usage();exit(0);
|
||||
}
|
||||
if (!$onlyDoPlatformVersion && !defined($simulatorName)) {
|
||||
if (!$onlyDoPlatformVersion && !defined($simulatorName) && !$onlyTuple) {
|
||||
&usage();exit(0);
|
||||
}
|
||||
if(!defined($simulatorCommand)) {
|
||||
|
|
@ -213,6 +222,22 @@ if(!defined($simulatorCommand)) {
|
|||
if (! require "$programDirectory/modelQaTestRoutines.pm") {
|
||||
die("ERROR: problem sourcing modelQaTestRoutines.pm, stopped");
|
||||
}
|
||||
|
||||
if ($onlyTuple) {
|
||||
$platform = &modelQa::platform();
|
||||
if (! -r "$programDirectory/$simulatorName.pm") {
|
||||
die("ERROR: there is no test routine Perl module for simulator $simulatorName, stopped");
|
||||
}
|
||||
if (! require "$programDirectory/$simulatorName.pm") {
|
||||
die("ERROR: problem sourcing test routine Perl module for simulator $simulatorName, stopped");
|
||||
}
|
||||
($version,$vaVersion) = &simulate::version();
|
||||
print "platform=$platform\n";
|
||||
print "version=$version\n";
|
||||
print "vaVersion=$vaVersion\n";
|
||||
exit(0);
|
||||
}
|
||||
|
||||
if (!$onlyDoComparison) {
|
||||
$platform=&modelQa::platform();
|
||||
if ($onlyDoPlatformVersion) {
|
||||
|
|
@ -231,7 +256,9 @@ if (!$onlyDoComparison) {
|
|||
#
|
||||
|
||||
if (!$onlyDoComparison) {
|
||||
if (!defined($version) || !defined($vaVersion)) {
|
||||
($version,$vaVersion)=&simulate::version();
|
||||
}
|
||||
if ($onlyDoSimulatorVersion) {
|
||||
if ($vaVersion eq "unknown") {
|
||||
print $version;exit(0);
|
||||
|
|
|
|||
|
|
@ -44,8 +44,13 @@ run_test() {
|
|||
|
||||
simname="$1"
|
||||
|
||||
localPlatform=`${testProgramName} -platform`
|
||||
localVersion=`${testProgramName} ${testProgramFlags} -sv -s ${simname} ${qaSpecFile}`
|
||||
for i in $(${testProgramName} ${testProgramFlags} -s ${simname} --tuple) ; do
|
||||
case "${i%%=*}" in
|
||||
platform) localPlatform="${i#*=}";;
|
||||
version) localVersion="${i#*=}";;
|
||||
vaVersion) localVaVersion="${i#*=}";;
|
||||
esac
|
||||
done
|
||||
|
||||
echo ""
|
||||
echo "******"
|
||||
|
|
@ -64,6 +69,9 @@ run_test() {
|
|||
-s ${simname} \
|
||||
-r -t ${test} \
|
||||
-var ${variant} \
|
||||
--version=${localVersion} \
|
||||
--vaVersion=${localVaVersion} \
|
||||
--platform=${platform} \
|
||||
--results=${qaResultsDirectory} \
|
||||
${qaSpecFile}
|
||||
done
|
||||
|
|
@ -94,6 +102,9 @@ run_test() {
|
|||
-s ${simname} \
|
||||
-t ${test} \
|
||||
-var ${variant} \
|
||||
--version=${localVersion} \
|
||||
--vaVersion=${localVaVersion} \
|
||||
--platform=${platform} \
|
||||
--results=${qaResultsDirectory} \
|
||||
${qaSpecFile}
|
||||
done
|
||||
|
|
|
|||
Loading…
Reference in New Issue