aboutsummaryrefslogtreecommitdiffstats
path: root/host/tests/devtest/benchmark_rate_test.py
diff options
context:
space:
mode:
authorMartin Braun <martin.braun@ettus.com>2018-08-21 09:41:25 -0700
committerBrent Stapleton <bstapleton@g.hmc.edu>2018-08-22 18:37:12 -0700
commit19042c32b8dc1aca1315a4b973803dbf23dfc423 (patch)
tree7ab24810317b73ae6c168a2fe615509384fc129a /host/tests/devtest/benchmark_rate_test.py
parent27a2182974869539c66a746a5f449d8ded0fb307 (diff)
downloaduhd-19042c32b8dc1aca1315a4b973803dbf23dfc423.tar.gz
uhd-19042c32b8dc1aca1315a4b973803dbf23dfc423.tar.bz2
uhd-19042c32b8dc1aca1315a4b973803dbf23dfc423.zip
devtest: Clean up & refactor
- Move filter_* functions out of uhd_test_case - Reduced some line lengths
Diffstat (limited to 'host/tests/devtest/benchmark_rate_test.py')
-rwxr-xr-xhost/tests/devtest/benchmark_rate_test.py13
1 files changed, 11 insertions, 2 deletions
diff --git a/host/tests/devtest/benchmark_rate_test.py b/host/tests/devtest/benchmark_rate_test.py
index 3d8ba3938..39d8bd483 100755
--- a/host/tests/devtest/benchmark_rate_test.py
+++ b/host/tests/devtest/benchmark_rate_test.py
@@ -54,7 +54,11 @@ class uhd_benchmark_rate_test(uhd_example_test_case):
match = re.search(r'(Num received samples):\s*(.*)', app.stdout)
run_results['num_rx_samples'] = int(match.group(2)) if match else -1
if run_results['num_rx_samples'] != -1:
- run_results['rel_rx_samples_error'] = 1.0 * abs(run_results['num_rx_samples'] - test_args.get('rx_buffer',0) - expected_samples) / expected_samples
+ run_results['rel_rx_samples_error'] = 1.0 * abs(
+ run_results['num_rx_samples']
+ - test_args.get('rx_buffer', 0)
+ - expected_samples
+ ) / expected_samples
else:
run_results['rel_rx_samples_error'] = 100
match = re.search(r'(Num dropped samples):\s*(.*)', app.stdout)
@@ -64,7 +68,11 @@ class uhd_benchmark_rate_test(uhd_example_test_case):
match = re.search(r'(Num transmitted samples):\s*(.*)', app.stdout)
run_results['num_tx_samples'] = int(match.group(2)) if match else -1
if run_results['num_tx_samples'] != -1:
- run_results['rel_tx_samples_error'] = 1.0 * abs(run_results['num_tx_samples'] - test_args.get('tx_buffer',0) - expected_samples) / expected_samples
+ run_results['rel_tx_samples_error'] = 1.0 * abs(
+ run_results['num_tx_samples']
+ - test_args.get('tx_buffer', 0)
+ - expected_samples
+ ) / expected_samples
else:
run_results['rel_tx_samples_error'] = 100
match = re.search(r'(Num sequence errors \(Tx\)):\s*(.*)', app.stdout)
@@ -86,3 +94,4 @@ class uhd_benchmark_rate_test(uhd_example_test_case):
])
self.report_example_results(test_name, run_results)
return run_results
+