gnlTester

repository·master·Indexed 41 days ago

https://github.com/tripouille/gnltester

A testing suite for the 'get next line' project at 42 School. It supports Linux and macOS, offering local testing and Docker-based testing for Valgrind leak checking, SIGSEGV handling, and timeouts.

Tokens
696
Snippets
4
Records
5
Agent score
2%

What's inside gnlTester

  1. Understand gnlTester test outputs

    master
    The tester provides visual feedback on test results. Note that MOK or MKO outputs refer to tests regarding your malloc size; these are intended for your own verification and are not typically tested by the Moulinette.
  2. Build tests in parallel for faster execution

    master

    You can speed up the build process by using the Makefile's job flag to build in parallel. Use the command corresponding to your operating system to detect the number of available CPU cores.

    # On Linux
    make -j$(nproc) m
    
    # On macOS
    make -j$(sysctl -n hw.ncpu) m
  3. Setup Docker in goinfre for 42 Mac

    master

    If you are using a 42 Mac environment, use these commands to set up Docker in the goinfre directory to manage space and permissions correctly. This involves removing existing Docker configurations and creating symbolic links to the goinfre directory.

    rm -rf ~/Library/Containers/com.docker.docker
    rm -rf ~/.docker
    rm -rf /goinfre/${USER}/docker /goinfre/${USER}/agent
    mkdir -p /goinfre/${USER}/docker /goinfre/${USER}/agent
    ln -s /goinfre/${USER}/agent ~/Library/Containers/com.docker.docker
    ln -s /goinfre/${USER}/docker ~/.docker
  4. Install gnlTester

    master

    To use gnlTester, clone this repository directly into your get_next_line project directory. The tester is compatible with both Linux and macOS and includes features like SIGSEGV handling and timeouts for the mandatory part.

    git clone <repository_url> <path_to_your_get_next_line_folder>
  5. Run gnlTester commands

    master

    Use the following make commands to execute different test suites. You can run tests locally or inside a Linux container via Docker for more rigorous testing (recommended for Valgrind usage).

    # Local tests
    make m          # Launch mandatory tests
    make b          # Launch bonus tests
    make a          # Launch mandatory + bonus tests
    
    # Docker tests (Recommended for rigorous testing with Valgrind)
    make dockerm    # Launch mandatory tests in Linux container
    make dockerb    # Launch bonus tests in Linux container
    make dockera    # Launch mandatory + bonus tests in Linux container