Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
E
eigenpy
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository 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
Stack Of Tasks
eigenpy
Commits
b8004fee
Unverified
Commit
b8004fee
authored
1 year ago
by
Joris Vaillant
Browse files
Options
Downloads
Patches
Plain Diff
cmake: Use generated tests
parent
7c39cd8b
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Pipeline
#35870
passed with warnings
1 year ago
Stage: test
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
unittest/CMakeLists.txt
+5
-2
5 additions, 2 deletions
unittest/CMakeLists.txt
unittest/python/test_optional_boost.py
+0
-67
0 additions, 67 deletions
unittest/python/test_optional_boost.py
unittest/python/test_optional_std.py
+0
-67
0 additions, 67 deletions
unittest/python/test_optional_std.py
with
5 additions
and
136 deletions
unittest/CMakeLists.txt
+
5
−
2
View file @
b8004fee
...
@@ -55,8 +55,11 @@ function(config_test test tagname opttype)
...
@@ -55,8 +55,11 @@ function(config_test test tagname opttype)
configure_file
(
python/test_
${
test
}
.py.in
configure_file
(
python/test_
${
test
}
.py.in
${
CMAKE_CURRENT_BINARY_DIR
}
/python/
${
py_file
}
)
${
CMAKE_CURRENT_BINARY_DIR
}
/python/
${
py_file
}
)
add_lib_unit_test
(
${
MODNAME
}
)
add_lib_unit_test
(
${
MODNAME
}
)
add_python_unit_test
(
"py-
${
test
}
-
${
tagname
}
"
"unittest/python/
${
py_file
}
"
set
(
PYTHON_TEST_NAME
"py-
${
test
}
-
${
tagname
}
"
)
"unittest"
)
add_test
(
NAME
${
PYTHON_TEST_NAME
}
COMMAND
${
PYTHON_EXECUTABLE
}
"
${
CMAKE_CURRENT_BINARY_DIR
}
/python/
${
py_file
}
"
)
compute_pythonpath
(
ENV_VARIABLES
"unittest"
)
set_tests_properties
(
${
PYTHON_TEST_NAME
}
PROPERTIES ENVIRONMENT
"
${
ENV_VARIABLES
}
"
)
endfunction
()
endfunction
()
config_test
(
variant boost
"boost::variant"
)
config_test
(
variant boost
"boost::variant"
)
...
...
This diff is collapsed.
Click to expand it.
unittest/python/test_optional_boost.py
deleted
100644 → 0
+
0
−
67
View file @
7c39cd8b
import
importlib
bind_optional
=
importlib
.
import_module
(
"
bind_optional_boost
"
)
def
test_none_if_zero
():
x
=
bind_optional
.
none_if_zero
(
0
)
y
=
bind_optional
.
none_if_zero
(
-
1
)
assert
x
is
None
assert
y
==
-
1
def
test_struct_ctors
():
# test struct ctors
struct
=
bind_optional
.
mystruct
()
assert
struct
.
a
is
None
assert
struct
.
b
is
None
assert
struct
.
msg
==
"
i am struct
"
## no 2nd arg automatic overload using bp::optional
struct
=
bind_optional
.
mystruct
(
2
)
assert
struct
.
a
==
2
assert
struct
.
b
is
None
struct
=
bind_optional
.
mystruct
(
13
,
-
1.0
)
assert
struct
.
a
==
13
assert
struct
.
b
==
-
1.0
def
test_struct_setters
():
struct
=
bind_optional
.
mystruct
()
struct
.
a
=
1
assert
struct
.
a
==
1
struct
.
b
=
-
3.14
assert
struct
.
b
==
-
3.14
# set to None
struct
.
a
=
None
struct
.
b
=
None
struct
.
msg
=
None
assert
struct
.
a
is
None
assert
struct
.
b
is
None
assert
struct
.
msg
is
None
def
test_factory
():
struct
=
bind_optional
.
create_if_true
(
False
,
None
)
assert
struct
is
None
struct
=
bind_optional
.
create_if_true
(
True
,
None
)
assert
struct
.
a
==
0
assert
struct
.
b
is
None
def
test_random_mat
():
M
=
bind_optional
.
random_mat_if_true
(
False
)
assert
M
is
None
M
=
bind_optional
.
random_mat_if_true
(
True
)
assert
M
.
shape
==
(
4
,
4
)
test_none_if_zero
()
test_struct_ctors
()
test_struct_setters
()
test_factory
()
test_random_mat
()
This diff is collapsed.
Click to expand it.
unittest/python/test_optional_std.py
deleted
100644 → 0
+
0
−
67
View file @
7c39cd8b
import
importlib
bind_optional
=
importlib
.
import_module
(
"
bind_optional_std
"
)
def
test_none_if_zero
():
x
=
bind_optional
.
none_if_zero
(
0
)
y
=
bind_optional
.
none_if_zero
(
-
1
)
assert
x
is
None
assert
y
==
-
1
def
test_struct_ctors
():
# test struct ctors
struct
=
bind_optional
.
mystruct
()
assert
struct
.
a
is
None
assert
struct
.
b
is
None
assert
struct
.
msg
==
"
i am struct
"
## no 2nd arg automatic overload using bp::optional
struct
=
bind_optional
.
mystruct
(
2
)
assert
struct
.
a
==
2
assert
struct
.
b
is
None
struct
=
bind_optional
.
mystruct
(
13
,
-
1.0
)
assert
struct
.
a
==
13
assert
struct
.
b
==
-
1.0
def
test_struct_setters
():
struct
=
bind_optional
.
mystruct
()
struct
.
a
=
1
assert
struct
.
a
==
1
struct
.
b
=
-
3.14
assert
struct
.
b
==
-
3.14
# set to None
struct
.
a
=
None
struct
.
b
=
None
struct
.
msg
=
None
assert
struct
.
a
is
None
assert
struct
.
b
is
None
assert
struct
.
msg
is
None
def
test_factory
():
struct
=
bind_optional
.
create_if_true
(
False
,
None
)
assert
struct
is
None
struct
=
bind_optional
.
create_if_true
(
True
,
None
)
assert
struct
.
a
==
0
assert
struct
.
b
is
None
def
test_random_mat
():
M
=
bind_optional
.
random_mat_if_true
(
False
)
assert
M
is
None
M
=
bind_optional
.
random_mat_if_true
(
True
)
assert
M
.
shape
==
(
4
,
4
)
test_none_if_zero
()
test_struct_ctors
()
test_struct_setters
()
test_factory
()
test_random_mat
()
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