now testing on 0.6, 0.7, and 1.0

This commit is contained in:
Spencer Russell 2018-08-16 12:41:35 -04:00
parent f6213dc5ef
commit b1e0183538
5 changed files with 59 additions and 10 deletions

View file

@ -3,12 +3,27 @@ language: julia
os: os:
- linux - linux
- osx - osx
sudo: required
julia: julia:
- 0.6 - 0.6
- 0.7
- 1.0
- nightly - nightly
matrix:
allow_failures:
- julia: nightly
fast_finish: true
branches:
only:
master
notifications: notifications:
email: false email: false
script: script:
- if [[ -a .git/shallow ]]; then git fetch --unshallow; fi - if [[ -a .git/shallow ]]; then git fetch --unshallow; fi
- julia -e 'Pkg.clone(pwd()); Pkg.build("PortAudio"); Pkg.test("PortAudio")' - julia --color=yes ci_setup.jl
- julia --color=yes --code-coverage test/runtests.jl
after_success:
- julia -e 'VERSION >= v"0.7.0-" && using Pkg;
VERSION < v"0.7.0-" && cd(Pkg.dir("PortAudio"));
Pkg.add("Coverage");
using Coverage;
Codecov.submit(process_folder())'

View file

@ -2,7 +2,15 @@ environment:
matrix: matrix:
- JULIA_URL: "https://julialang-s3.julialang.org/bin/winnt/x86/0.6/julia-0.6-latest-win32.exe" - JULIA_URL: "https://julialang-s3.julialang.org/bin/winnt/x86/0.6/julia-0.6-latest-win32.exe"
- JULIA_URL: "https://julialang-s3.julialang.org/bin/winnt/x64/0.6/julia-0.6-latest-win64.exe" - JULIA_URL: "https://julialang-s3.julialang.org/bin/winnt/x64/0.6/julia-0.6-latest-win64.exe"
- JULIA_URL: "https://julialangnightlies-s3.julialang.org/bin/winnt/x64/julia-latest-win64.exe" - JULIA_URL: "https://julialang-s3.julialang.org/bin/winnt/x86/0.7/julia-0.7-latest-win32.exe"
- JULIA_URL: "https://julialang-s3.julialang.org/bin/winnt/x64/0.7/julia-0.7-latest-win64.exe"
- JULIA_URL: "https://julialang-s3.julialang.org/bin/winnt/x86/1.0/julia-1.0-latest-win32.exe"
- JULIA_URL: "https://julialang-s3.julialang.org/bin/winnt/x64/1.0/julia-1.0-latest-win64.exe"
matrix:
allow_failures:
# currently failing on 1.0 until https://github.com/JuliaLang/METADATA.jl/pull/16370 is merged
- JULIA_URL: "https://julialang-s3.julialang.org/bin/winnt/x64/1.0/julia-1.0-latest-win64.exe"
notifications: notifications:
- provider: Email - provider: Email
@ -10,6 +18,11 @@ notifications:
on_build_failure: false on_build_failure: false
on_build_status_changed: false on_build_status_changed: false
# only build master and PRs
branches:
only:
- master
install: install:
- ps: "[System.Net.ServicePointManager]::SecurityProtocol = [System.Net.SecurityProtocolType]::Tls12" - ps: "[System.Net.ServicePointManager]::SecurityProtocol = [System.Net.SecurityProtocolType]::Tls12"
# Download most recent Julia Windows binary # Download most recent Julia Windows binary
@ -22,8 +35,8 @@ install:
build_script: build_script:
# Need to convert from shallow to complete for Pkg.clone to work # Need to convert from shallow to complete for Pkg.clone to work
- IF EXIST .git\shallow (git fetch --unshallow) - IF EXIST .git\shallow (git fetch --unshallow)
- C:\projects\julia\bin\julia -e "versioninfo(); - C:\projects\julia\bin\julia --color=yes ci_setup.jl
Pkg.clone(pwd(), \"PortAudio\"); Pkg.build(\"PortAudio\")"
test_script: test_script:
- C:\projects\julia\bin\julia --check-bounds=yes -e "Pkg.test(\"PortAudio\")" # - C:\projects\julia\bin\julia --check-bounds=yes -e "Pkg.test(\"SampledSignals\")"
- C:\projects\julia\bin\julia --color=yes --code-coverage --check-bounds=yes test/runtests.jl

16
ci_setup.jl Normal file
View file

@ -0,0 +1,16 @@
VERSION >= v"0.7.0-" && using InteractiveUtils
versioninfo()
if VERSION < v"0.7.0-"
Pkg.clone(pwd(), "PortAudio")
Pkg.build("PortAudio")
# for now we need SampledSignals master
Pkg.checkout("SampledSignals")
else
using Pkg
# for now we need to `clone` because there's no way to specify the
# package name for `add`
Pkg.clone(pwd(), "PortAudio")
Pkg.build("PortAudio")
Pkg.add(PackageSpec(name="SampledSignals", rev="master"))
end

View file

@ -8,6 +8,7 @@ using Compat
using Compat: undef, fetch, @compat using Compat: undef, fetch, @compat
using Compat.LinearAlgebra: transpose! using Compat.LinearAlgebra: transpose!
using Compat: stdout using Compat: stdout
using Compat.Sys: iswindows
import Base: eltype, show import Base: eltype, show
import Base: close, isopen import Base: close, isopen
@ -374,7 +375,7 @@ function set_global_callbacks()
end end
function suppress_err(dofunc::Function) function suppress_err(dofunc::Function)
nullfile = @static Sys.iswindows() ? "nul" : "/dev/null" nullfile = @static iswindows() ? "nul" : "/dev/null"
open(nullfile, "w") do io open(nullfile, "w") do io
redirect_stdout(dofunc, io) redirect_stdout(dofunc, io)
end end

View file

@ -52,9 +52,13 @@ function test_callback(inchans, outchans, synced)
write(sinkbuf, testout) # fill the output ringbuffer write(sinkbuf, testout) # fill the output ringbuffer
end end
# the process closure only has a pointer (not a ref) to sinkbuf # the process closure only has a pointer (not a ref) to sinkbuf
@static if VERSION >= v"0.7.0-"
GC.@preserve sinkbuf begin GC.@preserve sinkbuf begin
@test process() == PortAudio.paContinue @test process() == PortAudio.paContinue
end end
else
@test process() == PortAudio.paContinue
end
if outchans > 0 if outchans > 0
# testout -> sinkbuf -> cb_output # testout -> sinkbuf -> cb_output
@test cb_output == testout @test cb_output == testout