Commit 4cf90a9b authored by Theodor-Adrian Stana's avatar Theodor-Adrian Stana

sw: Don't run tests if xc3sprog did not output successfully

An addition has been made in the top-level file to not run the tests if the
output of xc3sprog is not the expected one. This prevents blindly running the
tests on no gateware downloaded to the FPGA, and thus prevents wasted time.
parent 520a58d4
......@@ -167,46 +167,49 @@ if __name__ == '__main__':
#men_on()
print "Loading FPGA bitstream..."
subprocess.call("cd boot; ./program; cd ..", shell=True, stdout=fnull, stderr=fnull)
ret = subprocess.call("cd boot; ./program", shell=True, stdout=fnull, stderr=fnull)
time.sleep(1)
# Run JPTS in another shell script; JPTS will handle running each of the test scripts
cmd = "xterm -e ./jpts.py -s %s %s" % (sn1, sn2)
print "Running tests :%s\n" % (cmd)
subprocess.call(cmd, shell=True, stdout=fnull, stderr=fnull)
# # After JPTS has finished, download release bitstream to EEPROM chip if none of the tests has failed
# print "Loading CONV-TTL-RS485 release bitstream\n"
# ret = subprocess.call("cd /home/pts/ubuntu/ttlbl/boot; ./flash_release.sh", shell=True, stdout=sys.stdout, stderr=sys.stderr)
# if (ret == 0):
# time.sleep(1)
#
# # ... power-cycle the crate
# print "VME Crate power-cycle..."
# men_off()
# time.sleep(5)
# men_on()
#
# time.sleep(5)
#
# print ''
# # .. and run the flash test
# cmd = "cd /home/pts/ubuntu/ttlbl/pyts; python flash_test.py"
# subprocess.call(cmd, shell=True, stdout=sys.stdout, stderr=sys.stderr)
# After all testing has finished, grep the log files for PASS and FAIL messages and print the outcomes to the console
subprocess.call("grep PASS log/*.log", shell=True, stdout=sys.stdout, stderr=sys.stderr)
subprocess.call("grep FAIL log/*.log", shell=True, stdout=sys.stdout, stderr=sys.stderr)
# Save results on USB key...
print "\nSaving test results on USB key"
try:
subprocess.call("mkdir -p /media/pts/log", shell=True, stdout=sys.stdout, stderr=sys.stderr)
subprocess.call("cp log/*.log /media/pts/log", shell=True, stdout=sys.stdout, stderr=sys.stderr)
subprocess.call("cp log/*.inf /media/pts/log", shell=True, stdout=sys.stdout, stderr=sys.stderr)
except e:
print "ERROR: No access to USB key at /media/pts"
print e
if (ret != 0):
print "ERROR: Bitstream download fail. Check JTAG connectivity."
else:
# Run JPTS in another shell script; JPTS will handle running each of the test scripts
cmd = "xterm -e ./jpts.py -s %s %s" % (sn1, sn2)
print "Running tests :%s\n" % (cmd)
subprocess.call(cmd, shell=True, stdout=fnull, stderr=fnull)
# # After JPTS has finished, download release bitstream to EEPROM chip if none of the tests has failed
# print "Loading CONV-TTL-RS485 release bitstream\n"
# ret = subprocess.call("cd /home/pts/ubuntu/ttlbl/boot; ./flash_release.sh", shell=True, stdout=sys.stdout, stderr=sys.stderr)
# if (ret == 0):
# time.sleep(1)
#
# # ... power-cycle the crate
# print "VME Crate power-cycle..."
# men_off()
# time.sleep(5)
# men_on()
#
# time.sleep(5)
#
# print ''
# # .. and run the flash test
# cmd = "cd /home/pts/ubuntu/ttlbl/pyts; python flash_test.py"
# subprocess.call(cmd, shell=True, stdout=sys.stdout, stderr=sys.stderr)
# After all testing has finished, grep the log files for PASS and FAIL messages and print the outcomes to the console
subprocess.call("grep PASS log/*.log", shell=True, stdout=sys.stdout, stderr=sys.stderr)
subprocess.call("grep FAIL log/*.log", shell=True, stdout=sys.stdout, stderr=sys.stderr)
# Save results on USB key...
print "\nSaving test results on USB key"
try:
subprocess.call("mkdir -p /media/pts/log", shell=True, stdout=sys.stdout, stderr=sys.stderr)
subprocess.call("cp log/*.log /media/pts/log", shell=True, stdout=sys.stdout, stderr=sys.stderr)
subprocess.call("cp log/*.inf /media/pts/log", shell=True, stdout=sys.stdout, stderr=sys.stderr)
except e:
print "ERROR: No access to USB key at /media/pts"
print e
# We're done, turn off the VME crate
print "\nTesting completed!"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment