{"id":13460257,"url":"https://github.com/thallard/minishell_tester","last_synced_at":"2025-03-24T18:33:27.294Z","repository":{"id":54414201,"uuid":"329438218","full_name":"thallard/minishell_tester","owner":"thallard","description":"42 | Complex tester for minishell (42cursus)","archived":false,"fork":false,"pushed_at":"2023-12-12T20:33:04.000Z","size":3127,"stargazers_count":43,"open_issues_count":0,"forks_count":6,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-10-29T06:33:24.708Z","etag":null,"topics":["42","42born2code","42school","minishell","tester","valgrind"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/thallard.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-01-13T21:41:09.000Z","updated_at":"2024-09-26T11:47:53.000Z","dependencies_parsed_at":"2024-10-29T06:30:40.999Z","dependency_job_id":"96854145-44a0-43a1-b3dc-5123b92efe4c","html_url":"https://github.com/thallard/minishell_tester","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thallard%2Fminishell_tester","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thallard%2Fminishell_tester/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thallard%2Fminishell_tester/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thallard%2Fminishell_tester/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/thallard","download_url":"https://codeload.github.com/thallard/minishell_tester/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245328528,"owners_count":20597441,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["42","42born2code","42school","minishell","tester","valgrind"],"created_at":"2024-07-31T10:00:38.186Z","updated_at":"2025-03-24T18:33:26.927Z","avatar_url":"https://github.com/thallard.png","language":"Shell","funding_links":[],"categories":["WELCOME"],"sub_categories":["**Minishell**"],"readme":"## Overview\n\nThe tester contains these features :\n- ``Built-in (echo, export, cd, unset, pwd \u0026 exit)``\n- ``All separators (pipes and semicolons)``\n- ``Redirection (\u003c, \u003e, \u003e\u003e) and redirection of STDERROR/STDOUT/FD (2\u003e/dev/null 2\u003efile 1\u003e\u003efile 1\u003e/dev/null)``\n- ``Environment variables (there are complex tests with these)``\n- ``Quotes, escaping quotes and escaping characters``\n- ``Leaks with Valgrind**``\n- ``Print differences between your minishell results and bash ones with exit status ($?)``\n- ``Check dynamic environment variables ($_, $PWD, $OLDPWD, $SHLVL, etc...)``\n\n** : For Valgrind check gurival's repository : https://github.com/grouville/valgrind_42, it's an useful tool to use Valgrind for MacOS.\n\u003cp align=\"center\"\u003eLittle peak of the tester :\u003c/p\u003e\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"tmp/preview.gif\" alt=\"animated\" /\u003e\n\u003c/p\u003e\n\u003cp align=\"center\"\u003eAnd with the short flag :\u003c/p\u003e\n\u003cp align=\"center\"\u003e\n    \u003cimg src=\"https://i.gyazo.com/329fd26a0abc17e26f308aaa77a1d78f.gif\" alt=\"animated\" /\u003e\n\u003c/p\u003e\n\n## Get started (VERY IMPORTANT)\nYour minishell executable must work with ``-c`` flag.\n\nFirst of all, you must have the below part in your main of your minishell, otherwise you won't be able to use the tester.\nIf you don't understand this part or you're having some troubles, do not hesitate to contact me on Discord or Slack :\n```cpp\n// argv[2] will contains the content of the line for example \"echo something ; ls -la\" \nint main(int argc, char **argv)\n{\n  // Your code...\n  if (argc \u003e= 3 \u0026\u0026 !ft_strncmp(argv[1], \"-c\", 3))\n  {\n    int exit_status = ft_launch_minishell(argv[2]);\n    exit(exit_status);\n  }\n    // Above this is the function that normally launch your minishell, instead \n    // of reading line with a get_next_line or a read() on fd 0, you just have to get\n    // the argv[2] (which contains the content) and execute it.\n    // Your function should return the good exit status otherwise the tests may be considered as false.\n  // Your code ...\n}\n```\nAnd all of your return messages from ``exit``, ``cd`` errors, ``echo`` errors should be print on ``STDERROR`` (on fd = 2).\n\n\nWhen you have added this part in your main, your minishell's built-in ``echo`` must work for this test, let's try a :\n```bash\nbash test.sh compatibility\n```\nIf you have this result then your minishell is working, you can use the tester !\n![](tmp/compatibility.png)\n## Usage\n\nTo show all explained flags and global usage of the script :\n```bash\nbash test.sh help \n```\n![](https://i.gyazo.com/8a8633c2e7ea7ebf9370f156eda45ab7.png)\nGlobal use of the tester (To see utility of each flags check the screenshot above) :\n```bash\nbash test.sh [--diff] [--fast] [--short] [--valgrind] \u003cname_file\u003e ...\n```\nSome examples on how to use it :\n```bash\nbash test.sh --diff all\nbash test.sh --diff echo \nbash test.sh --fast echo cd\nbash test.sh --diff --fast echo export unset\nbash test.sh --diff --valgrind all\nbash test.sh -f -s -d all\n\n```\n\n## Contact\nIf you have any ideas on how to improve this tester or if you are a bug hunter, feel free to send a PM on Discord : hosrAAA#6964\n\nhttps://profile.intra.42.fr/users/thallard\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthallard%2Fminishell_tester","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthallard%2Fminishell_tester","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthallard%2Fminishell_tester/lists"}