Skip to content

Commit

Permalink
Merge remote-tracking branch 'abelsiqueria/update-0.7'
Browse files Browse the repository at this point in the history
  • Loading branch information
c42f committed Oct 1, 2018
2 parents 12635d5 + 7e9f398 commit c4c8cf2
Show file tree
Hide file tree
Showing 4 changed files with 53 additions and 23 deletions.
9 changes: 6 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,12 @@ os:
- osx
julia:
- 0.6
- 0.7
- 1.0
- nightly
matrix:
allow_failures:
- julia: nightly
notifications:
email: false
branches:
Expand All @@ -17,6 +22,4 @@ branches:
# - julia -e 'Pkg.clone(pwd()); Pkg.build("FastClosures"); Pkg.test("FastClosures"; coverage=true)'
after_success:
# push coverage results to Coveralls
- julia -e 'cd(Pkg.dir("FastClosures")); Pkg.add("Coverage"); using Coverage; Coveralls.submit(Coveralls.process_folder())'
# push coverage results to Codecov
- julia -e 'cd(Pkg.dir("FastClosures")); Pkg.add("Coverage"); using Coverage; Codecov.submit(Codecov.process_folder())'
- julia -e 'VERSION >= 0.7 && using Pkg; cd(Pkg.dir("FastClosures")); Pkg.add("Coverage"); using Coverage; Coveralls.submit(Coveralls.process_folder()); Codecov.submit(Codecov.process_folder())'
4 changes: 2 additions & 2 deletions REQUIRE
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
julia 0.6
Compat 0.26.0
julia 0.6 2.0
Compat 0.33.0
39 changes: 25 additions & 14 deletions appveyor.yml
Original file line number Diff line number Diff line change
@@ -1,34 +1,45 @@
environment:
matrix:
- JULIAVERSION: "julialang/bin/winnt/x86/0.5/julia-0.5-latest-win32.exe"
- JULIAVERSION: "julialang/bin/winnt/x64/0.5/julia-0.5-latest-win64.exe"
- JULIAVERSION: "julianightlies/bin/winnt/x86/julia-latest-win32.exe"
- JULIAVERSION: "julianightlies/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"
- JULIA_URL: "https://julialangnightlies-s3.julialang.org/bin/winnt/x86/julia-latest-win32.exe"
- JULIA_URL: "https://julialangnightlies-s3.julialang.org/bin/winnt/x64/julia-latest-win64.exe"

branches:
only:
- master
- /release-.*/
matrix:
allow_failures:
- 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"
- JULIA_URL: "https://julialangnightlies-s3.julialang.org/bin/winnt/x86/julia-latest-win32.exe"
- JULIA_URL: "https://julialangnightlies-s3.julialang.org/bin/winnt/x64/julia-latest-win64.exe"

notifications:
- provider: Email
on_build_success: false
on_build_failure: false
on_build_status_changed: false

branches:
only:
- master

skip_branch_with_pr: true

install:
- ps: "[System.Net.ServicePointManager]::SecurityProtocol = [System.Net.SecurityProtocolType]::Tls12"
# Download most recent Julia Windows binary
- ps: (new-object net.webclient).DownloadFile(
$("http://s3.amazonaws.com/"+$env:JULIAVERSION),
"C:\projects\julia-binary.exe")
- ps: (new-object net.webclient).DownloadFile($env:JULIA_URL, "C:\projects\julia-binary.exe")
# Run installer silently, output to C:\projects\julia
- C:\projects\julia-binary.exe /S /D=C:\projects\julia

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(), \"FastClosures\"); Pkg.build(\"FastClosures\")"
- C:\projects\julia\bin\julia -e "VERSION >= 0.7 && using InteractiveUtils; versioninfo();
using Pkg; Pkg.clone(pwd(), \"FastClosures\");"

test_script:
- C:\projects\julia\bin\julia -e "Pkg.test(\"FastClosures\")"
- C:\projects\julia\bin\julia -e "using Pkg; Pkg.test(\"FastClosures\")"
24 changes: 20 additions & 4 deletions test/runtests.jl
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using FastClosures
using Base.Test
using FastClosures, Compat, Compat.Test

# Test utility wrapping find_var_uses!
function find_var_uses(ex)
Expand All @@ -9,6 +8,23 @@ function find_var_uses(ex)
Symbol[v.name for v in vars]
end

# Check that a particular error occurs during macro invocation. In 0.7 / 1.0
# this is wrapped in a LoadError, so unwrap that before rethrowing. See also
# https://discourse.julialang.org/t/exceptions-in-macros-in-julia-0-7-1-0/14145/2
macro test_macro_throws(typ, expr)
quote
@test_throws $typ begin
try
$(esc(expr))
catch e
while e isa LoadError
e = e.error
end
rethrow(e)
end
end
end
end

# code_warntype issues
function f1()
Expand Down Expand Up @@ -52,10 +68,10 @@ end
end
blah(1,2,3)
end === 1.5
@test_throws ArgumentError @eval(@closure(1+2))
@test_macro_throws ArgumentError @eval(@closure(1+2))
# Test that when macroexpand() fails inside the @closure macro, the correct
# error is generated
@test_throws UndefVarError @eval(@closure () -> @nonexistent_macro)
@test_macro_throws UndefVarError @eval(@closure () -> @nonexistent_macro)
end

@testset "@closure use inside a macro" begin
Expand Down

0 comments on commit c4c8cf2

Please sign in to comment.