Commit babd0625 authored by Thanassis Tsiodras's avatar Thanassis Tsiodras

Added test checking accuracy of fixed point results.

parent 60ffad9b
pseudosiimulink.zip
testsimulink.zip
#!/usr/bin/env python
import sys, os
sys.exit(0 if 0 == os.system("regression.sh") else 1)
#!/bin/bash
export ASSERT_IGNORE_GUI_ERRORS=1
cp -a testSimulinkResponses.py binary.c/binaries/ground-GUI/ || exit 1
cd binary.c/binaries/ || exit 1
./x86_partition & 2>/dev/null
cd ground-GUI || exit 1
timeout 10 ./testSimulinkResponses.py 2>/dev/null || exit 1
killall x86_partition
exit 0
......@@ -22,7 +22,8 @@ from asn1_value_editor.udpcontroller import tasteUDP
@Scenario
def Exercise_ground(queue):
'''ground processing'''
for i in range(1000):
for i in range(100):
queue.log.put((queue.name, 'INFO', 'Test: '+str(i)))
a = random.random()
b = 2*random.random()
c = 3*random.random()
......@@ -32,9 +33,12 @@ def Exercise_ground(queue):
out1 = val.out1.Get()
out2 = val.out2.Get()
if abs(out1 - a - b - c) > 0.0001 or abs(out2 - 2.*a) > 0.0001:
print "Oops!", a, b, c, out1, out2
queue.log.put((queue.name, 'ERROR', "Oops!"+str(a)+","+str(b)+","+str(c)+" <==> "+str(out1)+","+str(out2)))
time.sleep(2)
print "What just happened..."
sys.stdout.flush()
sys.exit(1)
return 0
sys.exit(0)
def runScenario(pipe_in=None, pipe_out=None, udpController=None):
# Queue for getting scenario status
......
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