Skip to content

Commit 14de6c1

Browse files
committed
conformance tests: export pusch results to csv
1 parent 1d293e8 commit 14de6c1

File tree

2 files changed

+41
-1
lines changed

2 files changed

+41
-1
lines changed

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# runSRSRANUnittest results.
22
/testvector_outputs
3+
# Conformance tests CSV results.
4+
/unitTests/conformanceResults
35
# MATLAB automatic save files.
46
*.asv
57
# MEX libraries.

unitTests/CheckPUSCHConformance.m

+39-1
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,13 @@
4646
FRC = createFRC()
4747
end % of properties (Constant)
4848

49+
properties (Constant, Hidden)
50+
%Folder for storing the test results in csv format.
51+
OutputFolder = 'conformanceResults'
52+
%File for storing the results in csv format.
53+
OutputFile = fullfile(pwd, CheckPUSCHConformance.OutputFolder, ['conformancePUSCH', char(datetime('now', 'Format', 'yyyyMMdd''T''HHmmss')), '.csv'])
54+
end % of properties (Constant, Hidden)
55+
4956
properties (TestParameter)
5057
%PUSCH test configurations.
5158
% Defines, for each test, the DelayProfile, the DelaySpread and the
@@ -54,6 +61,24 @@
5461
TestConfig = createTestConfig()
5562
end % of properties (TestParameter)
5663

64+
methods (TestClassSetup)
65+
function preparecsv(obj)
66+
%Creates a csv file for storing the results of all tests.
67+
68+
if ~exist(obj.OutputFolder, 'dir')
69+
mkdir(obj.OutputFolder);
70+
end
71+
fff = fopen(obj.OutputFile, 'w');
72+
73+
% Write file header.
74+
fprintf(fff, '#datatype,measurement,tag,double,dateTime:RFC339\n');
75+
fprintf(fff, '#default,,,,\n');
76+
fprintf(fff, ',m,config,tp,time\n');
77+
78+
fclose(fff);
79+
end % of function preparecsv(obj)
80+
end % of methods (TestClassSetup)
81+
5782
methods (Test, TestTags = {'conformance'})
5883
function checkPUSCHconformance(obj, TestConfig)
5984
%Verifies that the target throughput is achieved for the given PUSCH configuration.
@@ -128,10 +153,23 @@ function checkPUSCHconformance(obj, TestConfig)
128153
obj.assertGreaterThan(tp, 0.70, 'ERROR: Throughput for a TS case is below the hard acceptance threshold of 70%.');
129154
end
130155

131-
% TODO: export throughput (and possibly other metrics) to grafana.
156+
% Export throughput in csv format to be imported in grafana.
157+
writecsv(obj, TestConfig.Name, tp * 100);
132158

133159
end % of function checkPUSCHconformance(obj, TestConfig)
134160
end % of methods (Test, TestTags = {'conformance'})
161+
162+
methods (Access=private)
163+
function writecsv(obj, casename, tp)
164+
%Writes the test entry in the csv file.
165+
166+
fff = fopen(obj.OutputFile, 'a');
167+
currTime = char(datetime('now', 'Format', 'yyyy-MM-dd''T''HH:mm:ss.SSS''Z'''));
168+
fprintf(fff, ',PUSCH Throughput,%s,%.3f,%s\n', casename, tp, currTime);
169+
170+
fclose(fff);
171+
end % of function writecsv(obj)
172+
end % of methods (Access=private)
135173
end % of classdef CheckConformance < matlab.unittest.TestCase
136174

137175
function frcdictionary = createFRC()

0 commit comments

Comments
 (0)