#!/usr/bin/env perl

# The input arguments to this script are: 
# $1 = location of Xyce binary
# $2 = location of xyce_verify.pl script
# $3 = location of compare script 
# $4 = location of circuit file to test
# $5 = location of gold standard prn file

# If Xyce exits with error, we return 10.
# if Xyce fails to produce a .prn, return 14.
# This test used to fail with 10 prior to fix of bug 1657


$XYCE=$ARGV[0];
#$XYCE_VERIFY=$ARGV[1];
#$XYCE_COMPARE=$ARGV[2];
$CIRFILE=$ARGV[3];
#$GOLDPRN=$ARGV[4];

$CMD="$XYCE $CIRFILE > $CIRFILE.out 2> $CIRFILE.err";
if (system("$CMD") != 0) { print "Exit code = 10\n"; exit 10 }

if ( !(-f  "$CIRFILE.dat") )
{
  print "Exit code = 14\n";
  exit 14;
}

print "Exit code = 0\n";
exit 0;

