Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat/fuzz dir and tidy #108

Closed
wants to merge 57 commits into from
Closed

Feat/fuzz dir and tidy #108

wants to merge 57 commits into from

Conversation

lukacan
Copy link
Collaborator

@lukacan lukacan commented Dec 16, 2023

  • Init command contains option "--template" which will generate "Both | PoC (legacy tests) | Fuzz" trdelnik tests structure

    • for BOTH , both folders (as described below) will be generated
    • for Fuzz - only fuzz_tests will be generated
    • for PoC - only poc_tests will be generated
  • Trdelnik-tests structure is as follows:

    • trdelnik-tests
      • poc_tests
        • tests
          • test.rs
        • Cargo.toml
      • fuzz_tests
        • fuzz_0
          • Cargo.toml - I find this separate Cargo manifest for each fuzz test useful if we will support ProgramStubs/ProgramTest
          • test_fuzz.rs
        • fuzz_1
        • fuzz_2
  • described structure works essentially as before:

    • "trdelnik test" will call PoC Tests
    • "trdelnik fuzz run fuzz_0" will run fuzz_0 test
    • "trdelnik fuzz run fuzz_1" will run fuzz_1 test
    • if fuzz_x does not exists, honggfuzz will throw an error
  • hfuzz_target is in the root of the project

  • hfuzz_workspace is in the root of the project (--with-exit-code should work with this location)

  • added subcommand "trdelnik fuzz add" which will add new fuzz_x target as described in the structure above

    • currently it does not support custom name , just finds the highest X and generates fuzz_X+1.
  • some new fuzzer options were added into the Trdelnik.toml manifest

  • build and init has arch option such as build-bpf or build-sbf

  • test_generator was renamed to workspace builder

  • clean command was moved to the workspace_builder

  • discover Anchor.toml/Cargo.tom/Trdelnik.toml was added into invoked commands

  • constants were moved to the client/src/lib.rs

  • PoC tests dependencies were changed to dev-dependencies as these are used for Tests

  • examples were updated to the new structure

  • Looks like a lot of changes were made, however there are still plenty of TODO or FIXME that should be resolved. This PR contains only initial logic, that was tested on examples, it should improve the project structure and also readability.

lukacan added 30 commits December 3, 2023 21:18
…other commands, also moved some logic into commander
…for anchor/cargo toml files for fuzzer/no fuzzer init
…data from the idl parse , those data are later used so no need to obtain them again, also moved here some logic from commander , and also removed some unneeded functions
…d support for adding new fuzz tests/ updated templates
…ptions to the init for fuzz/poc/both template
@lukacan lukacan requested a review from Ikrk December 16, 2023 11:18
@lukacan lukacan removed the request for review from Ikrk December 28, 2023 16:09
@lukacan lukacan closed this Jan 12, 2024
@lukacan lukacan deleted the feat/fuzz_dir_and_tidy branch June 17, 2024 07:54
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant