diff --git a/Project.toml b/Project.toml index 0a2c047..46a710b 100644 --- a/Project.toml +++ b/Project.toml @@ -26,11 +26,10 @@ YAML = "0.3, 0.4" julia = "1.2" [extras] -Cairo = "159f3aea-2a34-519c-b102-8c37f9878175" DataFrames = "a93c6f00-e57d-5684-b7b6-d8193f3e46c0" Gadfly = "c91e804a-d5a3-530f-b6f0-dfbca275c004" Plots = "91a5bcdd-55d7-5caf-9e0b-520d859cae80" Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40" [targets] -test = ["Cairo", "DataFrames", "Gadfly", "Plots", "Test"] +test = ["DataFrames", "Test"] diff --git a/test/documents/gadfly/gadfly_formats_test.md.js.svg.pandoc b/test/documents/gadfly/gadfly_formats_test.md.js.svg.pandoc deleted file mode 100644 index 14351fb..0000000 --- a/test/documents/gadfly/gadfly_formats_test.md.js.svg.pandoc +++ /dev/null @@ -1,18 +0,0 @@ -~~~~{.julia} -using Gadfly -x = range(0, stop =2π, step=0.05) -plot(x=x, y = sin.(x), Geom.line) -~~~~~~~~~~~~~ - - -![sin(x) function.](figures/gadfly_formats_test_sin_fun_1.js.svg){#fig:sin_fun} - -![cos(x) function.](figures/gadfly_formats_test_2_1.js.svg) - -~~~~{.julia} -plot(x=x, y = cos.(2x), Geom.line) -~~~~~~~~~~~~~ - - -![](figures/gadfly_formats_test_cos2_fun_1.js.svg){width=15cm #fig:cos2_fun}\ - diff --git a/test/documents/gadfly/gadfly_formats_test.md.pdf.github b/test/documents/gadfly/gadfly_formats_test.md.pdf.github deleted file mode 100644 index f46ade6..0000000 --- a/test/documents/gadfly/gadfly_formats_test.md.pdf.github +++ /dev/null @@ -1,17 +0,0 @@ -````julia -using Gadfly -x = range(0, stop =2π, step=0.05) -plot(x=x, y = sin.(x), Geom.line) -```` - - -![sin(x) function.](figures/gadfly_formats_test_sin_fun_1.pdf) - -![cos(x) function.](figures/gadfly_formats_test_2_1.pdf) - -````julia -plot(x=x, y = cos.(2x), Geom.line) -```` - - -![](figures/gadfly_formats_test_cos2_fun_1.pdf) diff --git a/test/documents/gadfly/gadfly_formats_test.md.png.github b/test/documents/gadfly/gadfly_formats_test.md.png.github deleted file mode 100644 index 2514e62..0000000 --- a/test/documents/gadfly/gadfly_formats_test.md.png.github +++ /dev/null @@ -1,17 +0,0 @@ -````julia -using Gadfly -x = range(0, stop =2π, step=0.05) -plot(x=x, y = sin.(x), Geom.line) -```` - - -![sin(x) function.](figures/gadfly_formats_test_sin_fun_1.png) - -![cos(x) function.](figures/gadfly_formats_test_2_1.png) - -````julia -plot(x=x, y = cos.(2x), Geom.line) -```` - - -![](figures/gadfly_formats_test_cos2_fun_1.png) diff --git a/test/documents/gadfly/gadfly_formats_test.md.png.pandoc b/test/documents/gadfly/gadfly_formats_test.md.png.pandoc deleted file mode 100644 index cb33b5b..0000000 --- a/test/documents/gadfly/gadfly_formats_test.md.png.pandoc +++ /dev/null @@ -1,18 +0,0 @@ -~~~~{.julia} -using Gadfly -x = range(0, stop =2π, step=0.05) -plot(x=x, y = sin.(x), Geom.line) -~~~~~~~~~~~~~ - - -![sin(x) function.](figures/gadfly_formats_test_sin_fun_1.png){#fig:sin_fun} - -![cos(x) function.](figures/gadfly_formats_test_2_1.png) - -~~~~{.julia} -plot(x=x, y = cos.(2x), Geom.line) -~~~~~~~~~~~~~ - - -![](figures/gadfly_formats_test_cos2_fun_1.png){width=15cm #fig:cos2_fun}\ - diff --git a/test/documents/gadfly/gadfly_formats_test.md.svg.github b/test/documents/gadfly/gadfly_formats_test.md.svg.github deleted file mode 100644 index 0f11e89..0000000 --- a/test/documents/gadfly/gadfly_formats_test.md.svg.github +++ /dev/null @@ -1,17 +0,0 @@ -````julia -using Gadfly -x = range(0, stop =2π, step=0.05) -plot(x=x, y = sin.(x), Geom.line) -```` - - -![sin(x) function.](figures/gadfly_formats_test_sin_fun_1.svg) - -![cos(x) function.](figures/gadfly_formats_test_2_1.svg) - -````julia -plot(x=x, y = cos.(2x), Geom.line) -```` - - -![](figures/gadfly_formats_test_cos2_fun_1.svg) diff --git a/test/documents/gadfly/gadfly_formats_test.tex.pdf.tex b/test/documents/gadfly/gadfly_formats_test.tex.pdf.tex deleted file mode 100644 index d4729e0..0000000 --- a/test/documents/gadfly/gadfly_formats_test.tex.pdf.tex +++ /dev/null @@ -1,22 +0,0 @@ -\begin{juliacode} -using Gadfly -x = range(0, stop =2π, step=0.05) -plot(x=x, y = sin.(x), Geom.line) -\end{juliacode} -\begin{figure}[ht] -\center -\includegraphics[width=\linewidth]{figures/gadfly_formats_test_sin_fun_1.pdf} -\caption{sin(x) function.} -\label{fig:sin_fun} -\end{figure} - -\begin{figure}[htpb] -\center -\includegraphics[width=\linewidth]{figures/gadfly_formats_test_2_1.pdf} -\caption{cos(x) function.} -\end{figure} - -\begin{juliacode} -plot(x=x, y = cos.(2x), Geom.line) -\end{juliacode} -\includegraphics[width=15cm]{figures/gadfly_formats_test_cos2_fun_1.pdf} diff --git a/test/documents/gadfly/gadfly_formats_test.tex.png.tex b/test/documents/gadfly/gadfly_formats_test.tex.png.tex deleted file mode 100644 index ed629ad..0000000 --- a/test/documents/gadfly/gadfly_formats_test.tex.png.tex +++ /dev/null @@ -1,22 +0,0 @@ -\begin{juliacode} -using Gadfly -x = range(0, stop =2π, step=0.05) -plot(x=x, y = sin.(x), Geom.line) -\end{juliacode} -\begin{figure}[ht] -\center -\includegraphics[width=\linewidth]{figures/gadfly_formats_test_sin_fun_1.png} -\caption{sin(x) function.} -\label{fig:sin_fun} -\end{figure} - -\begin{figure}[htpb] -\center -\includegraphics[width=\linewidth]{figures/gadfly_formats_test_2_1.png} -\caption{cos(x) function.} -\end{figure} - -\begin{juliacode} -plot(x=x, y = cos.(2x), Geom.line) -\end{juliacode} -\includegraphics[width=15cm]{figures/gadfly_formats_test_cos2_fun_1.png} diff --git a/test/documents/gadfly/gadfly_formats_test.tex.ps.tex b/test/documents/gadfly/gadfly_formats_test.tex.ps.tex deleted file mode 100644 index 8a5b5b1..0000000 --- a/test/documents/gadfly/gadfly_formats_test.tex.ps.tex +++ /dev/null @@ -1,22 +0,0 @@ -\begin{juliacode} -using Gadfly -x = range(0, stop =2π, step=0.05) -plot(x=x, y = sin.(x), Geom.line) -\end{juliacode} -\begin{figure}[ht] -\center -\includegraphics[width=\linewidth]{figures/gadfly_formats_test_sin_fun_1.ps} -\caption{sin(x) function.} -\label{fig:sin_fun} -\end{figure} - -\begin{figure}[htpb] -\center -\includegraphics[width=\linewidth]{figures/gadfly_formats_test_2_1.ps} -\caption{cos(x) function.} -\end{figure} - -\begin{juliacode} -plot(x=x, y = cos.(2x), Geom.line) -\end{juliacode} -\includegraphics[width=15cm]{figures/gadfly_formats_test_cos2_fun_1.ps} diff --git a/test/documents/gadfly/gadfly_formats_test.tex.tex.tex b/test/documents/gadfly/gadfly_formats_test.tex.tex.tex deleted file mode 100644 index 4989cb7..0000000 --- a/test/documents/gadfly/gadfly_formats_test.tex.tex.tex +++ /dev/null @@ -1,22 +0,0 @@ -\begin{juliacode} -using Gadfly -x = range(0, stop =2π, step=0.05) -plot(x=x, y = sin.(x), Geom.line) -\end{juliacode} -\begin{figure}[ht] -\center -\resizebox{\linewidth}{!}{\input{figures/gadfly_formats_test_sin_fun_1.tex}} -\caption{sin(x) function.} -\label{fig:sin_fun} -\end{figure} - -\begin{figure}[htpb] -\center -\resizebox{\linewidth}{!}{\input{figures/gadfly_formats_test_2_1.tex}} -\caption{cos(x) function.} -\end{figure} - -\begin{juliacode} -plot(x=x, y = cos.(2x), Geom.line) -\end{juliacode} -\resizebox{15cm}{!}{\input{figures/gadfly_formats_test_cos2_fun_1.tex}} diff --git a/test/documents/gadfly_formats_test.jnw b/test/documents/gadfly_formats_test.jnw deleted file mode 100644 index 8691c2a..0000000 --- a/test/documents/gadfly_formats_test.jnw +++ /dev/null @@ -1,19 +0,0 @@ ---- -weave_options: - out_path: gadfly ---- - -<>= -using Gadfly -x = range(0, stop =2π, step=0.05) -plot(x=x, y = sin.(x), Geom.line) -@ - - -<>= -plot(x=x, y = cos.(x), Geom.line) -@ - -<>= -plot(x=x, y = cos.(2x), Geom.line) -@ diff --git a/test/documents/gadfly_markdown_test.jmd b/test/documents/gadfly_markdown_test.jmd deleted file mode 100644 index 1ab3741..0000000 --- a/test/documents/gadfly_markdown_test.jmd +++ /dev/null @@ -1,12 +0,0 @@ - -# Gadfly - -```{julia;fig_ext=".svg";dpi=300} -using Gadfly -x = collect(range(0, stop=2π, length=200)) -plot( - layer(x=x, y = sin.(x), Geom.line), - layer(x=x, y = cos.(x), Geom.line, Theme(default_color=colorant"red")), - Guide.manual_color_key("Legend", ["sin", "cos"], ["deepskyblue", "red"]) -) -``` \ No newline at end of file diff --git a/test/documents/inline/markdown_beamer.html.ref b/test/documents/inline/markdown_beamer.html.ref deleted file mode 100644 index 6cfa31c..0000000 --- a/test/documents/inline/markdown_beamer.html.ref +++ /dev/null @@ -1,22 +0,0 @@ - - - -
- -

Some inline output

- - -
-println("Testing output")
-
- - -
-Testing output
-
- - - - -
- diff --git a/test/documents/inline/markdown_beamer.tex.ref b/test/documents/inline/markdown_beamer.tex.ref deleted file mode 100644 index f3bc53d..0000000 --- a/test/documents/inline/markdown_beamer.tex.ref +++ /dev/null @@ -1,22 +0,0 @@ - - - -\begin{frame}[fragile] -\frametitle{Random plot} - -Some inline output - - -\begin{lstlisting} -(*@\HLJLnf{println}@*)(*@\HLJLp{(}@*)(*@\HLJLs{"{}Testing}@*) (*@\HLJLs{output"{}}@*)(*@\HLJLp{)}@*) -\end{lstlisting} - -\begin{lstlisting} -Testing output -\end{lstlisting} - - - - -\end{frame} - diff --git a/test/documents/plotsjl/plotsjl_test.jl b/test/documents/plotsjl/plotsjl_test.jl deleted file mode 100644 index d5db5e2..0000000 --- a/test/documents/plotsjl/plotsjl_test.jl +++ /dev/null @@ -1,16 +0,0 @@ - -using Plots -pyplot() -x = range(0, stop=2*pi, length=50) -println(x) -p = plot(x = x, y = sin(x), size =(900,300)) - -plot(x = x, y = sin(x)) - -plot(rand(100) / 3,reg=true,fill=(0,:green)) -scatter!(rand(100),markersize=6,c=:orange) - -plot(rand(100) / 3,reg=true,fill=(0,:green)) -scatter!(rand(100),markersize=6,c=:orange) - -plot(y = cumsum(randn(1000, 1))) diff --git a/test/documents/plotsjl/plotsjl_test.md.ref b/test/documents/plotsjl/plotsjl_test.md.ref deleted file mode 100644 index d9a16a5..0000000 --- a/test/documents/plotsjl/plotsjl_test.md.ref +++ /dev/null @@ -1,60 +0,0 @@ -~~~~{.julia} -using Plots -pyplot() -x = linspace(0, 2*pi) -println(x) -~~~~~~~~~~~~~ - - -~~~~ -linspace(0.0,6.283185307179586,50) -~~~~ - - - -~~~~{.julia} -p = plot(x, sin(x), size =(900,300)) -~~~~~~~~~~~~~ - - - -~~~~{.julia} -julia> plot(x, sin(x)) - - -~~~~~~~~~~~~~ - - -![](figures/plotsjl_test_2_1.png)\ - - -~~~~{.julia} -plot(rand(100) / 3,reg=true,fill=(0,:green)) -scatter!(rand(100),markersize=6,c=:orange) -~~~~~~~~~~~~~ - - -![](figures/plotsjl_test_3_1.png)\ - - -~~~~{.julia} -julia> plot(rand(100) / 3,reg=true,fill=(0,:green)) - - -~~~~~~~~~~~~~ - - -![](figures/plotsjl_test_4_1.png)\ - - -~~~~{.julia} -julia> scatter!(rand(100),markersize=6,c=:orange) - - -~~~~~~~~~~~~~ - - -![](figures/plotsjl_test_4_2.png)\ - - -![A random walk.](figures/plotsjl_test_random_1.png) diff --git a/test/documents/plotsjl/plotsjl_test.tex.ref b/test/documents/plotsjl/plotsjl_test.tex.ref deleted file mode 100644 index f838604..0000000 --- a/test/documents/plotsjl/plotsjl_test.tex.ref +++ /dev/null @@ -1,47 +0,0 @@ -\begin{juliacode} -using Plots -pyplot() -x = linspace(0, 2*pi) -println(x) -\end{juliacode} -\begin{juliaout} -linspace(0.0,6.283185307179586,50) -\end{juliaout} - -\begin{juliacode} -p = plot(x, sin(x), size =(900,300)) -\end{juliacode} - -\begin{juliaterm} -julia> plot(x, sin(x)) - - -\end{juliaterm} -\includegraphics[width=\linewidth]{figures/plotsjl_test_2_1.pdf} - -\begin{juliacode} -plot(rand(100) / 3,reg=true,fill=(0,:green)) -scatter!(rand(100),markersize=6,c=:orange) -\end{juliacode} -\includegraphics[width=\linewidth]{figures/plotsjl_test_3_1.pdf} - -\begin{juliaterm} -julia> plot(rand(100) / 3,reg=true,fill=(0,:green)) - - -\end{juliaterm} -\includegraphics[width=\linewidth]{figures/plotsjl_test_4_1.pdf} - -\begin{juliaterm} -julia> scatter!(rand(100),markersize=6,c=:orange) - - -\end{juliaterm} -\includegraphics[width=\linewidth]{figures/plotsjl_test_4_2.pdf} - -\begin{figure}[htpb] -\center -\includegraphics[width=\linewidth]{figures/plotsjl_test_random_1.pdf} -\caption{A random walk.} -\label{fig:random} -\end{figure} diff --git a/test/documents/plotsjl/plotsjl_test_gr.md.ref b/test/documents/plotsjl/plotsjl_test_gr.md.ref deleted file mode 100644 index 1ae8320..0000000 --- a/test/documents/plotsjl/plotsjl_test_gr.md.ref +++ /dev/null @@ -1,41 +0,0 @@ -~~~~{.julia} -using Plots -gr() -x = range(0, stop=2π, length=50) -println(x) -~~~~~~~~~~~~~ - - -~~~~ -0.0:0.1282282715750936:6.283185307179586 -~~~~ - - - -~~~~{.julia} -p = plot(x, sin.(x), size =(900,300)) -p -~~~~~~~~~~~~~ - - -![](figures/plotsjl_test_gr_1_1.png)\ - - -~~~~{.julia} -plot(x, sin.(x)) -~~~~~~~~~~~~~ - - -![](figures/plotsjl_test_gr_2_1.png)\ - - -~~~~{.julia} -plot(rand(100) / 3,reg=true,fill=(0,:green)) -scatter!(rand(100),markersize=6,c=:orange) -~~~~~~~~~~~~~ - - -![](figures/plotsjl_test_gr_3_1.png)\ - - -![A random walk.](figures/plotsjl_test_gr_random_1.png){#fig:random} diff --git a/test/documents/plotsjl/plotsjl_test_gr.tex.ref b/test/documents/plotsjl/plotsjl_test_gr.tex.ref deleted file mode 100644 index 9705a33..0000000 --- a/test/documents/plotsjl/plotsjl_test_gr.tex.ref +++ /dev/null @@ -1,33 +0,0 @@ -\begin{juliacode} -using Plots -gr() -x = range(0, stop=2π, length=50) -println(x) -\end{juliacode} -\begin{juliaout} -0.0:0.1282282715750936:6.283185307179586 -\end{juliaout} - -\begin{juliacode} -p = plot(x, sin.(x), size =(900,300)) -p -\end{juliacode} -\includegraphics[width=\linewidth]{figures/plotsjl_test_gr_1_1.pdf} - -\begin{juliacode} -plot(x, sin.(x)) -\end{juliacode} -\includegraphics[width=\linewidth]{figures/plotsjl_test_gr_2_1.pdf} - -\begin{juliacode} -plot(rand(100) / 3,reg=true,fill=(0,:green)) -scatter!(rand(100),markersize=6,c=:orange) -\end{juliacode} -\includegraphics[width=\linewidth]{figures/plotsjl_test_gr_3_1.pdf} - -\begin{figure}[htpb] -\center -\includegraphics[width=\linewidth]{figures/plotsjl_test_gr_random_1.pdf} -\caption{A random walk.} -\label{fig:random} -\end{figure} diff --git a/test/documents/plotsjl_test.jmd b/test/documents/plotsjl_test.jmd deleted file mode 100644 index 04bfd80..0000000 --- a/test/documents/plotsjl_test.jmd +++ /dev/null @@ -1,29 +0,0 @@ - - -```julia -using Plots -pyplot() -x = linspace(0, 2*pi) -println(x) -p = plot(x, sin(x), size =(900,300)) -``` - - -```julia; term=true -plot(x, sin(x)) -``` - -```julia -plot(rand(100) / 3,reg=true,fill=(0,:green)) -scatter!(rand(100),markersize=6,c=:orange) -``` - -```julia; term=true -plot(rand(100) / 3,reg=true,fill=(0,:green)) -scatter!(rand(100),markersize=6,c=:orange) -``` - - -```{julia;echo=false; fig_cap="A random walk."; label="random"} -plot(cumsum(randn(1000, 1))) -``` diff --git a/test/documents/plotsjl_test_gr.jmd b/test/documents/plotsjl_test_gr.jmd deleted file mode 100644 index 77a3396..0000000 --- a/test/documents/plotsjl_test_gr.jmd +++ /dev/null @@ -1,25 +0,0 @@ - - -```julia -using Plots -gr() -x = range(0, stop=2π, length=50) -println(x) -p = plot(x, sin.(x), size =(900,300)) -p -``` - - -```julia -plot(x, sin.(x)) -``` - -```julia -plot(rand(100) / 3,reg=true,fill=(0,:green)) -scatter!(rand(100),markersize=6,c=:orange) -``` - - -```{julia;echo=false; fig_cap="A random walk."; label="random"} -plot(cumsum(randn(1000, 1), dims=1)) -``` diff --git a/test/documents/tangle/chunk_options.jl.ref b/test/documents/tangle/chunk_options.jl.ref deleted file mode 100644 index e6c6d0d..0000000 --- a/test/documents/tangle/chunk_options.jl.ref +++ /dev/null @@ -1,37 +0,0 @@ - -y= [2, 5, 12] - - -x = 1:10 -d = Dict("Weave" => "testing") -y = [2, 4 ,8] - - -x = [12, 10] -println(y) -println(x) - - -println("Results without code") -println(x) - - -y = 1:5 -println(y) - - -a = "Don't print me" -println(a) - - -println("No markup for results.") - - -println(collect(0:10:1000)) - - -println(collect(0:10:1000)) - - -println(collect(0:10:1000)) - diff --git a/test/gadfly_formats.jl b/test/gadfly_formats.jl deleted file mode 100644 index f9c5afd..0000000 --- a/test/gadfly_formats.jl +++ /dev/null @@ -1,31 +0,0 @@ -# Test for Gadfly with different chunk options and figure formatsusing Weave - -using Gadfly, Cairo - - -function test_gadfly(doctype, fig_ext) - out = weave( - joinpath(@__DIR__ , "documents/gadfly_formats_test.jnw"), - doctype = doctype, - fig_ext = fig_ext - ) - result = read(out, String) - # cp(out, out*fig_ext*"."*doctype, force=true) # Used when adding new tests - ref = read(out*fig_ext*"."*doctype, String) - @test result == ref - rm(out) -end - -test_gadfly("github", ".png") -test_gadfly("github", ".pdf") -test_gadfly("github", ".svg") -test_gadfly("pandoc", ".png") -test_gadfly("pandoc", ".js.svg") -test_gadfly("tex", ".pdf") -test_gadfly("tex", ".png") -test_gadfly("tex", ".ps") -test_gadfly("tex", ".tex") - -p = Gadfly.plot(x=1:10, y=1:10) -@test showable(MIME"application/pdf"(), p) == true -@test showable(MIME"application/png"(), p) == true diff --git a/test/plotsjl_test.jl b/test/plotsjl_test.jl deleted file mode 100644 index eff1ec1..0000000 --- a/test/plotsjl_test.jl +++ /dev/null @@ -1,22 +0,0 @@ -using Plots - - -function pljtest(source, resfile, doctype) - weave("documents/$source", out_path = "documents/plotsjl/$resfile", doctype=doctype) - result = read("documents/plotsjl/$resfile", String) - ref = read("documents/plotsjl/$resfile.ref", String) - @test result == ref - rm("documents/plotsjl/$resfile") -end - -pljtest("plotsjl_test_gr.jmd", "plotsjl_test_gr.md", "pandoc") -pljtest("plotsjl_test_gr.jmd", "plotsjl_test_gr.tex", "tex") - -# test cache with plots -isdir("documents/cache") && rm("documents/cache", recursive = true) -weave("documents/plotsjl_test_gr.jmd", cache=:all) -result = read("documents/plotsjl_test_gr.html", String) -rm("documents/plotsjl_test_gr.html") -weave("documents/plotsjl_test_gr.jmd", cache=:all) -cached_result = read("documents/plotsjl_test_gr.html", String) -@test result == cached_result diff --git a/test/runtests.jl b/test/runtests.jl index 04b6622..8831c72 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -3,6 +3,7 @@ # - test for `include_weave` # - fire horrible tests # - test for ipynb integration +# - test for integrations with other libraries, especially for Plots.jl and Gadfly.jl # %% using Weave, Test @@ -56,26 +57,10 @@ end include("test_display.jl") end - @testset "Formatters" begin + @testset "legacy" begin include("formatter_test.jl") include("markdown_test.jl") include("figureformatter_test.jl") - end - - @testset "cache" begin include("cache_test.jl") end - - # trigger only on CI - if get(ENV, "CI", nothing) == "true" - @testset "Plots" begin - include("plotsjl_test.jl") - end - - @testset "Gadfly" begin - include("gadfly_formats.jl") - end - else - @info "skipped Plots.jl and Gadfly.jl integration test" - end end