Skip to content

Commit

Permalink
Revamp test suite. (#59)
Browse files Browse the repository at this point in the history
- General cleanup of tests (remove unused reference images, remove test cases that don't exist in resvg, add all remaining resvg test cases without reference images)
- Instead of using a custom test runner, we generate tests using Python. While it removes some flexibility in how we run the tests, it allows us to use cargo's native test runner, which has many advantages, such as being more consistent overall and also not quitting instantly if a test case panics.
  • Loading branch information
LaurenzV authored Feb 12, 2024
1 parent 476bb0c commit 78d14ef
Show file tree
Hide file tree
Showing 191 changed files with 3,841 additions and 814 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
shell: bash
steps:
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Get Rust toolchain
uses: dtolnay/rust-toolchain@stable
Expand All @@ -27,7 +27,7 @@ jobs:
curl -LO https://github.com/bblanchon/pdfium-binaries/releases/download/chromium%2F5880/pdfium-linux-x64.tgz
mkdir pdfium-linux-x64
tar -xvzf ./pdfium-linux-x64.tgz -C pdfium-linux-x64
mv ./pdfium-linux-x64/lib/libpdfium.so ./tests/pdfium_lib
mv ./pdfium-linux-x64/lib/libpdfium.so ./tests/pdfium
- name: Build svg2pdf
run: cargo build --all --release
Expand All @@ -46,7 +46,7 @@ jobs:
name: Check clippy, formatting, and documentation
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
- run: cargo clippy --all-targets
Expand Down
151 changes: 1 addition & 150 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 0 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,13 @@ clap_complete = "4.4.3"
clap_mangen = "0.2.14"
fontdb = "0.16.0"
image = { version = "0.24", default-features = false, features = ["jpeg", "png", "gif"] }
indicatif = "0.17.5"
lazy_static = "1.4.0"
miniz_oxide = "0.7"
once_cell = "1.18.0"
oxipng = { version = "9", default-features = false, features = ["filetime", "parallel", "zopfli"] }
pdf-writer = "0.9"
pdfium-render = "0.8.6"
regex = "1.8.4"
termcolor = "1.2"
usvg = { version = "0.38.0", default-features = false, features = ["text"] }
walkdir = "2.3.3"
tiny-skia = "0.11.3"
resvg = { version = "0.38.0" }

Expand Down
28 changes: 2 additions & 26 deletions tests/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,36 +8,12 @@ repository.workspace = true
license.workspace = true
publish = false

[lib]
test = false
doctest = false

[[test]]
name = "tests"
path = "src/tests.rs"
harness = false

[[bin]]
name = "generate"
path = "src/generate.rs"
test = false

[[bin]]
name = "typst"
path = "src/typst.rs"
test = false

[dependencies]
fontdb = { workspace = true }
svg2pdf = { workspace = true }
usvg = { workspace = true }
pdfium-render = { workspace = true }
walkdir = { workspace = true }
lazy_static = { workspace = true }
pdfium-render = { workspace = true, features = ["sync"] }
pdf-writer = { workspace = true }
image = { workspace = true }
indicatif = { workspace = true }
oxipng = { workspace = true }
clap = { workspace = true }
termcolor = { workspace = true }
regex = { workspace = true }
once_cell = { workspace = true }
Loading

0 comments on commit 78d14ef

Please sign in to comment.