Skip to content

Commit 9692058

Browse files
committed
correct buildfile syntax
1 parent a242ba3 commit 9692058

3 files changed

Lines changed: 19 additions & 22 deletions

File tree

+matmap3d/geodetic2ned.m

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,7 @@
1616
angleUnit = 'd';
1717
end
1818

19-
[x1,y1,z1] = matmap3d.geodetic2ecef(spheroid, lat,lon,alt,angleUnit);
20-
[x2,y2,z2] = matmap3d.geodetic2ecef(spheroid, lat0,lon0,alt0,angleUnit);
21-
22-
dx = x1-x2;
23-
dy = y1-y2;
24-
dz = z1-z2;
25-
26-
[east, north, up] = matmap3d.ecef2enuv(dx, dy, dz, lat0, lon0, angleUnit);
19+
[east, north, up] = matmap3d.geodetic2enu(lat, lon, alt, lat0, lon0, alt0, spheroid, angleUnit);
2720

2821
down = -up;
2922

buildfile.m

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -9,28 +9,29 @@
99
mkdir(reportDir);
1010
end
1111

12-
if ~isMATLABReleaseOlderThan('R2024a')
12+
if isMATLABReleaseOlderThan('R2023a')
13+
plan('test') = matlab.buildtool.Task(Actions=@(context) legacy_test(context, test_root));
14+
else
15+
plan('test') = matlab.buildtool.tasks.TestTask(test_root, SourceFiles=pkgDir);
16+
end
1317

14-
plan('coverage') = matlab.buildtool.tasks.TestTask(test_root, ...
15-
Description="Run code coverage", ...
16-
SourceFiles=pkgDir, ...
17-
Strict=false);
18-
plan('coverage').DisableIncremental = true;
18+
if ~isMATLABReleaseOlderThan('R2024a')
1919

2020
coverageReport = fullfile(reportDir, 'coverage-report.html');
21-
%try
22-
addCodeCoverage(plan("coverage"), matlabtest.plugins.codecoverage.StandaloneReport(coverageReport));
23-
%catch
24-
% plan("coverage").addCodeCoverage(coverageReport);
25-
%end
21+
try
22+
report = matlabtest.plugins.codecoverage.StandaloneReport(coverageReport);
23+
catch
24+
report = coverageReport;
25+
end
26+
plan('coverage') = plan('test').addCodeCoverage(report);
27+
plan('coverage').DisableIncremental = true;
2628
end
2729

2830
end
2931

3032

31-
function testTask(context)
32-
r = runtests(fullfile(context.Plan.RootFolder, "test"), Strict=false);
33-
% Parallel Computing Toolbox takes more time to startup than is worth it for this task
33+
function legacy_test(~, test_root)
34+
r = runtests(test_root);
3435

3536
assert(~isempty(r), 'No tests were run')
3637
assertSuccess(r)

test/TestUnit.m

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,9 @@ function test_geodetic2enu(tc)
172172

173173
[lt, ln, at] = matmap3d.enu2geodetic(e,n,u,tc.lat,tc.lon,tc.alt, tc.E, tc.angleUnit); % round-trip
174174
tc.verifyEqual([lt, ln, at],[tc.lat, tc.lon, tc.alt-1], AbsTol=tc.atol, RelTol=tc.rtol)
175+
176+
[n1, e1, d] = matmap3d.geodetic2ned(tc.lat, tc.lon, tc.alt-1, tc.lat, tc.lon, tc.alt, tc.E, tc.angleUnit);
177+
tc.verifyEqual([e,n,u],[e1,n1,-d], AbsTol=tc.atol, RelTol=tc.rtol)
175178
end
176179

177180

0 commit comments

Comments
 (0)