Code Monkey home page Code Monkey logo

ft_printf_tester's Introduction

ft_printf_tester

A easy to use ft_printf project tester for 42 school.

Currently testing (+500 tests)

%d, %i, %c, %s, %x, %X, %p, %u, and string only with the options "-0.*".

How to use

Simply run:

sh run.sh

or

sh run.sh PATH LIB TIMER
  • PATH = Your ft_printf project directory (Default: ../ft_printf)
  • LIB = Your ft_printf library name (Default: libftprintf.a)
  • TIMER = Time to wait after each setup log in seconds (Default: 0)

Default values can be edited in run.sh (From line 3 to 5).

Add tests

  1. Create a new file in tests folder (ex: "my_own_test.c")

  2. Add the below code in:

    #include "../tester.h"
    
    void    my_own_test(t_res *res)
    {
        testing("My own test"); // Only used as separotor for tests
        test(res, printf("[%s !!!]", "my test value"), ft_printf("'%s !!!'", "my test value")); // Real test
    }
  3. Put yout prototype in tester.h (ex: void my_own_test(t_res *res);)

  4. Finnaly call your test in tester.c > main:

    #include "../tester.h"
    
    void    main()
    {
        ...
        my_own_test(res);
        ...
    }

Remark that you can use different char to enclose the string and therefore know which one produced each output. (ex: [] for printf and '' for your function) Feel free to open a pull request to add tests !

Preview

Screen Shot

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.