Skip to content

Commit bc76619

Browse files
authored
Merge pull request #5 from tkoolen/tk/0.7
Fixes for 0.7
2 parents 8d9fb18 + f99dc4e commit bc76619

4 files changed

Lines changed: 16 additions & 14 deletions

File tree

.travis.yml

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,21 +5,18 @@ os:
55
- linux
66
julia:
77
- 0.6
8+
- 1.0
89
- nightly
910
dist: trusty
1011
branches:
11-
only: master
12+
only:
13+
- master
14+
- /^v[0-9]+\.[0-9]+\.[0-9]+$/ # version tags
1215
matrix:
1316
allow_failures:
1417
- julia: nightly
1518
notifications:
1619
email: false
17-
18-
## uncomment the following lines to override the default test script
19-
#script:
20-
# - julia -e 'Pkg.clone(pwd()); Pkg.build("DrakeLCMTypes"); Pkg.test("DrakeLCMTypes"; coverage=true)'
2120
after_success:
22-
# push coverage results to Coveralls
23-
- julia -e 'cd(Pkg.dir("BotCoreLCMTypes")); Pkg.add("Coverage"); using Coverage; Coveralls.submit(Coveralls.process_folder())'
2421
# push coverage results to Codecov
25-
- julia -e 'cd(Pkg.dir("BotCoreLCMTypes")); Pkg.add("Coverage"); using Coverage; Codecov.submit(Codecov.process_folder())'
22+
- julia -e 'if VERSION >= v"0.7-"; using Pkg; else; cd(Pkg.dir("BotCoreLCMTypes")); end; Pkg.add("Coverage"); using Coverage; Codecov.submit(process_folder())'

src/sensor_status_t.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# The sensor_status_t has a field named `type`, which is a reserved
22
# keyword in Julia v0.7 and below. To get around that, we can just
33
# construct the expression directly instead of relying on the parser.
4-
eval(Expr(:type, true,
4+
eval(Expr(VERSION < v"0.7-" ? :type : :struct, true,
55
Expr(:(<:), :sensor_status_t, :LCMType),
66
Expr(:block,
77
Expr(:(::), :utime, :Int64),

src/viewer_geometry_data_t.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# The viewer_geometry_data_t has a field named `type`, which is a reserved
22
# keyword in Julia v0.7 and below. To get around that, we can just
33
# construct the expression directly instead of relying on the parser
4-
eval(Expr(:type, true,
4+
eval(Expr(VERSION < v"0.7-" ? :type : :struct, true,
55
Expr(:(<:), :viewer_geometry_data_t, :LCMType),
66
Expr(:block,
77
Expr(:(::), :type, :Int8),

test/runtests.jl

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,12 @@
11
using BotCoreLCMTypes
22
using LCMCore
33
using LCMCore: fingerprint
4-
using Base.Test
4+
5+
if VERSION >= v"0.7-"
6+
using Test
7+
else
8+
using Base.Test
9+
end
510

611
#=
712
The following Python code was used to retrieve all of the
@@ -30,14 +35,14 @@ for name, obj in inspect.getmembers(drake):
3035

3136
"""
3237
Equality test for most types, but we compare LCMType instances
33-
by looking at their fields, since otherwise == just falls back
34-
to === which compares object identity and is thus not very
38+
by looking at their fields, since otherwise == just falls back
39+
to === which compares object identity and is thus not very
3540
informative.
3641
"""
3742
closeenough(x, y) = x == y
3843
function closeenough(x::LCMType, y::LCMType)
3944
(typeof(x) == typeof(y)) || return false
40-
for name in fieldnames(x)
45+
for name in fieldnames(typeof(x))
4146
closeenough(getfield(x, name), getfield(y, name)) || return false
4247
end
4348
true

0 commit comments

Comments
 (0)