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