Francinette Documentation

repository·master·Indexed 20 days ago

https://github.com/xicodomingues/francinette

A local testing framework for 42 school projects that automates norminette checks, code compilation, and test batteries to simulate the official 'moulinette' environment. It supports projects such as libft, ft_printf, get_next_line, minitalk, and pipex, and includes a strict mode with NULL_CHECK for memory allocation failure testing.

Tokens
2.6K
Snippets
13
Records
15
Agent score
70%

What's inside Francinette

  1. Understand NULL_CHECK in strict mode

    master
    In strict mode, NULL_CHECK is a testing mechanism that forces every malloc call to fail and return NULL instead of a valid pointer. This is used to ensure your code correctly handles memory allocation failures and does not cause segmentation faults when malloc returns NULL.
  2. Uninstall Francinette

    master

    To completely remove Francinette, follow these two steps:

    1. Delete the francinette folder located in your $HOME directory.
    2. Remove the aliases from your shell configuration file (e.g., ~/.zshrc or ~/.bashrc).
    # Remove these lines from ~/.zshrc or ~/.bashrc
    alias francinette="$HOME"/francinette/tester.sh
    alias paco="$HOME"/francinette/tester.sh
  3. Run Francinette tests

    master

    To run tests, navigate to your project folder and use the francinette command or its shorthand paco. The tool identifies the project by looking for a Makefile containing the project name or expected delivery files.

    Supported projects include: libft, ft_printf, get_next_line, minitalk, and pipex.

    # Run all tests for the current project
    francinette
    paco
    
    # Run tests for a specific exercise within a project (e.g., C00 ex00)
    francinette ex00
    
    # Run specific tests for a project (e.g., libft memset)
    paco memset isalpha memcpy
    
    # Run tests by cloning a remote git repository
    francinette git@repo42.com/intra-uuid-234
    
    # Show help
    francinette -h
    paco -h
  4. Install Francinette

    master

    Francinette provides an automatic installer that downloads the repository, creates necessary folders and aliases, and installs a dedicated Python virtual environment. On Linux, it may require admin permissions to install necessary system packages. The installation directory will be located at $HOME/francinette.

    bash -c "$(curl -fsSL https://raw.github.com/xicodomingues/francinette/master/bin/install.sh)"
  5. Update Francinette

    master

    You can update Francinette when prompted, or force an update using the -u flag. If the CLI flag fails, you can use the remote update script.

    # Force update via CLI
    francinette -u
    
    # Force update via remote script
    bash -c "$(curl -fsSL https://raw.github.com/xicodomingues/francinette/master/bin/update.sh)"
  6. Clone exercises from a Git repository

    master

    If you provide a Git repository URL as the first argument, Francinette will clone that repository to use as the source for exercises. If the provided string is not a valid Git repository, it will be treated as an exercise name instead.

    When cloning, Francinette creates a copy of the repository under a directory named after your Git username and the project name to avoid conflicts.

    francinette git@github.com:user/repo.git
  7. Install francinette via the installation script

    master

    To install francinette, run the installation script which clones the repository, installs system dependencies (C compilers, Python, etc.), sets up a Python virtual environment, and configures shell aliases.

    Note on System Dependencies:

    • On Ubuntu, the script installs gcc, clang, libpq-dev, libbsd-dev, libncurses-dev, valgrind, and Python development tools via apt.
    • On Arch, the script installs gcc, clang, postgresql, libbsd, ncurses, valgrind, and python-pip via pacman.
    • On macOS (Darwin), it assumes necessary system tools are already present.

    Shell Configuration: After installation, the script attempts to add aliases to your .bashrc or .zshrc (depending on your OS and shell).

    # Note: The provided file is a script content. To use it, you would typically download it or clone the repo and run it.
    # Assuming you have cloned the repo:
    ./bin/install.sh
  8. Update francinette installation

    master

    To update your existing francinette installation to the latest version from the remote repository, run the update.sh script located in the bin/ directory. This script performs a hard reset to the latest origin, updates submodules, and reinstalls Python dependencies via pip3 within the project's virtual environment.

    Note: On non-Darwin (Linux) systems, the script may attempt to use sudo apt install to install libbsd-dev and libncurses-dev if admin permissions are required for newer packages.

    ./bin/update.sh
  9. Troubleshoot 'command not found: francinette'

    master

    If the command is not recognized after installation, the shell aliases might not have been applied to your current shell configuration. Manually add the following aliases to your ~/.zshrc (macOS) or ~/.bashrc (Linux) file:

    alias francinette="$HOME"/francinette/tester.sh
    alias paco="$HOME"/francinette/tester.sh
  10. Francinette file locations and logs

    master

    If you encounter unexpected behavior, you can inspect the working directories and logs:

    • Temporary working directory: ~/francinette/temp/<project> (where norminette is checked, code is compiled, and tests are executed).
    • Log files: ~/francinette/logs.
  11. Reference: Francinette CLI Flags and Options

    master

    The following flags and arguments are available for the francinette command-line interface:

    Arguments:
      git_repo             If present, uses this repository to clone exercises from.
      exercise             If present, executes the passed tests (e.g., ex01).
    
    Options:
      -v, --verbose        Activates verbose mode (debug).
      -u, --update         Forces francinette to update.
      -s, --strict         Restricts tests around memory allocation (checks nulls and reserves correct amount).
      -m, --mandatory      Executes tests for the mandatory part only.
      -b, --bonus          Executes tests for the bonus part.
      -tm, --timeout <sec> Sets a new timeout in seconds.
      -c, --clean          Executes a script to clean caches and temporary files.
      -in, --ignore-norm   Prevents norminette from being executed.
      -t, --testers <list> Executes specific testers. Note: This must be the last parameter in the command line.