Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
C
caosdb-julialib
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-julialib
Commits
b1687958
Commit
b1687958
authored
3 years ago
by
florian
Browse files
Options
Downloads
Patches
Plain Diff
ENH: Replace dummy function by libcaosdb version retrieval
parent
01bcdd20
No related branches found
No related tags found
1 merge request
!1
DRAFT: ENH: Include libcaosdb and a minimal wrapper
Pipeline
#9992
failed
3 years ago
Stage: code-style
Stage: test
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
jlcaosdb/jlcaosdb.cxx
+7
-1
7 additions, 1 deletion
jlcaosdb/jlcaosdb.cxx
src/CaosDB.jl
+14
-6
14 additions, 6 deletions
src/CaosDB.jl
test/runtests.jl
+10
-1
10 additions, 1 deletion
test/runtests.jl
with
31 additions
and
8 deletions
jlcaosdb/jlcaosdb.cxx
+
7
−
1
View file @
b1687958
...
...
@@ -22,9 +22,15 @@
*/
#include
<jlcxx/jlcxx.hpp>
#include
"caosdb/authentication.h"
#include
"caosdb/connection.h"
#include
"caosdb/constants.h"
#include
"caosdb/exceptions.h"
JLCXX_MODULE
define_julia_module
(
jlcxx
::
Module
&
mod
)
{
// Version info of libcaosdb against which this is built.
mod
.
method
(
"get_libcaosdb_version_major"
,
[]()
{
return
caosdb
::
LIBCAOSDB_VERSION_MAJOR
;});
mod
.
method
(
"get_libcaosdb_version_minor"
,
[]()
{
return
caosdb
::
LIBCAOSDB_VERSION_MINOR
;});
mod
.
method
(
"get_libcaosdb_version_patch"
,
[]()
{
return
caosdb
::
LIBCAOSDB_VERSION_PATCH
;});
}
This diff is collapsed.
Click to expand it.
src/CaosDB.jl
+
14
−
6
View file @
b1687958
# Useful for development, TODO remove for production
__precompile__
(
false
)
module
CaosDB
using
CxxWrap
# Adapt this path if you haven't compiled jlcaosdb to `caosdb-julialib/build`
@wrapmodule
(
joinpath
(
pwd
(),
"
build/lib/libjlcaosdb"
))
@wrapmodule
(
joinpath
(
@__DIR__
,
"../jlcaosdb/
build/lib/libjlcaosdb"
))
function
__init__
()
@initcxx
end
export
dummy_func
"""
dummy_func(x
)
get_libcaosdb_version(
)
Returns double the number `x` plus `1`.
Returns the version string of libcaosdb with which this package has
been built.
"""
dummy_func
(
x
)
=
2
x
+
1
function
get_libcaosdb_version
()
major
=
get_libcaosdb_version_major
()
minor
=
get_libcaosdb_version_minor
()
patch
=
get_libcaosdb_version_patch
()
return
"
$
major.
$
minor.
$
patch"
end
end
# module
This diff is collapsed.
Click to expand it.
test/runtests.jl
+
10
−
1
View file @
b1687958
println
(
"Testing..."
)
using
CaosDB
using
Test
# Test whether retrieving the libcaosdb version works as expected
@test
CaosDB
.
get_libcaosdb_version
()
!=
Nothing
@test
length
(
split
(
CaosDB
.
get_libcaosdb_version
(),
"."
))
==
3
@test
split
(
CaosDB
.
get_libcaosdb_version
(),
"."
)[
1
]
==
string
(
CaosDB
.
get_libcaosdb_version_major
())
@test
split
(
CaosDB
.
get_libcaosdb_version
(),
"."
)[
2
]
==
string
(
CaosDB
.
get_libcaosdb_version_minor
())
@test
split
(
CaosDB
.
get_libcaosdb_version
(),
"."
)[
3
]
==
string
(
CaosDB
.
get_libcaosdb_version_patch
())
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