forked from EnricSala/influxdb-matlab
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathrun_tests.m
More file actions
29 lines (22 loc) · 680 Bytes
/
run_tests.m
File metadata and controls
29 lines (22 loc) · 680 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
clear; clc;
import matlab.unittest.TestRunner;
import matlab.unittest.plugins.TestRunProgressPlugin;
% Add the library to the path
addpath('influxdb-client');
% Check if running in a CI environment
CI = ~isempty(getenv('CI'));
% Initialize a test runner
runner = TestRunner.withTextOutput;
if CI
runner.addPlugin(TestRunProgressPlugin.withVerbosity(3));
end
% Run all the tests
result = runner.run(testsuite('tests'));
% Fail the build if there are failures
if CI
assert(all([result.Passed]), 'There are test failures!');
% Display a test summary on success
Name = {result.Name}';
Duration = [result.Duration]';
disp(table(Name, Duration));
end