Coder Social home page Coder Social logo

tripouille / libfttester Goto Github PK

View Code? Open in Web Editor NEW
285.0 6.0 45.0 665 KB

Tester for the libft project of 42 school

Home Page: https://github.com/Tripouille

C++ 94.62% Makefile 5.01% Dockerfile 0.36%
libft tester libfttester 42 leaks valgrind tripouille 2019 malloc-size

libfttester's Introduction

libftTester (2019+)

Tester for the libft project of 42 school (with personalized leaks checking on mac, using valgrind on linux)
Clone this tester in your libft repository, or somewhere else and customize the path to your libft project by changing the LIBFT_PATH variable inside the Makefile.

alt text

Commands

make m = launch mandatory tests
make b = launch bonus tests
make a = launch mandatory tests + bonus tests
make [function name] = launch associated test ex: make calloc

make dockerm = launch mandatory tests in linux container
make dockerb = launch bonus tests in linux container
make dockera = launch mandatory tests + bonus tests in linux container
make docker [function name] = launch associated test in linux container ex: make dockercalloc
Thanks to gurival- for the docker idea (https://github.com/grouville/valgrind_42)

make vs [function name] = open the corresponding tests in vscode ex: make vscalloc

Setup docker in goinfre for 42 mac

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 

Outputs

alt text
alt text
alt text

MOK / MKO = test about your malloc size (this shouldn't be tested by moulinette)

Report bugs / Improvement

Contact me on slack or discord : jgambard

libfttester's People

Contributors

brhaka avatar davifarhi avatar evertonportela avatar lepirlouit avatar mirsella avatar opsec-infosec avatar pandaero avatar pioupia avatar rodrigo-br avatar stankudrow avatar thewinterman avatar tripouille avatar wwwwelton avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

libfttester's Issues

Always KO on strlcat (6. 12. tests)

in ft_strlcat_test.cpp in 6. & 12. tests will always KO even if your function is functional
I used strlcat instead of ft_strlcat and still KO also in case 5. you're passing negative value to size_t parameter which is not possible.

I know you made the repo for a long time now but still you could make it clean!

Thank you!

[BUG] `ft_putchar_fd`, `ft_putstr_fd`, `ft_putendl_fd` and ` ft_putnbr_fd` tests timeout

Since the Linux transition for all 42 campus, theses functions timeout without any reason.

It could be a possible bug from all developers in the cursus for the 3 last function, but for ft_putchar_fd which just write a letter in a file its just impossible.

My code is the following:

#include <unistd.h>

void	ft_putchar_fd(char c, int fd)
{
	write(fd, &c, 1);
}

We can't say "This code can timeout". I set here the errors:
Screenshot-from-2023-10-20-09-25-01-min

could not run test.

using ubuntu 20.04 in wsl.
after call make m:

Already up to date.
If all your tests are OK and the moulinette KO you, please run the tester with valgrind (see README)
make -C /home/hui/cardet/libft
make[1]: Entering directory '/home/hui/cardet/libft'
make[1]: 'libft.a' is up to date.
make[1]: Leaving directory '/home/hui/cardet/libft'
[Mandatory]
/usr/bin/ld: /tmp/ft_memset_test-332b90.o: in function main': /home/hui/cardet/libft/libftTester/tests/ft_memset_test.cpp:22: undefined reference to ft_memset'
/usr/bin/ld: /home/hui/cardet/libft/libftTester/tests/ft_memset_test.cpp:24: undefined reference to `ft_memset'
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [Makefile:24: memset] Error 1

Aren't calloc(x,0) != NULL checks too strict?

Hello,
I see that calloc tests 6, 7, 8, 10 and 11 check that the returned pointer is not a NULL when either argument is 0.
The documentation on malloc, calloc... says the following:

"NULL may also be returned by a successful call to malloc() with a size of zero, or by a successful call to calloc() with nmemb or size equal to zero."

My question is: What is the reason behind the check against NULL in the mentioned test cases?
Thank you for making this project, it is very nice and useful.
Bey

Missing check

Hello ! I've been testing my bonus with your tester, but when it comes to ft_lstdelone, the tester doesn't print anything on the term. Looking at the ft_lstdelone_test.cpp file, I see that there is no CHECK function like in all the other *test.cpp files. Is there indeed something missing ? Thanks in advance !

KO: strsplit

A friend get killed in this test in the strsplit and passed in all of ur tests.

char *str = "1-2-3-4-5-6-7-8--8-8--8-4------4--4"
char *sep = '-'

char *str = "--1-2-3-4-5-6-7-8--8-8--8-4------4--4"
char *sep = '-'

Expected result: 1-2-3-4-5-6-7-8-8-8-8-4-4-4

RES[0]: $1$ -> 0x602000000210
RES[1]: $2$ -> 0x602000000230
RES[2]: $3$ -> 0x602000000250
RES[3]: $4$ -> 0x602000000270
RES[4]: $5$ -> 0x602000000290
RES[5]: $6$ -> 0x6020000002b0
RES[6]: $7$ -> 0x6020000002d0
RES[7]: $8$ -> 0x6020000002f0
RES[8]: $8$ -> 0x602000000310
RES[9]: $8$ -> 0x602000000330
RES[10]: $8$ -> 0x602000000350
RES[11]: $4$ -> 0x602000000370
RES[12]: $4$ -> 0x602000000390
RES[13]: $4$ -> 0x6020000003b0
RES[14]: $(null)$ -> (nil)

No rule to make target ' bonus'

I have no problem running mandatory test. But it show error during the bonus part.

make bonus -C ../Libft
make[1]: *** No rule to make target `bonus'. Stop.
make: *** [bonus_start] Error 2

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.