Skip to content

Commit

Permalink
[libft_assert] add new part
Browse files Browse the repository at this point in the history
  • Loading branch information
Pixailz committed Aug 3, 2023
1 parent 5507a8d commit 9c86019
Show file tree
Hide file tree
Showing 5 changed files with 78 additions and 3 deletions.
4 changes: 2 additions & 2 deletions inc/libft_error.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
/* By: brda-sil <[email protected] +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2022/11/09 00:48:48 by brda-sil #+# #+# */
/* Updated: 2023/08/03 00:57:16 by brda-sil ### ########.fr */
/* Updated: 2023/08/03 02:13:19 by brda-sil ### ########.fr */
/* */
/* ************************************************************************** */

Expand Down Expand Up @@ -79,4 +79,4 @@ int ft_perror(char *msg);

/* ########################################################################## */

#endif
#endif // LIBFT_ERROR_H
45 changes: 45 additions & 0 deletions inc/libft_unit_test.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* libft_unit_test.h :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: brda-sil <[email protected] +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2022/11/09 00:48:48 by brda-sil #+# #+# */
/* Updated: 2023/08/03 02:20:21 by brda-sil ### ########.fr */
/* */
/* ************************************************************************** */

#ifndef LIBFT_UNIT_TEST_H
# define LIBFT_UNIT_TEST_H

/* ########################################################################## */
/* REQUIREMENTS */
/* ############ */

# include "libft_print.h"

/* ########################################################################## */

/* ########################################################################## */
/* CONFIG */
/* ###### */

/* ########################################################################## */

/* ########################################################################## */
/* TYPEDEF */
/* ####### */

/* ########################################################################## */

/* ########################################################################## */
/* FILES */
/* ##### */

// unit_test/ft_assert.c
void ft_assert(void);

/* ########################################################################## */

#endif // LIBFT_UNIT_TEST
7 changes: 6 additions & 1 deletion mk/config.mk
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,12 @@ MULTIPLE := 1
# dependecies
PRINT := 1
endif

ifeq ($(findstring unit_test,$(MAKECMDGOALS)),unit_test)
UNIT_TEST := 1
MULTIPLE := 1
# dependecies
PRINT := 1
endif
ifeq ($(MULTIPLE), 0)
ALL := 1
endif
Expand Down
7 changes: 7 additions & 0 deletions mk/srcs.mk
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,9 @@ SRC_NET_IPV4 := network/ipv4/ft_ipstr.c \
### ERROR
SRC_ERR := error/ft_perror.c

### ERROR
SRC_UNI_TEST := unit_test/ft_assert.c

## if all, add all base to SRC_C
ifeq ($(ALL),1)
SRC_C += $(SRC_INT)
Expand All @@ -141,6 +144,7 @@ SRC_C += $(SRC_RDM)
SRC_C += $(SRC_LNX)
SRC_C += $(SRC_NET_IPV4)
SRC_C += $(SRC_ERR)
SRC_C += $(SRC_UNI_TEST)

## add base part to SRC_C
else
Expand Down Expand Up @@ -177,6 +181,9 @@ endif
ifeq ($(ERROR),1)
SRC_C += $(SRC_ERROR)
endif
ifeq ($(UNIT_TEST),1)
SRC_C += $(SRC_UNI_TEST)
endif
endif

# OBJ
Expand Down
18 changes: 18 additions & 0 deletions src/unit_test/ft_assert.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_assert.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: brda-sil <[email protected] +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2023/08/03 02:14:34 by brda-sil #+# #+# */
/* Updated: 2023/08/03 02:20:39 by brda-sil ### ########.fr */
/* */
/* ************************************************************************** */

#include "libft_unit_test.h"

void ft_assert(void)
{
return ;
}

0 comments on commit 9c86019

Please sign in to comment.