Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Sébastien Villemot
dseries
Commits
94de7770
Commit
94de7770
authored
Nov 26, 2015
by
Stéphane Adjemian
Committed by
Stéphane Adjemian
Feb 18, 2016
Browse files
Added Makefile for running all the unit tests.
parent
bf79dbce
Changes
3
Hide whitespace changes
Inline
Side-by-side
Makefile
0 → 100644
View file @
94de7770
OCTAVE
=
octave-cli
MATLAB
=
`
which matlab
`
all
:
check-octave check-matlab
check-octave
:
@
cd
tests
;
\
$(OCTAVE)
--no-init-file
--silent
--no-history
runalltests.m
check-matlab
:
@
$(MATLAB)
-nosplash
-nodisplay
-r
"cd tests; runalltests; quit"
success.sh
0 → 100755
View file @
94de7770
#!/bin/sh
if
[
-f
./tests/failed
]
then
exit
1
fi
tests/runall
dseries
tests.m
→
tests/runalltests.m
View file @
94de7770
opath
=
path
();
system
(
'rm -f failed'
);
% Check that the m-unit-tests module is available.
install_unit_test_toolbox
=
false
;
...
...
@@ -8,12 +10,12 @@ try
initialize_unit_tests_toolbox
;
catch
urlwrite
(
'https://github.com/DynareTeam/m-unit-tests/archive/master.zip'
,
'master.zip'
);
warning
(
'off'
,
'MATLAB:MKDIR:DirectoryExists'
)
mkdir
(
'../externals'
)
warning
(
'on'
,
'MATLAB:MKDIR:DirectoryExists'
)
unzip
(
'master.zip'
,
'../externals'
)
delete
(
'master.zip'
)
addpath
([
pwd
()
'/../externals/m-unit-tests-master/src'
])
warning
(
'off'
,
'MATLAB:MKDIR:DirectoryExists'
)
;
mkdir
(
'../externals'
)
;
warning
(
'on'
,
'MATLAB:MKDIR:DirectoryExists'
)
;
unzip
(
'master.zip'
,
'../externals'
)
;
delete
(
'master.zip'
)
;
addpath
([
pwd
()
'/../externals/m-unit-tests-master/src'
])
;
initialize_unit_tests_toolbox
;
install_unit_test_toolbox
=
true
;
end
...
...
@@ -22,18 +24,26 @@ end
try
initialize_dseries_toolbox
;
catch
unit_tests_root
=
strrep
(
which
(
'runall
dseries
tests'
),
'runall
dseries
tests.m'
,
''
);
unit_tests_root
=
strrep
(
which
(
'runalltests'
),
'runalltests.m'
,
''
);
addpath
([
unit_tests_root
'../src'
]);
initialize_dseries_toolbox
;
end
if
isoctave
more
off
;
end
tmp
=
dseries_src_root
;
tmp
=
tmp
(
1
:
end
-
1
);
% Remove trailing slash.
run_unitary_tests_in_directory
(
tmp
);
report
=
run_unitary_tests_in_directory
(
tmp
);
delete
(
'*.log'
);
if
install_unit_test_toolbox
rmdir
(
'../externals/m-unit-tests-master'
,
's'
);
end
path
(
opath
);
\ No newline at end of file
path
(
opath
);
if
any
(
~
[
report
{:,
3
}])
system
(
'touch failed'
);
end
\ No newline at end of file
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment