File tree Expand file tree Collapse file tree 2 files changed +46
-0
lines changed Expand file tree Collapse file tree 2 files changed +46
-0
lines changed Original file line number Diff line number Diff line change 1+ classdef (SharedTestFixtures = { matlab .unittest .fixtures .PathFixture(fileparts(fileparts(mfilename(' fullpath' ))))}) ...
2+ BenchmarkNormalize < matlab .perftest .TestCase
3+
4+ properties
5+ P = ' ./../asdf/../../././//'
6+ end
7+
8+ properties (TestParameter )
9+ backend
10+ end
11+
12+ methods (TestParameterDefinition , Static )
13+ function backend = setupBackend()
14+ backend = init_backend(' normalize' );
15+ end
16+ end
17+
18+ methods (Test )
19+
20+ function bench(tc , backend )
21+ tc .startMeasuring()
22+ o = stdlib .normalize(tc .P , backend );
23+ tc .stopMeasuring()
24+
25+ tc .verifyClass(o , ' string' )
26+ tc .verifyGreaterThan(strlength(o ), 0 )
27+ end
28+
29+
30+ end
31+
32+ end
Original file line number Diff line number Diff line change 1+ function [r , s ] = BenchmarkNormalizeRun()
2+ tname = " BenchmarkNormalize" ;
3+
4+ r.same = run_bench(tname );
5+ s.exist = sampleSummary(r .same );
6+ disp(sortrows(s .exist , " Median" ))
7+ end
8+
9+
10+ function result = run_bench(name )
11+ suite = testsuite(name );
12+ exp = matlab .perftest .TimeExperiment .limitingSamplingError(MaxSamples = 150 , RelativeMarginOfError= 0.05 );
13+ result = exp .run(suite );
14+ end
You can’t perform that action at this time.
0 commit comments