Skip to content

Commit 60ac423

Browse files
Add travis CI
Signed-off-by: Firas Sahli <firas.sahli@adlinktech.com>
1 parent 8d8a58c commit 60ac423

File tree

3 files changed

+53
-19
lines changed

3 files changed

+53
-19
lines changed

.travis.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
before_install:
22
- sudo apt install -y python3-pip build-essential cmake
33
- git clone https://github.com/eclipse-cyclonedds/cyclonedds /tmp/cyclonedds
4-
- cd /tmp/cyclonedds && mkdir build && cd cmake --build . --target install
4+
- cd /tmp/cyclonedds && mkdir build && cd cmake --build . --target install && cd
55
addons:
66
apt:
77
update: true
@@ -12,6 +12,7 @@ python:
1212
- "3.6"
1313
- "3.7"
1414
- "3.8"
15+
- "3.8-dev"
1516

1617
install:
1718
- travis_retry pip3 install tox

cdds/dds_binding.py

Lines changed: 50 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
import os
33
from ctypes import *
44

5-
65
def get_lib_ext():
76
system = platform.system()
87
if system == 'Linux':
@@ -12,34 +11,68 @@ def get_lib_ext():
1211
else:
1312
return '.dll'
1413

14+
15+
# def get_user_lib_path():
16+
# system = platform.system()
17+
# if system == 'Linux':
18+
# return '/usr/local/lib'
19+
# elif system == 'Darwin':
20+
# return '/usr/local/lib'
21+
# elif system in ['windows', 'Windows', 'win32']:
22+
# return os.environ['CDDS_HOME']
23+
# else:
24+
# return '/usr/local/lib'
25+
1526
def get_user_lib_path():
27+
system = platform.system()
28+
if system == 'Linux':
29+
return '/home/firas/cyclone/cyclonedds/bld/lib/'
30+
elif system == 'Darwin':
31+
return '/usr/local/lib'
32+
elif system in ['windows', 'Windows', 'win32']:
33+
return os.environ['CDDS_HOME']
34+
else:
35+
return '/home/firas/cyclone/cyclonedds/bld/lib/'
36+
37+
def get_user_bit_lib_path():
1638
system = platform.system()
1739
if system == 'Linux':
18-
return '/usr/local/lib'
40+
return '/home/firas/cyclone/cdds-python/bit/build'
1941
elif system == 'Darwin':
2042
return '/usr/local/lib'
2143
elif system in ['windows', 'Windows', 'win32']:
2244
return os.environ['CDDS_HOME']
2345
else:
24-
return '/usr/local/lib'
25-
26-
46+
return '/home/firas/cyclone/cdds-python/bit/build'
47+
48+
# system = platform.system()
49+
# if system in ['windows', 'Windows', 'win32']:
50+
# cham_lib = 'ddsc' + get_lib_ext()
51+
# bit_lib = 'ddstubs' + get_lib_ext()
52+
# cham_lib_path = get_user_bit_lib_path() + os.sep + cham_lib
53+
# bit_lib_path = get_user_bit_lib_path() + os.sep + bit_lib
54+
# else:
55+
# cham_lib = 'libddsbit' + get_lib_ext()
56+
# bit_lib = 'libddstubs' + get_lib_ext()
57+
# cham_lib_path = get_user_bit_lib_path() + os.sep + cham_lib
58+
# bit_lib_path = get_user_bit_lib_path() + os.sep + bit_lib
59+
2760
system = platform.system()
2861
if system in ['windows', 'Windows', 'win32']:
29-
cham_lib = 'ddsc' + get_lib_ext()
30-
bit_lib = 'ddstubs' + get_lib_ext()
31-
cham_lib_path = get_user_lib_path() + os.sep + cham_lib
32-
bit_lib_path = get_user_lib_path() + os.sep + bit_lib
62+
cham_lib = 'ddsc' + get_lib_ext()
63+
bit_lib = 'ddstubs' + get_lib_ext()
64+
cham_lib_path = get_user_lib_path() + os.sep + cham_lib
65+
bit_lib_path = get_user_bit_lib_path() + os.sep + bit_lib
3366
else:
3467
cham_lib = 'libddsc' + get_lib_ext()
35-
bit_lib = 'libddstubs' + get_lib_ext()
68+
bit_lib = 'libddstubs' + get_lib_ext()
3669
helloworld_lib = 'libddshelloworld' + get_lib_ext()
3770
cham_lib_path = get_user_lib_path() + os.sep + cham_lib
38-
bit_lib_path = get_user_lib_path() + os.sep + bit_lib
39-
40-
# Limits and Constants
41-
MAX_SAMPLES = 256
71+
bit_lib_path = get_user_bit_lib_path() + os.sep + bit_lib
4272
helloworld_lib_path = get_user_bit_lib_path() + os.sep + helloworld_lib
73+
74+
# Limits and Constants
75+
MAX_SAMPLES = 100
4376

4477

4578
#
@@ -121,6 +154,7 @@ def get_user_lib_path():
121154
DDS_DESTINATIONORDER_BY_RECEPTION_TIMESTAMP = 0
122155
DDS_DESTINATIONORDER_BY_SOURCE_TIMESTAMP = 1
123156

157+
124158
def dds_secs(n):
125159
return n*1000000000
126160

@@ -133,7 +167,6 @@ def dds_micros(n):
133167
def dds_nanos(n):
134168
return n
135169

136-
137170
#
138171
# DDS Sample Info
139172
#
@@ -173,7 +206,7 @@ def is_not_alive_instance(self):
173206
dds_entity_t = c_int32
174207
dds_time_t = c_int64
175208
dds_duration_t = c_int64
176-
dds_instance_handle_t = c_int64
209+
dds_instance_handle_t = c_uint64
177210
dds_domainid_t = c_uint32
178211
dds_sample_state_t = c_int
179212
dds_view_state_t = c_int
@@ -242,4 +275,4 @@ class DDSKeyBValue(Structure):
242275

243276
class KeyHolder(object):
244277
def __init__(self, k):
245-
self.key = k
278+
self.key = k

tox.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ install_command = pip install -U {opts} {packages}
99
setenv =
1010
VIRTUAL_ENV={envdir}
1111
deps =
12-
-r{toxinidir}/requirements.txt
12+
r{toxinidir}/requirements.txt
1313
commands = nosetests --with-coverage --cover-package=yaks yaks
1414

1515
[testenv:pep8]

0 commit comments

Comments
 (0)