mirror of
https://codeberg.org/la-chouette/minishell.git
synced 2025-12-06 07:28:09 +01:00
tests: implement a better integration test framework than shellspec
(for our usecase at least)
This commit is contained in:
parent
1f03cbbedb
commit
36c1b72eff
6 changed files with 148 additions and 75 deletions
59
Makefile
59
Makefile
|
|
@ -82,7 +82,8 @@ minishell_objs = $(addsuffix .o,src/$(NAME)) $(objs)
|
|||
all_objs = $(minishell_objs)
|
||||
deps = $(all_objs:.o=.d)
|
||||
|
||||
.PHONY: all clean fclean re norm tests ctests ctestsa ctestsub ctestst alla allub allt
|
||||
.PHONY: all clean fclean re norm tests ctests ctestsa ctestsub ctestst alla \
|
||||
allub allt testsa testsub testst inttests inttestsa inttestsub inttestst
|
||||
|
||||
all: $(NAME)
|
||||
|
||||
|
|
@ -116,24 +117,48 @@ norm:
|
|||
norminette src libft | grep -v OK || true
|
||||
|
||||
tests:
|
||||
@echo "Running tests with AddressSanitizer..."
|
||||
+CFLAGS="$(CFLAGS) $(ASAN)" make re
|
||||
shellspec
|
||||
+make ctestsa
|
||||
|
||||
@echo "Running tests with UndefinedBehaviourSanitizer..."
|
||||
+CFLAGS="$(CFLAGS) $(UBSAN)" make re
|
||||
shellspec
|
||||
+make ctestsub
|
||||
|
||||
@echo "Running tests with ThreadSanitizer..."
|
||||
+CFLAGS="$(CFLAGS) $(TSAN)" make re
|
||||
shellspec
|
||||
+make ctestst
|
||||
|
||||
+make fclean
|
||||
+make testsa
|
||||
+make fclean
|
||||
+make testsub
|
||||
+make fclean
|
||||
+make testst
|
||||
@echo "All tests passed!"
|
||||
|
||||
ctests: $(LIBFT)
|
||||
testsa: CFLAGS += $(ASAN)
|
||||
testsa:
|
||||
@echo "Running tests with AddressSanitizer..."
|
||||
+make inttests
|
||||
+make ctests
|
||||
|
||||
testsub: CFLAGS += $(UBSAN)
|
||||
testsub: all
|
||||
@echo "Running tests with UndefinedBehaviourSanitizer..."
|
||||
+make inttests
|
||||
+make ctests
|
||||
|
||||
testst: CFLAGS += $(TSAN)
|
||||
testst: all
|
||||
@echo "Running tests with ThreadSanitizer..."
|
||||
+make inttests
|
||||
+make ctests
|
||||
|
||||
inttests: all
|
||||
./test.sh
|
||||
|
||||
inttestsa: CFLAGS += $(ASAN)
|
||||
inttestsa: all
|
||||
./test.sh
|
||||
|
||||
inttestsub: CFLAGS += $(UBSAN)
|
||||
inttestsub: all
|
||||
./test.sh
|
||||
|
||||
inttestst: CFLAGS += $(TSAN)
|
||||
inttestst: all
|
||||
./test.sh
|
||||
|
||||
ctests: $(LIBFT) all
|
||||
+make -C tests
|
||||
|
||||
ctestsa: CFLAGS += $(ASAN)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue