Commit 3f620ef4 authored by Laurent Heirendt's avatar Laurent Heirendt
Browse files

Merge branch 'develop' into 'master'

Regular merge of develop

See merge request R3.training/git.practice!32
parents 110a434e 946356e7
...@@ -5,5 +5,5 @@ before_install: ...@@ -5,5 +5,5 @@ before_install:
script: script:
# launch the tests # launch the tests
- /mnt/prince-data/MATLAB/$MATLAB_VER/bin/./matlab -nodesktop -nosplash < test/*.m - bash .artenolis/runtests.sh
#!/bin/sh
if [ "$ARCH" == "Linux" ]; then
/mnt/prince-data/MATLAB/$MATLAB_VER/bin/./matlab -nodesktop -nosplash < test/testAll.m
fi
# exit status
CODE=$?
exit $CODE
function c = addTwoNumbers_myName(a, b) function c = addTwoNumbers_myName(a, b)
% addTwoNumbers(a, b) returns the sum of a and b % addTwoNumbers_myName(a, b) returns the sum of a and b
c = a + b; c = a - b;
end end
function c = multiplyTwoNumbers_myName(a, b) function c = multiplyTwoNumbers_myName(a, b)
% multiplyTwoNumbers(a, b) returns the product of a and b % multiplyTwoNumbers_myName(a, b) returns the product of a and b
c = a * b; c = a / b;
end end
% Test file % Test file
addpath(genpath('src/')) % add this folder and all subfolders to the path
c = addTwoNumbers_myName(1, 2) c = addTwoNumbers_myName(1, 2)
% test if the addition function works as expected
assert(c == 3)
d = multiplyTwoNumbers_myName(c, c) d = multiplyTwoNumbers_myName(c, c)
% test if the multiplication function works as expected
assert(d == 9)
% test my sqrt function % test my sqrt function
% assert(sqrt_myName(d) == sqrt(d)) assert(sqrt_myName(d) == sqrt(d))
% include the root folder and all subfolders.
addpath(genpath(pwd));
% define a success exit code
exit_code = 0;
try
% save the userpath
originalUserPath = path;
result = runtests('./test/', 'Recursively', true, 'BaseFolder', '*suite*');
sumFailed = 0;
sumIncomplete = 0;
% print out a summary table
table(result)
for i = 1:size(result,2)
sumFailed = sumFailed + result(i).Failed
sumIncomplete = sumIncomplete + result(i).Incomplete
end
% restore the original path
restoredefaultpath;
addpath(originalUserPath);
if sumFailed > 0 || sumIncomplete > 0
exit_code = 1;
end
% ensure that we ALWAYS call exit
if ~isempty(strfind(getenv('HOME'), 'jenkins'))
exit(exit_code);
end
catch
exit(1);
end
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment