2020-05-15 17:38:18 +02:00
|
|
|
using Weave, Test
|
2020-05-15 18:49:55 +02:00
|
|
|
using Weave: WeaveDoc, run_doc
|
2014-12-06 18:16:45 +01:00
|
|
|
|
2020-05-09 09:52:01 +02:00
|
|
|
|
|
|
|
# TODO: add test for header processsing
|
|
|
|
# TODO: add test for `include_weave`
|
|
|
|
|
2020-05-16 16:25:44 +02:00
|
|
|
# constructs `WeaveDoc` from `String` and run it
|
|
|
|
function mock_doc(str; informat = "markdown", run = true, doctype = "md2html", kwargs...)
|
2020-05-15 16:51:52 +02:00
|
|
|
f = tempname()
|
|
|
|
write(f, str)
|
2020-05-16 16:25:44 +02:00
|
|
|
doc = WeaveDoc(f, informat)
|
|
|
|
return run ? run_doc(doc; doctype = doctype, kwargs...) : doc
|
2020-05-15 16:51:52 +02:00
|
|
|
end
|
2020-05-16 16:25:44 +02:00
|
|
|
macro jmd_str(s) mock_doc(s) end
|
2020-05-09 15:33:58 +02:00
|
|
|
|
2020-05-09 09:52:01 +02:00
|
|
|
|
2018-07-25 20:43:38 +02:00
|
|
|
@testset "Weave" begin
|
|
|
|
@testset "Chunk options" begin
|
|
|
|
include("chunk_options.jl")
|
|
|
|
end
|
|
|
|
|
2020-05-09 09:52:01 +02:00
|
|
|
@testset "module evaluation" begin
|
|
|
|
include("test_module_evaluation.jl")
|
|
|
|
end
|
|
|
|
|
|
|
|
@testset "header" begin
|
|
|
|
include("test_header.jl")
|
2018-07-25 23:12:48 +02:00
|
|
|
end
|
|
|
|
|
2020-05-24 13:52:53 +02:00
|
|
|
@testset "inline" begin
|
|
|
|
include("test_inline.jl")
|
|
|
|
end
|
|
|
|
|
2020-05-09 15:35:45 +02:00
|
|
|
@testset "error rendering" begin
|
|
|
|
include("test_error_rendering.jl")
|
|
|
|
end
|
|
|
|
|
2020-05-16 14:33:01 +02:00
|
|
|
@testset "conversions" begin
|
2020-05-15 17:38:18 +02:00
|
|
|
include("test_converter.jl")
|
2018-07-25 20:43:38 +02:00
|
|
|
end
|
|
|
|
|
2020-05-16 16:25:44 +02:00
|
|
|
@testset "display" begin
|
|
|
|
include("test_display.jl")
|
|
|
|
end
|
|
|
|
|
2018-07-25 20:43:38 +02:00
|
|
|
@testset "Formatters" begin
|
|
|
|
include("formatter_test.jl")
|
|
|
|
include("markdown_test.jl")
|
|
|
|
include("figureformatter_test.jl")
|
|
|
|
end
|
|
|
|
|
|
|
|
@testset "Rich output" begin
|
|
|
|
include("rich_output.jl")
|
|
|
|
end
|
2018-07-26 10:35:17 +02:00
|
|
|
|
2019-03-11 09:23:31 +01:00
|
|
|
@testset "Cache" begin
|
|
|
|
include("cache_test.jl")
|
|
|
|
end
|
|
|
|
|
2019-06-19 19:26:13 +02:00
|
|
|
# @testset "Notebooks" begin
|
|
|
|
# @info("Testing Jupyter options")
|
|
|
|
# include("notebooks.jl")
|
|
|
|
# end
|
2020-05-24 13:52:53 +02:00
|
|
|
|
2020-05-25 03:14:45 +02:00
|
|
|
# trigger only on CI
|
|
|
|
get(ENV, "CI", nothing) == "true" && begin
|
|
|
|
@testset "Plots" begin
|
|
|
|
include("plotsjl_test.jl")
|
|
|
|
end
|
|
|
|
|
|
|
|
@testset "Gadfly" begin
|
|
|
|
include("gadfly_formats.jl")
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2020-05-24 13:52:53 +02:00
|
|
|
try
|
|
|
|
@testset "end2end (maybe fail)" begin
|
|
|
|
include("end2end.jl")
|
|
|
|
end
|
|
|
|
catch err
|
|
|
|
@error err
|
|
|
|
end
|
2019-03-06 21:27:47 +01:00
|
|
|
end
|