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

unit-testing and general improvements. #29

Merged
merged 48 commits into from
Sep 8, 2024
Merged

Conversation

h4rldev
Copy link
Collaborator

@h4rldev h4rldev commented Aug 11, 2024

This pr has these TODOs before I'm comfortable with review:

  • - "Complete" Unit-Testing support, for testing all components of this project.
  • - Add a script to integrate a set version of Unity into it instead of including the files into the repo.
  • - Proper execution, with execve instead for more control.
  • - Properly introduce builtins.

…nges to almost all files (i don't remember what I changed tbh), but I did finally unsterstand how strlcat works, and I also managed to get builtins working, will work on how they're called though in the future.
@h4rldev h4rldev added enhancement New feature or request help wanted Extra attention is needed dependencies Pull requests that update a dependency file labels Aug 11, 2024
@h4rldev h4rldev requested a review from Intancote August 11, 2024 04:48
.github/workflows/ci.yml Fixed Show resolved Hide resolved
.github/workflows/ci.yml Fixed Show fixed Hide fixed
.github/workflows/ci.yml Fixed Show fixed Hide fixed
.github/workflows/ci.yml Show resolved Hide resolved
scripts/build.sh Fixed Show fixed Hide fixed
.github/workflows/ci.yml Fixed Show fixed Hide fixed
src/hamon/exec.c Dismissed Show dismissed Hide dismissed
src/hamon/exec.c Dismissed Show dismissed Hide dismissed
src/main.c Fixed Show fixed Hide fixed
test/test_escape.c Fixed Show fixed Hide fixed
.github/workflows/ci.yml Fixed Show resolved Hide resolved
Signed-off-by: h4rl <98224660+h4rldev@users.noreply.github.com>
README.md Dismissed Show dismissed Hide dismissed
README.md Dismissed Show dismissed Hide dismissed
README.md Dismissed Show dismissed Hide dismissed
README.md Dismissed Show dismissed Hide dismissed
src/hamon/builtins.c Dismissed Show resolved Hide resolved
src/hamon/builtins.c Dismissed Show resolved Hide resolved
src/hamon/builtins.c Fixed Show fixed Hide fixed
test/test_builtins.c Fixed Show fixed Hide fixed
test/test_builtins.c Fixed Show fixed Hide fixed
test/test_builtins.c Fixed Show fixed Hide fixed
test/test_builtins.c Fixed Show fixed Hide fixed
test/test_builtins.c Fixed Show fixed Hide fixed
test/test_builtins.c Fixed Show fixed Hide fixed
test/test_builtins.c Fixed Show fixed Hide fixed
Copy link

@github-advanced-security github-advanced-security bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Flawfinder (reported by Codacy) found more than 20 potential problems in the proposed changes. Check the Files changed tab for more details.

@h4rldev h4rldev marked this pull request as ready for review September 4, 2024 16:59
src/hamon/builtins.c Fixed Show fixed Hide fixed
src/hamon/prompt.c Fixed Show fixed Hide fixed
src/hamon/builtins.c Dismissed Show resolved Hide resolved
.github/workflows/ci.yml Fixed Show resolved Hide resolved
.github/workflows/ci.yml Dismissed Show resolved Hide resolved
tests/test_escape.c Dismissed Show dismissed Hide dismissed
@h4rldev h4rldev changed the title draft: unit-testing and general improvements. unit-testing and general improvements. Sep 5, 2024
@h4rldev
Copy link
Collaborator Author

h4rldev commented Sep 5, 2024

@Intancote. All I'm missing is the review, then I can focus on a better tokenizer and proper windows support (I just set up a windows vm for this purpose)

@github-advanced-security
Copy link

This pull request sets up GitHub code scanning for this repository. Once the scans have completed and the checks have passed, the analysis results for this pull request branch will appear on this overview. Once you merge this pull request, the 'Security' tab will show more code scanning analysis results (for example, for the default branch). Depending on your configuration and choice of analysis tool, future pull requests will be annotated with code scanning analysis results. For more information about GitHub code scanning, check out the documentation.

src/hamon/prompt.c Dismissed Show dismissed Hide dismissed
src/hamon/prompt.c Fixed Show resolved Hide resolved
README.md Dismissed Show dismissed Hide dismissed
README.md Dismissed Show dismissed Hide dismissed
build/build.sh Dismissed Show dismissed Hide dismissed
build/build.sh Fixed Show fixed Hide fixed
build/build.sh Fixed Show fixed Hide fixed
src/hamon/cli.c Dismissed Show dismissed Hide dismissed
src/hamon/cli.c Dismissed Show dismissed Hide dismissed
src/hamon/cli.c Dismissed Show dismissed Hide dismissed
src/hamon/file.c Dismissed Show dismissed Hide dismissed
src/hamon/file.c Dismissed Show dismissed Hide dismissed
src/hamon/file.c Fixed Show fixed Hide fixed
src/hamon/file.c Dismissed Show dismissed Hide dismissed
src/hamon/file.c Fixed Show resolved Hide resolved
Intancote
Intancote previously approved these changes Sep 7, 2024
Copy link
Collaborator

@Intancote Intancote left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Although some parts could be improved, these can be addressed later.
For now, this is a massive improvement over the current main branch. Further work will be done outside of the PR of course, and a 'functional' version for Windows will be added later on.
For now, this PR is approved 👍
All that needs to be done before the merge is for all checks too pass.

while (*ptr != '\0' && count < 4096 - 1) {
size_t len = strlen(ptr);
env_array[count] = malloc(len + 1);
strlcpy(env_array[count], ptr, strlen(env_array[count]) + 1);

Check notice

Code scanning / Flawfinder (reported by Codacy)

Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). Note

Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126).
Copy link
Collaborator

@Intancote Intancote left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as my last review, but now all checks are good 👍

@h4rldev h4rldev merged commit 089c546 into tatsoku:main Sep 8, 2024
18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants