Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
C
caosdb-octaveinttest
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
caosdb
Software
caosdb-octaveinttest
Commits
bd0939a3
Commit
bd0939a3
authored
3 years ago
by
Daniel Hornung
Browse files
Options
Downloads
Patches
Plain Diff
STY: Style fixes.
parent
5730d7e5
No related branches found
Branches containing commit
No related tags found
1 merge request
!2
Enhanced functionality testing
Pipeline
#11832
failed
3 years ago
Stage: info
Stage: setup
Stage: build
Stage: test
Changes
3
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
Makefile
+13
-0
13 additions, 0 deletions
Makefile
test/Run_Test.m
+1
-1
1 addition, 1 deletion
test/Run_Test.m
test/test_caosdb.m
+27
-10
27 additions, 10 deletions
test/test_caosdb.m
with
41 additions
and
11 deletions
Makefile
+
13
−
0
View file @
bd0939a3
...
...
@@ -26,6 +26,18 @@ help:
@
echo
"Targets:"
@
echo
" test - run the test."
###############################################################################
# Style and linting #
###############################################################################
style
:
mh_style
--octave
test
||
(
echo
'You may want to run `make style_fix`.'
;
exit
1
)
.PHONY
:
style
style_fix
:
mh_style
--fix
--octave
test
.PHONY
:
style_fix
###############################################################################
# Tests #
###############################################################################
...
...
@@ -33,3 +45,4 @@ help:
test
:
cd test
&&
octave Run_Test.m
.PHONY
:
test
This diff is collapsed.
Click to expand it.
test/Run_Test.m
+
1
−
1
View file @
bd0939a3
...
...
@@ -19,5 +19,5 @@
pkg
load
caosdb
;
test_result
=
moxunit_runtests
(
"-verbose"
,
"test_caosdb.m"
);
if
not
(
test_result
)
exit
(
1
)
exit
(
1
)
;
end
This diff is collapsed.
Click to expand it.
test/test_caosdb.m
+
27
−
10
View file @
bd0939a3
function
test_suite
=
test_caosdb
()
% This file is a part of the CaosDB Project.
%
% Copyright (C) 2021 IndiScale GmbH <info@indiscale.com>
% Copyright (C) 2021 Daniel Hornung <d.hornung@indiscale.com>
%
% This program is free software: you can redistribute it and/or modify
% it under the terms of the GNU Affero General Public License as
% published by the Free Software Foundation, either version 3 of the
% License, or (at your option) any later version.
%
% This program is distributed in the hope that it will be useful,
% but WITHOUT ANY WARRANTY; without even the implied warranty of
% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
% GNU Affero General Public License for more details.
%
% You should have received a copy of the GNU Affero General Public License
% along with this program. If not, see <https://www.gnu.org/licenses/>.
%% The main function which intitializes the tests.
function
test_suite
=
test_caosdb
()
try
% assignment of 'localfunctions' is necessary in Matlab >= 2016
test_functions
=
localfunctions
();
test_functions
=
localfunctions
();
catch
% no problem; early Matlab versions can use initTestSuite fine
end
initTestSuite
;
...
...
@@ -14,7 +33,7 @@ function test_connection()
info
=
c1
.
info
();
% another working connection
c2
=
Caosdb
(
connection
=
"local-caosdb-admin"
);
c2
=
Caosdb
(
"local-caosdb-admin"
);
c2
.
info
();
% This connection should fail
...
...
@@ -25,17 +44,16 @@ function test_connection()
if
moxunit_util_platform_is_octave
()
assertExceptionThrown
(
@
non_existing_connection
);
else
assertExceptionThrown
(
@
non_existing_connection
,
"16"
);
assertExceptionThrown
(
@
non_existing_connection
,
"16"
);
end
expected_msg
=
...
strjoin
(
{
"maox_info: The ConnectionManager does not know any connection of this name."
,
"No connection named 'does-not-exist' present."
},
"\n"
);
assertEqual
(
lasterror
()
.
message
,
expected_msg
)
strjoin
({
"maox_info: The ConnectionManager does not know any connection of this name."
,
...
"No connection named 'does-not-exist' present."
},
"\n"
);
assertEqual
(
lasterror
()
.
message
,
expected_msg
);
end
function
info
=
non_existing_connection
()
c
=
Caosdb
(
connection
=
"does-not-exist"
);
c
=
Caosdb
(
"does-not-exist"
);
info
=
c
.
info
();
end
...
...
@@ -102,4 +120,3 @@ function test_retrieve_failure()
assertExceptionThrown
(
@
()
c
.
retrieve
({
"120"
},
{
120
}),
"maox:InvalidArgument"
);
assertExceptionThrown
(
@
()
c
.
retrieve
({
"120"
},
{
"120"
,
120
}),
"maox:InvalidArgument"
);
end
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment