{"id":25786338,"url":"https://github.com/zak4b/push_swap_tester","last_synced_at":"2025-08-27T04:18:11.675Z","repository":{"id":273257776,"uuid":"919128387","full_name":"Zak4b/push_swap_tester","owner":"Zak4b","description":" Bash script to test push_swap","archived":false,"fork":false,"pushed_at":"2025-02-04T13:12:17.000Z","size":29,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-27T11:03:27.722Z","etag":null,"topics":["42","42school","tool"],"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/Zak4b.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":"2025-01-19T19:17:37.000Z","updated_at":"2025-02-18T13:03:56.000Z","dependencies_parsed_at":"2025-02-27T09:08:28.073Z","dependency_job_id":"64af5631-6ac8-45ef-9571-6770e79bf2a4","html_url":"https://github.com/Zak4b/push_swap_tester","commit_stats":null,"previous_names":["zak4b/push_swap_tester"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Zak4b/push_swap_tester","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Zak4b%2Fpush_swap_tester","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Zak4b%2Fpush_swap_tester/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Zak4b%2Fpush_swap_tester/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Zak4b%2Fpush_swap_tester/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Zak4b","download_url":"https://codeload.github.com/Zak4b/push_swap_tester/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Zak4b%2Fpush_swap_tester/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":272289745,"owners_count":24907802,"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","status":"online","status_checked_at":"2025-08-27T02:00:09.397Z","response_time":76,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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","42school","tool"],"created_at":"2025-02-27T09:08:20.701Z","updated_at":"2025-08-27T04:18:11.655Z","avatar_url":"https://github.com/Zak4b.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Push Swap Tester\n\n**Push Swap Tester** is a Bash script designed to test the reliability, performance, and memory management of the **Push Swap** program. It includes validity checks, performance benchmarking, and memory leak detection using `valgrind`.\n\n## 🎯 Purpose\n\nThis script evaluates:\n\n1. **Result Validity**: Verifies if the `push_swap` program produces correct solutions for various sets of random numbers.\n2. **Performance**: Measures the number of moves generated by `push_swap` to solve permutations.\n3. **Memory Management**: Detects memory leaks or other issues using `valgrind`.\n\n---\n\n## 🚀 Usage\n\n### Prerequisites\n\n-   `bash`\n-   `valgrind`\n-   `curl` (for automatic downloading of the `checker` file, if needed)\n\n### Running the Script\n\nRun with curl:\n\n```bash\ncurl -sSL https://raw.githubusercontent.com/Zak4b/push_swap_tester/refs/heads/main/tester | bash\n```\n\nor clone the repo:\n\n```bash\ngit clone https://github.com/Zak4b/push_swap_tester.git\ncd push_swap_tester\n./push_swap_tester.sh PUSH_SWAP\n```\n\n-   **PUSH_SWAP**: Path to your `push_swap` executable (default: `./push_swap`).\n\n---\n\n## 🛠️ Features\n\n### Included Tests\n\n1. **Memory Tests (`push_swap_memtest`)**\n\n    - Verifies that your program:\n        - Has no memory leaks.\n        - Properly handles invalid inputs, duplicate arguments, etc.\n\n2. **No Output Test (`push_swap_nooutput`)**\n\n    - Ensures that `push_swap` produces no output when no actions are required.\n\n3. **Correctness Tests (`push_swap_test`)**\n\n    - Tests various input cases to ensure the solution is valid when validated with the `checker` program.\n\n4. **Performance Benchmarking (`push_swap_bench`)**\n    - Measures the number of moves generated by `push_swap` for solving lists of size 5, 100, or 500.\n    - Outputs the minimum, average, and maximum number of moves during the benchmark.\n\n---\n\n## 📋 Example Output\n\n```plaintext\nPush Swap tester\nMemory test\nOK KO OK\n==14952== Memcheck, a memory error detector\n==14952== Copyright (C) 2002-2022, and GNU GPL'd, by Julian Seward et al.\n==14952== Using Valgrind-3.19.0 and LibVEX; rerun with -h for copyright info\n==14952== Command: ./push_swap ''\n==14952==\n==14952==\n==14952== HEAP SUMMARY:\n==14952==     in use at exit: 1 bytes in 1 blocks\n==14952==   total heap usage: 2 allocs, 1 frees, 1 bytes allocated\n==14952==\n==14952== LEAK SUMMARY:\n==14952==    definitely lost: 0 bytes in 0 blocks\n==14952==    indirectly lost: 0 bytes in 0 blocks\n==14952==      possibly lost: 0 bytes in 0 blocks\n==14952==    still reachable: 1 bytes in 1 blocks\n==14952==         suppressed: 0 bytes in 0 blocks\n==14952== Reachable blocks (those to which a pointer was found) are not shown.\n==14952== To see them, rerun with: --leak-check=full --show-leak-kinds=all\n==14952==\n==14952== For lists of detected and suppressed errors, rerun with: -s\n==14952== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)\nTesting 5 values\nOK OK OK KO OK OK OK OK OK\nKO with \"2 1 3 4 5\"\nTesting 100 values\nOK OK OK OK OK OK OK OK OK\nTesting 500 values\nOK OK OK OK OK OK OK OK OK\nPerformance on 5 values\nMinimum: 5\nAverage: 7\nMaximum: 10\nPerformance on 100 values\nMinimum: 587\nAverage: 628\nMaximum: 666\nPerformance on 500 values\nMinimum: 5004\nAverage: 5199\nMaximum: 5376\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzak4b%2Fpush_swap_tester","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzak4b%2Fpush_swap_tester","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzak4b%2Fpush_swap_tester/lists"}