From b1e0183538088a19d80dc25e947b7537368445b2 Mon Sep 17 00:00:00 2001 From: Spencer Russell Date: Thu, 16 Aug 2018 12:41:35 -0400 Subject: [PATCH] now testing on 0.6, 0.7, and 1.0 --- .travis.yml | 19 +++++++++++++++++-- appveyor.yml | 25 +++++++++++++++++++------ ci_setup.jl | 16 ++++++++++++++++ src/PortAudio.jl | 3 ++- test/runtests.jl | 6 +++++- 5 files changed, 59 insertions(+), 10 deletions(-) create mode 100644 ci_setup.jl diff --git a/.travis.yml b/.travis.yml index 8534eb7..aee8bdc 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,12 +3,27 @@ language: julia os: - linux - osx -sudo: required julia: - 0.6 + - 0.7 + - 1.0 - nightly +matrix: + allow_failures: + - julia: nightly + fast_finish: true +branches: + only: + master notifications: email: false script: - 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())' diff --git a/appveyor.yml b/appveyor.yml index 0570501..36a5f2b 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -1,8 +1,16 @@ environment: 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/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.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/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: - provider: Email @@ -10,6 +18,11 @@ notifications: on_build_failure: false on_build_status_changed: false +# only build master and PRs +branches: + only: + - master + install: - ps: "[System.Net.ServicePointManager]::SecurityProtocol = [System.Net.SecurityProtocolType]::Tls12" # Download most recent Julia Windows binary @@ -22,8 +35,8 @@ install: build_script: # Need to convert from shallow to complete for Pkg.clone to work - IF EXIST .git\shallow (git fetch --unshallow) - - C:\projects\julia\bin\julia -e "versioninfo(); - Pkg.clone(pwd(), \"PortAudio\"); Pkg.build(\"PortAudio\")" + - C:\projects\julia\bin\julia --color=yes ci_setup.jl 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 diff --git a/ci_setup.jl b/ci_setup.jl new file mode 100644 index 0000000..d8ffb39 --- /dev/null +++ b/ci_setup.jl @@ -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 diff --git a/src/PortAudio.jl b/src/PortAudio.jl index 29083cd..6560482 100644 --- a/src/PortAudio.jl +++ b/src/PortAudio.jl @@ -8,6 +8,7 @@ using Compat using Compat: undef, fetch, @compat using Compat.LinearAlgebra: transpose! using Compat: stdout +using Compat.Sys: iswindows import Base: eltype, show import Base: close, isopen @@ -374,7 +375,7 @@ function set_global_callbacks() end function suppress_err(dofunc::Function) - nullfile = @static Sys.iswindows() ? "nul" : "/dev/null" + nullfile = @static iswindows() ? "nul" : "/dev/null" open(nullfile, "w") do io redirect_stdout(dofunc, io) end diff --git a/test/runtests.jl b/test/runtests.jl index 750cc70..b7ad07c 100755 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -52,7 +52,11 @@ function test_callback(inchans, outchans, synced) write(sinkbuf, testout) # fill the output ringbuffer end # the process closure only has a pointer (not a ref) to sinkbuf - GC.@preserve sinkbuf begin + @static if VERSION >= v"0.7.0-" + GC.@preserve sinkbuf begin + @test process() == PortAudio.paContinue + end + else @test process() == PortAudio.paContinue end if outchans > 0