Skip to content

Yet Another Push Swap Tester is a tester for the Push Swap project. This tool automates the testing of your push_swap program by running a variety of test cases, including error handling, edge cases, and performance benchmarks. It also verifies the correctness of the output using the provided checker binaries.

License

Notifications You must be signed in to change notification settings

nerraf-dev/yapst

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

YAPSTester

Yet Another Push Swap Tester is a tester for the Push Swap project. This tool automates the testing of your push_swap program by running a variety of test cases, including error handling, edge cases, and performance benchmarks. It also verifies the correctness of the output using the provided checker binaries.


Table of Contents

  1. Description
  2. Features
  3. Requirements
  4. Setup
  5. Usage
  6. Test Categories
  7. Contributing
  8. License

Description

The YAPST project is designed to simplify the testing process for the Push Swap program. It ensures that your program handles various scenarios correctly, including invalid inputs, edge cases, and large datasets. The tester also evaluates the performance of your program by counting the number of operations performed.

The tool checks for the presence of the push_swap, checker_OS, and optional checker binaries in the project directory. It uses these binaries to validate the output of your program.


Features

  • Error Handling Tests: Verifies how your program handles invalid inputs.
  • Edge Case Tests: Tests scenarios like single elements, sorted inputs, and boundary values.
  • Performance Benchmarks: Measures the number of operations for datasets of varying sizes.
  • Randomized Tests: Generates random test cases for additional robustness.
  • Bonus Checker Support: Optionally validates results using a bonus checker binary.

Requirements

  • Python 3.6 or higher
  • push_swap and checker binaries
  • A Unix-based system (Linux or macOS)

Setup

  1. Clone this repository into your push_swap project directory:
    git clone https://github.com/nerraf-dev/yapst.git
  2. Copy test_push_swap.sh into your push_swap project directory:
    cp -r yapst/test_push_swap.sh .
  3. Ensure the push_swap and checker executables are in the same directory as test_push_swap.sh:
    push_swap
    ├── Makefile
    ├── push_swap
    ├── checker
    ├── checker_OS
    ├── test_push_swap.sh
    ├── src
    │   └── push_swap .c files
    └── tester
        └── tester .py files
    
  4. Make the script executable:
    chmod +x test_push_swap.sh
  5. Run the script:
    ./test_push_swap.sh

Usage

  1. Run the script:
    ./test_push_swap.sh
  2. The script will automatically:
    • Check for the presence of the required binaries (push_swap, checker, and checker_OS).
    • Run various test cases.
    • Display results, including the number of operations and any errors.
  3. To test specific scenarios, modify the test cases in the tester/tests.py file

Test Categories

The tester includes the following categories of tests:

  1. Error Handling: Ensures invalid inputs are handled gracefully.
  2. Edge Cases: Tests scenarios like single elements, sorted inputs, and boundary values.
  3. Almost Sorted: Evaluates performance on nearly sorted datasets.
  4. Descending Order: Tests reverse-sorted inputs.
  5. Random Order: Generates random datasets for testing.
  6. Benchmarks: Measures performance on datasets of sizes 3, 5, 100, and 500.

Contributing

Contributions are welcome! If you have ideas for new test cases or improvements, feel free to submit a pull request.

License

This project is licensed under the MIT License. See the LICENSE file for details.

Notes

Ensure that the push_swap and checker binaries are compiled and functional before running the tester. For bonus validation, include the checker binary in the project directory.

About

Yet Another Push Swap Tester is a tester for the Push Swap project. This tool automates the testing of your push_swap program by running a variety of test cases, including error handling, edge cases, and performance benchmarks. It also verifies the correctness of the output using the provided checker binaries.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published