mirror of
https://github.com/m-labs/artiq.git
synced 2024-12-26 03:38:25 +08:00
test: return experiment not, rdb
This commit is contained in:
parent
00b9368a0c
commit
4cbf280f1a
@ -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)
|
|
||||||
|
@ -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()
|
||||||
|
Loading…
Reference in New Issue
Block a user