tests/travis
This commit is contained in:
parent
fadf4a7c5f
commit
94e9362226
@ -10,4 +10,4 @@ notifications:
|
|||||||
# uncomment the following lines to override the default test script
|
# uncomment the following lines to override the default test script
|
||||||
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("Plots"); Pkg.add("Gadfly"); Pkg.clone("https://github.com/tbreloff/Qwt.jl.git"); Pkg.test("Plots"; coverage=true)'
|
- julia -e 'Pkg.clone(pwd()); Pkg.build("Plots"); Pkg.add("Gadfly"); Pkg.test("Plots"; coverage=true)'
|
||||||
|
|||||||
@ -3,26 +3,23 @@ module PlotsTests
|
|||||||
using Plots
|
using Plots
|
||||||
using FactCheck
|
using FactCheck
|
||||||
|
|
||||||
|
# don't actually show the plots
|
||||||
|
plotDefault!(:show, false)
|
||||||
|
|
||||||
facts("Qwt") do
|
|
||||||
plotDefault!(:show, false)
|
|
||||||
|
|
||||||
@fact plotter!(:qwt) --> Plots.QwtPackage()
|
# note: we wrap in a try block so that the tests only run if we have the backend installed
|
||||||
@fact plotter() --> Plots.QwtPackage()
|
try
|
||||||
|
Pkg.installed("Gadfly")
|
||||||
|
facts("Gadfly") do
|
||||||
|
@fact plotter!(:gadfly) --> Plots.GadflyPackage()
|
||||||
|
@fact plotter() --> Plots.GadflyPackage()
|
||||||
@fact typeof(plot(1:10)) --> Plot
|
@fact typeof(plot(1:10)) --> Plot
|
||||||
|
|
||||||
# plot(y::AVec; kw...) # one line... x = 1:length(y)
|
|
||||||
@fact plot(1:10) --> not(nothing)
|
|
||||||
@fact length(currentPlot().o.lines) --> 1
|
|
||||||
|
|
||||||
# plot(x::AVec, y::AVec; kw...) # one line (will assert length(x) == length(y))
|
# plot(x::AVec, y::AVec; kw...) # one line (will assert length(x) == length(y))
|
||||||
@fact plot(Int[1,2,3], rand(3)) --> not(nothing)
|
@fact plot(Int[1,2,3], rand(3)) --> not(nothing)
|
||||||
@fact_throws plot(1:5, 1:4)
|
@fact_throws plot(1:5, 1:4)
|
||||||
|
|
||||||
# plot(y::AMat; kw...) # multiple lines (one per column of x), all sharing x = 1:size(y,1)
|
|
||||||
@fact plot!(rand(10,2)) --> not(nothing)
|
|
||||||
@fact length(currentPlot().o.lines) --> 3
|
|
||||||
|
|
||||||
# plot(x::AVec, y::AMat; kw...) # multiple lines (one per column of x), all sharing x (will assert length(x) == size(y,1))
|
# plot(x::AVec, y::AMat; kw...) # multiple lines (one per column of x), all sharing x (will assert length(x) == size(y,1))
|
||||||
@fact plot(sort(rand(10)), rand(Int, 10, 3)) --> not(nothing)
|
@fact plot(sort(rand(10)), rand(Int, 10, 3)) --> not(nothing)
|
||||||
@fact_throws(plot!(rand(10), rand(9,2)))
|
@fact_throws(plot!(rand(10), rand(9,2)))
|
||||||
@ -31,6 +28,27 @@ facts("Qwt") do
|
|||||||
@fact plot!(rand(10,3), rand(10,3)) --> not(nothing)
|
@fact plot!(rand(10,3), rand(10,3)) --> not(nothing)
|
||||||
@fact_throws plot!(rand(10,3), rand(10,2))
|
@fact_throws plot!(rand(10,3), rand(10,2))
|
||||||
|
|
||||||
|
|
||||||
|
# plot(x::AVec, y::AVec{AVec}; kw...) # multiple lines, will assert length(x) == length(y[i])
|
||||||
|
|
||||||
|
|
||||||
|
# plot(x::AVec{AVec}, y::AVec{AVec}; kw...) # multiple lines, will assert length(x[i]) == length(y[i])
|
||||||
|
# plot(n::Integer; kw...) # n lines, all empty (for updating plots)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
# note: we wrap in a try block so that the tests only run if we have the backend installed
|
||||||
|
try
|
||||||
|
Pkg.installed("Qwt")
|
||||||
|
facts("Qwt") do
|
||||||
|
@fact plotter!(:qwt) --> Plots.QwtPackage()
|
||||||
|
@fact plotter() --> Plots.QwtPackage()
|
||||||
|
@fact typeof(plot(1:10)) --> Plot
|
||||||
|
|
||||||
|
# plot(y::AVec; kw...) # one line... x = 1:length(y)
|
||||||
|
@fact plot(1:10) --> not(nothing)
|
||||||
|
@fact length(currentPlot().o.lines) --> 1
|
||||||
|
|
||||||
# plot(x::AVec, f::Function; kw...) # one line, y = f(x)
|
# plot(x::AVec, f::Function; kw...) # one line, y = f(x)
|
||||||
@fact plot(1:10, sin) --> not(nothing)
|
@fact plot(1:10, sin) --> not(nothing)
|
||||||
@fact currentPlot().o.lines[1].y --> sin(collect(1:10))
|
@fact currentPlot().o.lines[1].y --> sin(collect(1:10))
|
||||||
@ -39,6 +57,10 @@ facts("Qwt") do
|
|||||||
@fact plot(rand(10,2), sin) --> not(nothing)
|
@fact plot(rand(10,2), sin) --> not(nothing)
|
||||||
@fact length(currentPlot().o.lines) --> 2
|
@fact length(currentPlot().o.lines) --> 2
|
||||||
|
|
||||||
|
# plot(y::AMat; kw...) # multiple lines (one per column of x), all sharing x = 1:size(y,1)
|
||||||
|
@fact plot!(rand(10,2)) --> not(nothing)
|
||||||
|
@fact length(currentPlot().o.lines) --> 4
|
||||||
|
|
||||||
# plot(x::AVec, fs::AVec{Function}; kw...) # multiple lines, yᵢⱼ = fⱼ(xᵢ)
|
# plot(x::AVec, fs::AVec{Function}; kw...) # multiple lines, yᵢⱼ = fⱼ(xᵢ)
|
||||||
@fact plot(1:10, Function[sin,cos]) --> not(nothing)
|
@fact plot(1:10, Function[sin,cos]) --> not(nothing)
|
||||||
@fact currentPlot().o.lines[1].y --> sin(collect(1:10))
|
@fact currentPlot().o.lines[1].y --> sin(collect(1:10))
|
||||||
@ -48,19 +70,9 @@ facts("Qwt") do
|
|||||||
@fact plot([11:20 ; rand(10)]) --> not(nothing)
|
@fact plot([11:20 ; rand(10)]) --> not(nothing)
|
||||||
@fact currentPlot().o.lines[1].x[4] --> 4
|
@fact currentPlot().o.lines[1].x[4] --> 4
|
||||||
@fact currentPlot().o.lines[1].y[4] --> 14
|
@fact currentPlot().o.lines[1].y[4] --> 14
|
||||||
|
end
|
||||||
# plot(x::AVec, y::AVec{AVec}; kw...) # multiple lines, will assert length(x) == length(y[i])
|
|
||||||
|
|
||||||
|
|
||||||
# plot(x::AVec{AVec}, y::AVec{AVec}; kw...) # multiple lines, will assert length(x[i]) == length(y[i])
|
|
||||||
# plot(n::Integer; kw...) # n lines, all empty (for updating plots)
|
|
||||||
end
|
end
|
||||||
|
|
||||||
facts("Gadfly") do
|
|
||||||
@fact plotter!(:gadfly) --> Plots.GadflyPackage()
|
|
||||||
@fact plotter() --> Plots.GadflyPackage()
|
|
||||||
@fact typeof(plot(1:10)) --> Plot
|
|
||||||
end
|
|
||||||
|
|
||||||
FactCheck.exitstatus()
|
FactCheck.exitstatus()
|
||||||
end # module
|
end # module
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user