Add another set of reference tests, fix a bug they found

This commit is contained in:
Chris de Graaf 2019-09-28 09:45:24 +07:00
parent 19afffbbb8
commit aa3e7769ed
No known key found for this signature in database
GPG Key ID: 150FFDD9B0073C7B
25 changed files with 333 additions and 5 deletions

View File

@ -96,7 +96,7 @@ badges(::Documenter{GitLabCI}) = Badge(
)
view(p::Documenter, t::Template, pkg::AbstractString) = Dict(
"ASSETS" => p.assets,
"ASSETS" => map(basename, p.assets),
"AUTHORS" => join(t.authors, ", "),
"CANONICAL" => p.canonical_url === nothing ? nothing : p.canonical_url(t, pkg),
"HAS_ASSETS" => !isempty(p.assets),

View File

@ -12,7 +12,7 @@ makedocs(;
{{/CANONICAL}}
assets={{^HAS_ASSETS}}String{{/HAS_ASSETS}}[{{^HAS_ASSETS}}],{{/HAS_ASSETS}}
{{#ASSETS}}
"{{{.}}}",
"assets/{{{.}}}",
{{/ASSETS}}
{{#HAS_ASSETS}}
],

View File

@ -0,0 +1,31 @@
# Documentation: https://github.com/JuliaCI/Appveyor.jl
environment:
matrix:
- julia_version: 1.2
- julia_version: 1.3
platform:
- x64
- x86
matrix:
allow_failures:
- julia_version: 1.3
branches:
only:
- master
- /release-.*/
notifications:
- provider: Email
on_build_success: false
on_build_failure: false
on_build_status_changed: false
install:
- ps: iex ((new-object net.webclient).DownloadString("https://raw.githubusercontent.com/JuliaCI/Appveyor.jl/version-1/bin/install.ps1"))
build_script:
- echo "%JL_BUILD_SCRIPT%"
- C:\julia\bin\julia -e "%JL_BUILD_SCRIPT%"
test_script:
- echo "%JL_TEST_SCRIPT%"
- C:\julia\bin\julia -e "%JL_TEST_SCRIPT%"
on_success:
- echo "%JL_CODECOV_SCRIPT%"
- C:\julia\bin\julia -e "%JL_CODECOV_SCRIPT%"

13
test/fixtures/WackyOptions/.cirrus.yml vendored Normal file
View File

@ -0,0 +1,13 @@
freebsd_instance:
image: freebsd-123
task:
name: FreeBSD
env:
JULIA_VERSION: 1.1
JULIA_VERSION: 1.2
install_script:
- sh -c "$(fetch https://raw.githubusercontent.com/ararslan/CirrusCI.jl/master/bin/install.sh -o -)"
build_script:
- cirrusjl build
test_script:
- cirrusjl test

View File

@ -0,0 +1 @@
DO NOT CHANGE THE CONTENTS OF THIS FILE!

View File

@ -0,0 +1 @@
DO NOT CHANGE THE CONTENTS OF THIS FILE!

7
test/fixtures/WackyOptions/.gitignore vendored Normal file
View File

@ -0,0 +1,7 @@
*.jl.*.cov
*.jl.cov
*.jl.mem
/docs/build/
a
b
c

View File

@ -0,0 +1,29 @@
.definitions:
script: &script
script:
- julia --project=@. -e '
using Pkg;
Pkg.build();
Pkg.test();'
Julia 0.6:
image: julia:0.6
<<: *script
Julia 1.2:
image: julia:1.2
<<: *script
pages:
image: julia:1.2
stage: deploy
script:
- julia --project=docs -e '
using Pkg;
Pkg.develop(PackageSpec(; path=pwd()));
Pkg.instantiate();
include("docs/make.jl");'
- mkdir -p public
- mv docs/build public/dev
artifacts:
paths:
- public
only:
- master

19
test/fixtures/WackyOptions/.travis.yml vendored Normal file
View File

@ -0,0 +1,19 @@
# Documentation: http://docs.travis-ci.com/user/languages/julia
language: julia
notifications:
email: false
julia:
- 1.1
- 1.2
os:
- linux
- osx
jobs:
fast_finish: true
include:
- julia: 1.1
os: linux
arch: x86
- julia: 1.2
os: linux
arch: x86

View File

@ -0,0 +1,8 @@
@misc{WackyOptions.jl,
author = {tester},
title = {WackyOptions.jl},
url = {https://github.com/tester/WackyOptions.jl},
version = {v0.1.0},
year = {2019},
month = {8}
}

15
test/fixtures/WackyOptions/LICENSE vendored Normal file
View File

@ -0,0 +1,15 @@
ISC License
Copyright (c) 2019, tester
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.

View File

@ -0,0 +1,2 @@
# This file is machine-generated - editing it directly is not advised

View File

@ -0,0 +1,7 @@
name = "WackyOptions"
uuid = "5b7e9947-ddc0-4b3f-9b55-0d8042f74170"
authors = ["tester"]
version = "0.1.0"
[compat]
julia = "1.2"

5
test/fixtures/WackyOptions/README.md vendored Normal file
View File

@ -0,0 +1,5 @@
# WackyOptions [![Dev](https://img.shields.io/badge/docs-dev-blue.svg)](https://tester.gitlab.io/WackyOptions.jl/dev) [![Build Status](https://gitlab.com/tester/WackyOptions.jl/badges/master/build.svg)](https://gitlab.com/tester/WackyOptions.jl/pipelines) [![Build Status](https://travis-ci.com/tester/WackyOptions.jl.svg?branch=master)](https://travis-ci.com/tester/WackyOptions.jl) [![Build Status](https://ci.appveyor.com/api/projects/status/github/tester/WackyOptions.jl?svg=true)](https://ci.appveyor.com/project/tester/WackyOptions-jl) [![Build Status](https://api.cirrus-ci.com/github/tester/WackyOptions.jl.svg)](https://cirrus-ci.com/github/tester/WackyOptions.jl) [![Coverage](https://codecov.io/gh//.jl/branch/master/graph/badge.svg)](https://codecov.io/gh//.jl) [![Coverage](https://coveralls.io/repos/github//.jl/badge.svg?branch=master)](https://coveralls.io/github//.jl?branch=master)
## Citing
See [`CITATION.bib`](CITATION.bib) for the relevant reference(s).

View File

@ -0,0 +1,89 @@
# This file is machine-generated - editing it directly is not advised
[[Base64]]
uuid = "2a0f44e3-6c83-55bd-87e4-b1978d98bd5f"
[[Dates]]
deps = ["Printf"]
uuid = "ade2ca70-3891-5945-98fb-dc099432e06a"
[[Distributed]]
deps = ["Random", "Serialization", "Sockets"]
uuid = "8ba89e20-285c-5b6f-9357-94700520ee1b"
[[DocStringExtensions]]
deps = ["LibGit2", "Markdown", "Pkg", "Test"]
git-tree-sha1 = "0513f1a8991e9d83255e0140aace0d0fc4486600"
uuid = "ffbed154-4ef7-542d-bbb7-c09d3a79fcae"
version = "0.8.0"
[[Documenter]]
deps = ["Base64", "DocStringExtensions", "InteractiveUtils", "JSON", "LibGit2", "Logging", "Markdown", "REPL", "Test", "Unicode"]
git-tree-sha1 = "1b6ae3796f60311e39cd1770566140d2c056e87f"
uuid = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
version = "0.23.3"
[[InteractiveUtils]]
deps = ["Markdown"]
uuid = "b77e0a4c-d291-57a0-90e8-8db25a27a240"
[[JSON]]
deps = ["Dates", "Mmap", "Parsers", "Unicode"]
git-tree-sha1 = "b34d7cef7b337321e97d22242c3c2b91f476748e"
uuid = "682c06a0-de6a-54ab-a142-c8b1cf79cde6"
version = "0.21.0"
[[LibGit2]]
uuid = "76f85450-5226-5b5a-8eaa-529ad045b433"
[[Logging]]
uuid = "56ddb016-857b-54e1-b83d-db4d58db5568"
[[Markdown]]
deps = ["Base64"]
uuid = "d6f4376e-aef5-505a-96c1-9c027394607a"
[[Mmap]]
uuid = "a63ad114-7e13-5084-954f-fe012c677804"
[[Parsers]]
deps = ["Dates", "Test"]
git-tree-sha1 = "ef0af6c8601db18c282d092ccbd2f01f3f0cd70b"
uuid = "69de0a69-1ddd-5017-9359-2bf0b02dc9f0"
version = "0.3.7"
[[Pkg]]
deps = ["Dates", "LibGit2", "Markdown", "Printf", "REPL", "Random", "SHA", "UUIDs"]
uuid = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f"
[[Printf]]
deps = ["Unicode"]
uuid = "de0858da-6303-5e67-8744-51eddeeeb8d7"
[[REPL]]
deps = ["InteractiveUtils", "Markdown", "Sockets"]
uuid = "3fa0cd96-eef1-5676-8a61-b3b8758bbffb"
[[Random]]
deps = ["Serialization"]
uuid = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
[[SHA]]
uuid = "ea8e919c-243c-51af-8825-aaa63cd721ce"
[[Serialization]]
uuid = "9e88b42a-f829-5b0c-bbe9-9e923198166b"
[[Sockets]]
uuid = "6462fe0b-24de-5631-8697-dd941f90decc"
[[Test]]
deps = ["Distributed", "InteractiveUtils", "Logging", "Random"]
uuid = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
[[UUIDs]]
deps = ["Random", "SHA"]
uuid = "cf7118a7-6976-5b1a-9a39-7adc72f591a4"
[[Unicode]]
uuid = "4ec0a83e-493e-50e2-b9ac-8f72acf5a8f5"

View File

@ -0,0 +1,2 @@
[deps]
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"

20
test/fixtures/WackyOptions/docs/make.jl vendored Normal file
View File

@ -0,0 +1,20 @@
using WackyOptions
using Documenter
makedocs(;
modules=[WackyOptions],
authors="tester",
repo="https://github.com/tester/WackyOptions.jl/blob/{commit}{path}#L{line}",
sitename="WackyOptions.jl",
format=Documenter.HTML(;
canonical="http://example.com",
assets=[
"assets/static.txt",
],
),
pages=[
"Home" => "index.md",
],
bar="baz",
foo="bar",
)

View File

@ -0,0 +1 @@
DO NOT CHANGE THE CONTENTS OF THIS FILE!

View File

@ -0,0 +1,12 @@
```@meta
CurrentModule = WackyOptions
```
# WackyOptions
```@index
```
```@autodocs
Modules = [WackyOptions]
```

View File

@ -0,0 +1,5 @@
module WackyOptions
# Write your package code here.
end

View File

@ -0,0 +1,33 @@
# This file is machine-generated - editing it directly is not advised
[[Base64]]
uuid = "2a0f44e3-6c83-55bd-87e4-b1978d98bd5f"
[[Distributed]]
deps = ["Random", "Serialization", "Sockets"]
uuid = "8ba89e20-285c-5b6f-9357-94700520ee1b"
[[InteractiveUtils]]
deps = ["Markdown"]
uuid = "b77e0a4c-d291-57a0-90e8-8db25a27a240"
[[Logging]]
uuid = "56ddb016-857b-54e1-b83d-db4d58db5568"
[[Markdown]]
deps = ["Base64"]
uuid = "d6f4376e-aef5-505a-96c1-9c027394607a"
[[Random]]
deps = ["Serialization"]
uuid = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
[[Serialization]]
uuid = "9e88b42a-f829-5b0c-bbe9-9e923198166b"
[[Sockets]]
uuid = "6462fe0b-24de-5631-8697-dd941f90decc"
[[Test]]
deps = ["Distributed", "InteractiveUtils", "Logging", "Random"]
uuid = "8dfed614-e22c-5e08-85e1-65c5234f0b40"

View File

@ -0,0 +1,2 @@
[deps]
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"

View File

@ -0,0 +1,6 @@
using WackyOptions
using Test
@testset "WackyOptions.jl" begin
# Write your tests here.
end

1
test/fixtures/static.txt vendored Normal file
View File

@ -0,0 +1 @@
DO NOT CHANGE THE CONTENTS OF THIS FILE!

View File

@ -1,3 +1,5 @@
const STATIC_FILE = joinpath(@__DIR__, "fixtures", "static.txt")
function PT.user_view(::Citation, ::Template, ::AbstractString)
return Dict("MONTH" => 8, "YEAR" => 2019)
end
@ -16,17 +18,34 @@ end
@testset "Reference tests" begin
@testset "Default package" begin
test_all("Basic"; authors=USER, manifest=true)
test_all("Basic"; authors=USER)
end
@testset "All plugins" begin
test_all("AllPlugins"; authors=USER, manifest=true, plugins=[
test_all("AllPlugins"; authors=USER, plugins=[
AppVeyor(), CirrusCI(), Citation(), Codecov(), Coveralls(),
Develop(), Documenter(), GitLabCI(), TravisCI(),
])
end
@testset "Wacky options" begin
# TODO
test_all("WackyOptions"; authors=USER, julia=v"1.2", plugins=[
AppVeyor(; x86=true, coverage=true, extra_versions=[v"1.3"]),
CirrusCI(; image="freebsd-123", coverage=false, extra_versions=["1.1"]),
Citation(; readme=true),
Codecov(; file=STATIC_FILE),
Coveralls(; file=STATIC_FILE),
Documenter{GitLabCI}(
assets=[STATIC_FILE],
makedocs_kwargs=Dict(:foo => "bar", :bar => "baz"),
canonical_url=(_t, _pkg) -> "http://example.com",
),
Git(; ignore=["a", "b", "c"], manifest=true),
GitLabCI(; coverage=false, extra_versions=[v"0.6"]),
License(; name="ISC"),
Readme(; inline_badges=true),
Tests(; project=true),
TravisCI(; coverage=false, windows=false, x86=true, extra_versions=["1.1"]),
])
end
end