2
0
mirror of https://github.com/m-labs/artiq.git synced 2024-12-25 19:28:26 +08:00

test: return experiment not, rdb

This commit is contained in:
Robert Jördens 2015-07-04 20:05:11 -06:00
parent 00b9368a0c
commit 4cbf280f1a
2 changed files with 13 additions and 10 deletions

View File

@ -90,23 +90,27 @@ class PulseRate(Experiment, AutoDB):
class CoredeviceTest(ExperimentCase): class CoredeviceTest(ExperimentCase):
def test_rtt(self): def test_rtt(self):
rtt = self.execute(RTT)["rtt"] self.execute(RTT)
rtt = self.dbh.get_result("rtt").read
print(rtt) print(rtt)
self.assertGreater(rtt, 0*ns) self.assertGreater(rtt, 0*ns)
self.assertLess(rtt, 100*ns) self.assertLess(rtt, 100*ns)
def test_loopback(self): def test_loopback(self):
rtt = self.execute(Loopback)["rtt"] self.execute(Loopback)
rtt = self.dbh.get_result("rtt").read
print(rtt) print(rtt)
self.assertGreater(rtt, 0*ns) self.assertGreater(rtt, 0*ns)
self.assertLess(rtt, 50*ns) self.assertLess(rtt, 50*ns)
def test_clock_generator_loopback(self): def test_clock_generator_loopback(self):
count = self.execute(ClockGeneratorLoopback)["count"] self.execute(ClockGeneratorLoopback)
count = self.dbh.get_result("count").read
self.assertEqual(count, 10) self.assertEqual(count, 10)
def test_pulse_rate(self): def test_pulse_rate(self):
rate = self.execute(PulseRate)["pulse_rate"] self.execute(PulseRate)
rate = self.dbh.get_result("pulse_rate").read
print(rate) print(rate)
self.assertGreater(rate, 100*ns) self.assertGreater(rate, 100*ns)
self.assertLess(rate, 2500*ns) self.assertLess(rate, 2500*ns)
@ -141,8 +145,7 @@ class RPCTiming(Experiment, AutoDB):
class RPCTest(ExperimentCase): class RPCTest(ExperimentCase):
def test_rpc_timing(self): def test_rpc_timing(self):
res = self.execute(RPCTiming) self.execute(RPCTiming)
print(res) self.assertGreater(self.dbh.get_result("rpc_time_mean").read, 100*ns)
self.assertGreater(res["rpc_time_mean"], 100*ns) self.assertLess(self.dbh.get_result("rpc_time_mean").read, 15*ms)
self.assertLess(res["rpc_time_mean"], 15*ms) self.assertLess(self.dbh.get_result("rpc_time_stddev").read, 1*ms)
self.assertLess(res["rpc_time_stddev"], 1*ms)

View File

@ -38,6 +38,6 @@ class ExperimentCase(unittest.TestCase):
self.rdb.build() self.rdb.build()
exp.run() exp.run()
exp.analyze() exp.analyze()
return self.rdb.data.read return exp
finally: finally:
self.dbh.close_devices() self.dbh.close_devices()