Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@Lichtso
Copy link
Collaborator

@Lichtso Lichtso commented Jan 7, 2025

Rust has two styles for writing tests:

  • Inlined in a cfged module inside the normal source files
  • Separated as files in the tests subdirectory

The first style has the advantage that one can reuse the use import statements and gets direct access to private fields. The second style allows one to use the crates dev-dependencies.

Currently we use both. This PR converts all of the first to the second. This will allow subsequent PRs to move test only code such as syscalls.rs and the TestContextObject into the test_utils crate as a dev-dependency.

@Lichtso Lichtso force-pushed the cleanup/move_tests_into_separate_files branch from ef3f356 to de41822 Compare January 7, 2025 18:36
@Lichtso Lichtso requested a review from LucasSte January 7, 2025 18:38
@Lichtso Lichtso merged commit a29733b into main Jan 8, 2025
11 checks passed
@Lichtso Lichtso deleted the cleanup/move_tests_into_separate_files branch January 8, 2025 15:05
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.

3 participants