Skip to content

Commit

Permalink
Make fuzz dir a part of the workspace
Browse files Browse the repository at this point in the history
With the changes from rust-fuzz/cargo-fuzz#357
merged, `fuzz` dir now can be a part of the workspace.
  • Loading branch information
kdarkhan committed Feb 6, 2024
1 parent 7e3e5c6 commit 4a213d1
Show file tree
Hide file tree
Showing 12 changed files with 71 additions and 1,299 deletions.
12 changes: 2 additions & 10 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -123,33 +123,29 @@ jobs:
# Cache only on main build
save-if: ${{ github.ref == 'refs/heads/main' }}
cache-directories: |
i18n-helpers/fuzz/target
i18n-helpers/fuzz/corpus
fuzz/target
fuzz/corpus
- name: Install cargo-fuzz
run: cargo install cargo-fuzz

- name: Run group_events fuzzer and minimize corpus
working-directory: i18n-helpers
run: |
cargo fuzz run group_events -- -only_ascii=1 -max_total_time=30
cargo fuzz cmin group_events
- name: Run normalize fuzzer and minimize corpus
working-directory: i18n-helpers
run: |
cargo fuzz run normalize -- -only_ascii=1 -max_total_time=30
cargo fuzz cmin normalize
- name: Run gettext fuzzer and minimize corpus
working-directory: i18n-helpers
run: |
cargo fuzz run gettext -- -only_ascii=1 -max_total_time=30
cargo fuzz cmin gettext
- name: Run xgettext fuzzer and minimize corpus
run: |
cd i18n-helpers
cargo fuzz run xgettext -- -only_ascii=1 -max_total_time=30
cargo fuzz cmin xgettext
Expand All @@ -165,10 +161,6 @@ jobs:
- name: Clippy
run: cargo clippy --all-targets

- name: Clippy on fuzzers
working-directory: ./i18n-helpers/fuzz
run: cargo clippy --all-targets

format:
name: Format
runs-on: ubuntu-latest
Expand Down
53 changes: 53 additions & 0 deletions Cargo.lock

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

4 changes: 3 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[workspace]
members = ["i18n-helpers", "mdbook-tera-backend"]
members = ["i18n-helpers", "mdbook-tera-backend", "fuzz"]
default-members = ["i18n-helpers", "mdbook-tera-backend"]
resolver = "2"

Expand All @@ -11,5 +11,7 @@ print_stderr = "warn"
[workspace.dependencies]
anyhow = "1.0.79"
mdbook = { version = "0.4.36", default-features = false }
polib = "0.2.0"
pretty_assertions = "1.3.0"
serde_json = "1.0.113"
tempfile = "3.9.0"
File renamed without changes.
25 changes: 10 additions & 15 deletions i18n-helpers/fuzz/Cargo.toml → fuzz/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,46 +7,41 @@ publish = false
[package.metadata]
cargo-fuzz = true

[lints.clippy]
dbg_macro = "warn"
print_stdout = "warn"
print_stderr = "warn"
[lints]
workspace = true

[dependencies]
arbitrary = { version = "1.3.1", features = ["derive"] }
libfuzzer-sys = "0.4.0"
mdbook = { version = "0.4.25", default-features = false }
mdbook-i18n-helpers = { path = ".." }
polib = "0.2.0"
pretty_assertions = "1.3.0"

# Prevent this from interfering with workspaces
[workspace]
members = ["."]

[profile.release]
debug = 1
mdbook.workspace = true
mdbook-i18n-helpers = { path = "../i18n-helpers" }
polib.workspace = true
pretty_assertions.workspace = true

[[bin]]
name = "group_events"
path = "fuzz_targets/group_events.rs"
test = false
doc = false
bench = false

[[bin]]
name = "normalize"
path = "fuzz_targets/normalize.rs"
test = false
doc = false
bench = false

[[bin]]
name = "gettext"
path = "fuzz_targets/gettext.rs"
test = false
doc = false
bench = false

[[bin]]
name = "xgettext"
path = "fuzz_targets/xgettext.rs"
test = false
doc = false
bench = false
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
6 changes: 3 additions & 3 deletions i18n-helpers/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ workspace = true
anyhow.workspace = true
chrono = { version = "0.4.33", default-features = false, features = ["alloc"] }
mdbook.workspace = true
polib = "0.2.0"
pulldown-cmark = { version = "0.9.6", default-features = false }
polib.workspace = true
pulldown-cmark = { version = "0.9.2", default-features = false }
pulldown-cmark-to-cmark = "11.2.0"
regex = "1.10.3"
semver = "1.0.21"
Expand All @@ -26,5 +26,5 @@ syntect = "5.1.0"
textwrap = { version = "0.16.0", default-features = false }

[dev-dependencies]
pretty_assertions = "1.3.0"
pretty_assertions.workspace = true
tempfile.workspace = true
Loading

0 comments on commit 4a213d1

Please sign in to comment.