From a9d412aa421d906ea50fa18ccfef2f6090b88718 Mon Sep 17 00:00:00 2001 From: Yichao Yu Date: Fri, 18 Sep 2015 23:56:27 -0400 Subject: [PATCH 1/3] Union() -> Union{} --- src/FixedPointNumbers.jl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/FixedPointNumbers.jl b/src/FixedPointNumbers.jl index 181668c4..00cbdfef 100644 --- a/src/FixedPointNumbers.jl +++ b/src/FixedPointNumbers.jl @@ -57,9 +57,9 @@ end # Particularly useful for arrays. scaledual(Tdual::Type, x) = one(Tdual), x scaledual{Tdual<:Number}(b::Tdual, x) = b, x -scaledual{T<:FixedPoint}(Tdual::Type, x::Union(T, AbstractArray{T})) = +@compat scaledual{T<:FixedPoint}(Tdual::Type, x::Union{T,AbstractArray{T}}) = convert(Tdual, 1/one(T)), reinterpret(rawtype(T), x) -scaledual{Tdual<:Number, T<:FixedPoint}(b::Tdual, x::Union(T, AbstractArray{T})) = +@compat scaledual{Tdual<:Number, T<:FixedPoint}(b::Tdual, x::Union{T,AbstractArray{T}}) = convert(Tdual, b/one(T)), reinterpret(rawtype(T), x) end # module From 5c08bce4f3de2432b4c81c195725f07369549233 Mon Sep 17 00:00:00 2001 From: Yichao Yu Date: Sat, 19 Sep 2015 00:09:07 -0400 Subject: [PATCH 2/3] Upgrade travis settings --- .travis.yml | 23 ++++++++--------------- 1 file changed, 8 insertions(+), 15 deletions(-) diff --git a/.travis.yml b/.travis.yml index 2cb1635d..e0ea53de 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,17 +1,10 @@ -language: cpp -compiler: - - clang +language: julia +os: + - linux + - osx +julia: + - 0.3 + - 0.4 + - nightly notifications: email: false -env: - matrix: - - JULIAVERSION="juliareleases" - - JULIAVERSION="julianightlies" -before_install: - - sudo add-apt-repository ppa:staticfloat/julia-deps -y - - sudo add-apt-repository ppa:staticfloat/${JULIAVERSION} -y - - sudo apt-get update -qq -y - - sudo apt-get install libpcre3-dev julia -y -script: - - julia -e 'Pkg.init(); run(`ln -s $(pwd()) $(Pkg.dir("FixedPointNumbers"))`); Pkg.pin("FixedPointNumbers"); Pkg.resolve()' - - julia test/runtests.jl From a39c6590e37b90db23a5303c466fbbadbec73aa3 Mon Sep 17 00:00:00 2001 From: Yichao Yu Date: Sat, 19 Sep 2015 08:03:30 -0400 Subject: [PATCH 3/3] Print test progress --- test/fixed32.jl | 6 ++++-- test/runtests.jl | 6 ++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/test/fixed32.jl b/test/fixed32.jl index 53cd0cfc..b90fa624 100644 --- a/test/fixed32.jl +++ b/test/fixed32.jl @@ -6,7 +6,7 @@ function test_fixed{T}(::Type{T}, f) tol = 2.0^-f for x in values - #isinteger(x) && @show x + isinteger(x) && @show x fx = convert(T,x) @test convert(T,convert(Float64, fx)) == fx @test convert(T,convert(Float64, -fx)) == -fx @@ -45,5 +45,7 @@ function test_fixed{T}(::Type{T}, f) end for f in [8, 10, 16] - test_fixed(Fixed32{f}, f) + T = Fixed32{f} + println(" Testing $T") + test_fixed(T, f) end diff --git a/test/runtests.jl b/test/runtests.jl index 9d58de39..ea09c13b 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -1,2 +1,4 @@ -include("fixed32.jl") -include("ufixed.jl") +for f in ["ufixed.jl", "fixed32.jl"] + println("Testing $f") + include(f) +end