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

Refactor build.zig for Enhanced Readability and Dynamic Test Inclusion #25

Merged
merged 4 commits into from
Dec 24, 2023

Conversation

hendriknielaender
Copy link
Owner

@hendriknielaender hendriknielaender commented Dec 22, 2023

#22

Enhanced Readability and Maintainability:

  • The script has been modularized into distinct functions: setupLibrary, setupTesting, setupExamples, and setupDocumentation. This modularization separates concerns, making the script more readable and easier to maintain.
  • Each function is responsible for a specific aspect of the build process, thereby reducing complexity and improving the overall structure of the script.
  • Comments and documentation within the script have been added or updated to reflect these changes, providing clear guidance on the purpose and functionality of each part of the script.

Dynamic Inclusion of Test Files:

  • A significant enhancement in the setupTesting function is the dynamic discovery and inclusion of .zig test files from specified directories.
  • This is achieved by iterating over the contents of each directory listed in the test_dirs array, automatically adding any .zig files found as test cases.
  • This approach removes the need for manually listing test files, allowing for easier management of tests, especially in larger projects with numerous test cases spread across multiple directories.

@hendriknielaender hendriknielaender self-assigned this Dec 22, 2023
@hendriknielaender hendriknielaender marked this pull request as ready for review December 23, 2023 12:18
@hendriknielaender hendriknielaender changed the title chore: add dir to unit tests Refactor build.zig for Enhanced Readability and Dynamic Test Inclusion Dec 24, 2023
@hendriknielaender hendriknielaender merged commit eadcda8 into main Dec 24, 2023
5 of 6 checks passed
@hendriknielaender hendriknielaender deleted the run-test branch March 19, 2024 11:06
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