8000 GitHub - usatie/libft-tester-tokyo: Tester for the libft project of 42 school
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

usatie/libft-tester-tokyo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

59 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

How to use

  1. Clone this repository to the root directory of your libft repository.
  2. Run the make command inside this repository.

1. Clone this repository

$ cd /path/to/your/libft/directory
$ git clone https://github.com/usatie/libft-tester-tokyo.git
$ cd libft-tester-tokyo
  • If you would like to clone this repository to somewhere else, you can. In that case, please run the make command like this.
$ make LIBFT_DIR=/path/to/your/libft/dir

2. Test Mandatory functions

7EC1
$ make all

If you want to test Libft-00 ~ Libft-02, please use below. (Please change part number 00 to same as your project.)

$ make libft-00

Screen Shot 2022-04-18 at 9 34 55

3. Test Bonus functions

$ make bonus

4. Test individual function

$ make strlen
$ make atoi
$ make strnstr

If you want to test functions when trying to Libft-00 ~ Libft-02, please type with suffix .re like below.

$ make strlen.re
$ make atoi.re
$ make strnstr.re

Screen Shot 2022-04-18 at 9 35 27

5. Test Norminette & coding rules

$ make norm

If you want to run norm check for Libft-00 ~ Libft-02, please use below. (Please change part number 00 to same as your project.)

$ make norm00

Screen Shot 2022-04-18 at 15 27 40

Please add more test cases!

Thanks for trying it out! If you notice anything or want to add some test cases, feel free to send issues/PRs!

Sample Code for your first contribution

ASSERT_EQfunctions are very easy to use. Basically the first argument is the actual value and the second argument is the expected value. for creating unit tests

int	main(void)
{
	ASSERT_EQ_I(ft_atoi("123"), 123);
	ASSERT_EQ_I(ft_atoi("-42"), -42);
	
	ASSERT_EQ_STR(ft_itoa(123), "123");
	ASSERT_EQ_STR(ft_itoa(-42), "-42");
	
	int	len = 10;
	char *actual = ft_calloc(len, sizeof(char));
	char *expected = calloc(len, sizeof(char));
	ASSERT_EQ_MEM(actual, expected, len);
}

Thanks predecessors!

This project is inspired by these projects, and many cases are imported from them too. Thanks a lot!

About

Tester for the libft project of 42 school

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •  
0