From 4b16b6806bb5979c4d6b503e97e93ee530f3af5d Mon Sep 17 00:00:00 2001 From: morris25 Date: Thu, 19 Apr 2018 17:16:38 -0500 Subject: [PATCH 1/3] Adds Appveyor script --- .appveyor.yml | 45 +++++++++++++++++++++++++++++++++++++++++++++ README.md | 1 + 2 files changed, 46 insertions(+) create mode 100644 .appveyor.yml diff --git a/.appveyor.yml b/.appveyor.yml new file mode 100644 index 0000000..1000bed --- /dev/null +++ b/.appveyor.yml @@ -0,0 +1,45 @@ +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/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://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 + +install: + - ps: "[System.Net.ServicePointManager]::SecurityProtocol = [System.Net.SecurityProtocolType]::Tls12" +# If there's a newer build queued for the same PR, cancel this one + - ps: if ($env:APPVEYOR_PULL_REQUEST_NUMBER -and $env:APPVEYOR_BUILD_NUMBER -ne ((Invoke-RestMethod ` + https://ci.appveyor.com/api/projects/$env:APPVEYOR_ACCOUNT_NAME/$env:APPVEYOR_PROJECT_SLUG/history?recordsNumber=50).builds | ` + Where-Object pullRequestId -eq $env:APPVEYOR_PULL_REQUEST_NUMBER)[0].buildNumber) { ` + throw "There are newer queued builds for this pull request, failing early." } +# Download most recent Julia Windows binary + - 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(), \"NamedTuples\"); Pkg.build(\"NamedTuples\")" + +test_script: +- C:\projects\julia\bin\julia -e "Pkg.test(\"NamedTuples\")" \ No newline at end of file diff --git a/README.md b/README.md index aafb87c..bcf481c 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,5 @@ [![Build Status](https://travis-ci.org/JuliaData/NamedTuples.jl.svg?branch=master)](https://travis-ci.org/JuliaData/NamedTuples.jl) +[![Build Status](https://ci.appveyor.com/api/projects/status/github/JuliaData/NamedTuples.jl?svg=true)](https://ci.appveyor.com/project/quinnj/namedtuples-jl) # NamedTuples From 7ec9e0343227adb82abae05fd5641538557f1a3b Mon Sep 17 00:00:00 2001 From: Curtis Vogt Date: Wed, 25 Apr 2018 15:22:28 -0500 Subject: [PATCH 2/3] Fix hash on 32-bit systems --- src/NamedTuples.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/NamedTuples.jl b/src/NamedTuples.jl index f8a3e52..61aab44 100644 --- a/src/NamedTuples.jl +++ b/src/NamedTuples.jl @@ -50,7 +50,7 @@ import Base: == end # Deep hash -@generated function Base.hash(nt::NamedTuple, hs::UInt64) +@generated function Base.hash(nt::NamedTuple, hs::UInt) q = quote h = 17 end From eaf57db5be2e0d2bb21f7d2f0f0b0e2a71d5bcdf Mon Sep 17 00:00:00 2001 From: Curtis Vogt Date: Wed, 25 Apr 2018 15:28:52 -0500 Subject: [PATCH 3/3] Fix invalid test on 32-bit systems --- README.md | 2 +- test/runtests.jl | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index bcf481c..e279065 100644 --- a/README.md +++ b/README.md @@ -42,7 +42,7 @@ Test.bar( @NT( a= 2, c="hello")) # Returns `hellohello` There is at most one instance of a NamedTuple type with a given set of Members and Types, hence ```julia -typeof( @NT( a::Int64, b::Float64 )(1, 3.0) ) == typeof( @NT( a = 1, b = 2.0 )) +typeof( @NT( a::Int, b::Float64 )(1, 3.0) ) == typeof( @NT( a = 1, b = 2.0 )) ``` NamedTuple definitions are shared across all modules. The underlying immutable types are constructed at first use. diff --git a/test/runtests.jl b/test/runtests.jl index 7743853..d16d80f 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -28,7 +28,7 @@ using Base.Test @test @NT(a::Int, b) == @NT(a::Int, b::Any) -@test typeof( @NT( a::Int64, b::Float64 )(1, 3.0) ) == typeof( @NT( a = 1, b = 2.0 )) +@test typeof( @NT( a::Int, b::Float64 )(1, 3.0) ) == typeof( @NT( a = 1, b = 2.0 )) # Syntax tests, including anon named tuples @test @NT( a, b ) <: NamedTuple