Skip to content
New issue

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

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

Already on GitHub? # to your account

Feat: support external commands #118

Open
8 tasks
samuelroland opened this issue Sep 22, 2024 · 1 comment
Open
8 tasks

Feat: support external commands #118

samuelroland opened this issue Sep 22, 2024 · 1 comment
Assignees
Labels
p2 Priority 2

Comments

@samuelroland
Copy link
Collaborator

Complex execution of binaries like in SYE: sh.elf with a non supported build command like cmake cmake . -Bbuild && cmake --build build/ can benefit from this.

Checking output of an external command like tree to validate a structure of folder is another benefit that could help train little tools like Yazi, Gitui and others.

TODOs

  • Create branch feat-external-commands
  • Create basic exos for testing with multiplateform commands like ls, echo, including shells specific like $() and | to make sure it is ran in the shell.
  • Define data structures for this new test type command
  • Support cmd (command ran in a shell), expected (expected output): ex. test = { type = 'command', cmd = 'fd -e png | wc -l', expected = "1" }
  • Support wd (working directory), swd (solution working directory): test = { type = 'command', cmd = 'tree d e f', wd = 'train', swd = 'sol' }. The output must match between execution of cmd inside wd and the execution inside swd.
  • Tests failing checks and working checks
  • Fail parsing if swd and expected are provided.
  • Mandatory fields cmd, all other optional.

cc: @AndreCostaaa what do you think about these data structures and how this is going to be parsed by serde ?

Help

@samuelroland samuelroland added the p2 Priority 2 label Sep 22, 2024
@AndreCostaaa
Copy link
Contributor

Parsing should be ok
We can easily convert
test = { type = 'command', cmd = 'tree d e f', wd = 'train', swd = 'sol' }
to
test = { type = 'command', cmd = 'fd -e png | wc -l', expected = "1" }

By actually running the command and collecting the output on startup for instance

This could be a good way to simplify and avoid running multiple times the same command if there are multiple iterations of the exercise

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
p2 Priority 2
Projects
None yet
Development

No branches or pull requests

3 participants