build(test): now working with tmux to test
This commit is contained in:
parent
68a46be858
commit
d7b66ac843
2 changed files with 15 additions and 3 deletions
16
Makefile
16
Makefile
|
|
@ -63,8 +63,7 @@ clean:
|
||||||
# Clean (make fclean)
|
# Clean (make fclean)
|
||||||
fclean: clean
|
fclean: clean
|
||||||
@printf '$(GREY) Removing $(END)$(RED)Program$(END)\n'
|
@printf '$(GREY) Removing $(END)$(RED)Program$(END)\n'
|
||||||
@$(RM) $(NAME)
|
@$(RM) $(NAME) @echo ""
|
||||||
@echo ""
|
|
||||||
|
|
||||||
# Restart (make re)
|
# Restart (make re)
|
||||||
re: header fclean all
|
re: header fclean all
|
||||||
|
|
@ -84,9 +83,20 @@ $(OBJDIRNAME)/%.o: %.cpp
|
||||||
debug: CPPFLAGS += -D DEBUG=1
|
debug: CPPFLAGS += -D DEBUG=1
|
||||||
debug: re
|
debug: re
|
||||||
|
|
||||||
|
SESSION = test-irc
|
||||||
test: debug
|
test: debug
|
||||||
@printf '$(GREY) now running with\n\t- Port:\t\t$(GREEN)4243$(GREY)\n\t- Password:\t$(GREEN)irc$(END)\n'
|
@printf '$(GREY) now running with\n\t- Port:\t\t$(GREEN)4243$(GREY)\n\t- Password:\t$(GREEN)irc$(END)\n'
|
||||||
@./$(NAME) 4243 irc
|
@if tmux has-session -t $(SESSION) 2>/dev/null; then \
|
||||||
|
echo "→ Killing existing session '$(SESSION)'…"; \
|
||||||
|
tmux kill-session -t $(SESSION); \
|
||||||
|
fi
|
||||||
|
@tmux new-session -d -s $(SESSION) \
|
||||||
|
'bash -lc "./$(NAME) 4243 irc; exec bash"'
|
||||||
|
@tmux split-window -h -p 70 -t $(SESSION):1 \
|
||||||
|
'bash -lc "irssi 4243 irc --color=on; exec yes irssi"'
|
||||||
|
@tmux split-window -v -p 50 -t $(SESSION):1.2 \
|
||||||
|
'bash -lc "nc localhost 4243; exec yes netcat"'
|
||||||
|
@tmux attach -t $(SESSION)
|
||||||
|
|
||||||
# Header
|
# Header
|
||||||
header:
|
header:
|
||||||
|
|
|
||||||
2
main.cpp
2
main.cpp
|
|
@ -10,5 +10,7 @@ int main(int argc, char *argv[]) {
|
||||||
std::cout << CLR_GREY << "Port:\t\t" << CLR_GREEN << argv[1] << CLR_RESET << std::endl;
|
std::cout << CLR_GREY << "Port:\t\t" << CLR_GREEN << argv[1] << CLR_RESET << std::endl;
|
||||||
std::cout << CLR_GREY << "Password:\t" << CLR_GREEN << argv[2] << CLR_RESET << std::endl;
|
std::cout << CLR_GREY << "Password:\t" << CLR_GREEN << argv[2] << CLR_RESET << std::endl;
|
||||||
}
|
}
|
||||||
|
while (1)
|
||||||
|
;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue