2016-11-03 13:13:50 +01:00
|
|
|
using Weave
|
2018-07-23 12:37:25 +02:00
|
|
|
using Test
|
2015-01-08 17:52:42 +01:00
|
|
|
|
|
|
|
#Test if running document with and without cache works
|
|
|
|
isdir("documents/cache") && rm("documents/cache", recursive = true)
|
|
|
|
weave("documents/chunk_options.noweb", plotlib=nothing, cache=:all)
|
2018-07-23 12:37:25 +02:00
|
|
|
result = read("documents/chunk_options.md", String)
|
2015-01-08 18:35:47 +01:00
|
|
|
rm("documents/chunk_options.md")
|
2015-01-08 17:52:42 +01:00
|
|
|
weave("documents/chunk_options.noweb", plotlib=nothing, cache=:all)
|
2018-07-23 12:37:25 +02:00
|
|
|
cached_result = read("documents/chunk_options.md", String)
|
2015-01-08 17:52:42 +01:00
|
|
|
@test result == cached_result
|
|
|
|
|
|
|
|
# cache = :user
|
|
|
|
isdir("documents/cache") && rm("documents/cache", recursive = true)
|
|
|
|
out = "documents/chunk_cache.md"
|
|
|
|
Weave.weave("documents/chunk_cache.noweb", plotlib=nothing, cache=:user);
|
2018-07-23 12:37:25 +02:00
|
|
|
result = read(out, String)
|
2015-01-08 18:35:47 +01:00
|
|
|
rm(out)
|
2015-01-08 17:52:42 +01:00
|
|
|
Weave.weave("documents/chunk_cache.noweb", plotlib=nothing, cache=:user);
|
2018-07-23 12:37:25 +02:00
|
|
|
cached_result = read(out, String)
|
2015-01-08 17:52:42 +01:00
|
|
|
@test result == cached_result
|
|
|
|
|
2016-12-28 00:12:53 +01:00
|
|
|
# cache = :all
|
|
|
|
isdir("documents/cache") && rm("documents/cache", recursive = true)
|
|
|
|
out = "documents/chunk_cache.md"
|
|
|
|
Weave.weave("documents/chunk_cache.noweb", cache=:all);
|
2018-07-23 12:37:25 +02:00
|
|
|
result = read(out, String)
|
2016-12-28 00:12:53 +01:00
|
|
|
rm(out)
|
|
|
|
Weave.weave("documents/chunk_cache.noweb", cache=:all);
|
2018-07-23 12:37:25 +02:00
|
|
|
cached_result = read(out, String)
|
2016-12-28 00:12:53 +01:00
|
|
|
@test result == cached_result
|
|
|
|
|
|
|
|
|
|
|
|
|
2016-12-27 21:29:04 +01:00
|
|
|
if VERSION.minor == 5
|
2015-01-09 13:17:56 +01:00
|
|
|
using Gadfly
|
|
|
|
isdir("documents/cache") && rm("documents/cache", recursive = true)
|
|
|
|
#Caching with Gadfly
|
|
|
|
weave("documents/gadfly_formats_test.txt", doctype="tex", plotlib="gadfly", cache=:all)
|
2018-07-23 12:37:25 +02:00
|
|
|
result = read("documents/gadfly_formats_test.tex", String)
|
2015-01-09 13:17:56 +01:00
|
|
|
rm("documents/gadfly_formats_test.tex")
|
|
|
|
weave("documents/gadfly_formats_test.txt", doctype="tex", plotlib="gadfly", cache=:all)
|
2018-07-23 12:37:25 +02:00
|
|
|
cached_result = read("documents/gadfly_formats_test.tex", String)
|
2015-01-09 13:17:56 +01:00
|
|
|
@test result == cached_result
|
|
|
|
end
|