-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit aef1200
Showing
8 changed files
with
212 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
name: Continuous Integration | ||
on: | ||
push: | ||
jobs: | ||
norm: | ||
name: norminette | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v2 | ||
- name: Install dependencies | ||
run: | | ||
python3 -m pip install --upgrade pip setuptools | ||
python3 -m pip install norminette | ||
- name: Run Norminette | ||
run: make norm |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
# Prerequisites | ||
*.d | ||
|
||
# Object files | ||
*.o | ||
*.ko | ||
*.obj | ||
*.elf | ||
|
||
# Linker output | ||
*.ilk | ||
*.map | ||
*.exp | ||
|
||
# Precompiled Headers | ||
*.gch | ||
*.pch | ||
|
||
# Libraries | ||
*.lib | ||
*.a | ||
*.la | ||
*.lo | ||
|
||
# Shared objects (inc. Windows DLLs) | ||
*.dll | ||
*.so | ||
*.so.* | ||
*.dylib | ||
|
||
# Executables | ||
*.exe | ||
*.out | ||
*.app | ||
*.i*86 | ||
*.x86_64 | ||
*.hex | ||
|
||
# Debug files | ||
*.dSYM/ | ||
*.su | ||
*.idb | ||
*.pdb | ||
|
||
# Kernel Module Compile Results | ||
*.mod* | ||
*.cmd | ||
.tmp_versions/ | ||
modules.order | ||
Module.symvers | ||
Mkfile.old | ||
dkms.conf | ||
|
||
# Vscode | ||
.vscode/ | ||
|
||
# Build Directory | ||
build/ | ||
|
||
# Executable File | ||
push_swap | ||
checker_Mac | ||
tester | ||
|
||
# Subject File | ||
en.subject.pdf | ||
|
||
# Google Test Source | ||
gtest/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
[submodule "libft"] | ||
path = libft | ||
url = [email protected]:rask24/libft |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
NAME = push_swap | ||
CFLAGS = -Werror -Wextra -Wall -O3 | ||
NORM = norminette | ||
|
||
SRC_DIR = ./src | ||
BUILD_DIR = ./build | ||
INC_DIR = ./include | ||
LIBFT_DIR = ./libft | ||
SRC = $(SRC_DIR)/main.c | ||
OBJ = $(patsubst $(SRC_DIR)/%.c, $(BUILD_DIR)/%.o, $(SRC)) | ||
DEP = $(patsubst $(SRC_DIR)/%.c, $(BUILD_DIR)/%.d, $(SRC)) | ||
DEPFLAGS = -MMD -MP | ||
INCLUDE = -I $(INC_DIR) | ||
|
||
GTEST_VERSION = 1.8.0 | ||
GTEST_DIR = ./gtest | ||
GTEST = $(GTEST_DIR)/gtest $(GTEST_DIR)/googletest-release-$(GTEST_VERSION) | ||
TEST_DIR = ./test | ||
TEST_SRC = $(TEST_DIR)/test.cpp | ||
TEST_COMPILE = clang++ -std=c++11 \ | ||
$(TEST_SRC) \ | ||
$(GTEST_DIR)/googletest-release-$(GTEST_VERSION)/googletest/src/gtest_main.cc \ | ||
$(GTEST_DIR)/gtest/gtest-all.cc \ | ||
-I $(GTEST_DIR) $(INCLUDE) -L $(LIBFT_DIR) -l ft -lpthread -o tester | ||
|
||
GREEN = \033[0;32m | ||
BLUE = \033[0;34m | ||
RED = \033[0;31m | ||
RESET = \033[0m | ||
|
||
all: title $(NAME) | ||
|
||
$(NAME): $(OBJ) | ||
@printf "\n" | ||
@make -C $(LIBFT_DIR) | ||
@$(CC) $^ -o $@ | ||
|
||
$(BUILD_DIR)/%.o: $(SRC_DIR)/%.c | ||
@mkdir -p $(@D) | ||
@$(CC) $(CFLAGS) $(INCLUDE) $(DEPFLAGS) -c $< -o $@ | ||
@printf "$(GREEN).$(RESET)" | ||
|
||
clean: | ||
@make clean -C $(LIBFT_DIR) | ||
@$(RM) $(OBJ) | ||
|
||
fclean: clean | ||
@make fclean -C $(LIBFT_DIR) | ||
@$(RM) $(NAME) | ||
|
||
re: fclean all | ||
|
||
test: $(GTEST) | ||
@echo "$(BLUE)test$(RESET)" | ||
@$(TEST_COMPILE) | ||
@./tester # --gtest_filter=Vector.other | ||
|
||
$(GTEST): | ||
@curl -OL https://github.com/google/googletest/archive/refs/tags/release-$(GTEST_VERSION).tar.gz | ||
@tar -xvzf release-$(GTEST_VERSION).tar.gz googletest-release-$(GTEST_VERSION) | ||
@$(RM) release-$(GTEST_VERSION).tar.gz | ||
@python3 googletest-release-$(GTEST_VERSION)/googletest/scripts/fuse_gtest_files.py $(GTEST_DIR) | ||
@mv googletest-release-$(GTEST_VERSION) $(GTEST_DIR) | ||
|
||
norm: | ||
$(NORM) $(INC_DIR) $(SRC_DIR) $(LIBFT_DIR) | ||
|
||
title: | ||
@echo "$(BLUE)push_swap$(RESET)" | ||
|
||
.PHONY: all clean fclean re | ||
|
||
-include $(DEP) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
/* ************************************************************************** */ | ||
/* */ | ||
/* ::: :::::::: */ | ||
/* push_swap.h :+: :+: :+: */ | ||
/* +:+ +:+ +:+ */ | ||
/* By: reasuke <[email protected]> +#+ +:+ +#+ */ | ||
/* +#+#+#+#+#+ +#+ */ | ||
/* Created: 2024/01/10 12:37:54 by reasuke #+# #+# */ | ||
/* Updated: 2024/01/10 14:55:50 by reasuke ### ########.fr */ | ||
/* */ | ||
/* ************************************************************************** */ | ||
|
||
#ifndef PUSH_SWAP_H | ||
# define PUSH_SWAP_H | ||
|
||
# include <unistd.h> | ||
# include <stdlib.h> | ||
|
||
// TODO: delete | ||
# include <stdio.h> | ||
|
||
# include "../libft/libft.h" | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
/* ************************************************************************** */ | ||
/* */ | ||
/* ::: :::::::: */ | ||
/* main.c :+: :+: :+: */ | ||
/* +:+ +:+ +:+ */ | ||
/* By: reasuke <[email protected]> +#+ +:+ +#+ */ | ||
/* +#+#+#+#+#+ +#+ */ | ||
/* Created: 2024/01/10 12:37:36 by reasuke #+# #+# */ | ||
/* Updated: 2024/01/10 14:59:00 by reasuke ### ########.fr */ | ||
/* */ | ||
/* ************************************************************************** */ | ||
|
||
#include "push_swap.h" | ||
|
||
int main(void) | ||
{ | ||
printf("This is push_swap main file.\n"); | ||
return (0); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#include "gtest/gtest.h" | ||
|
||
extern "C" { | ||
#include "push_swap.h" | ||
} | ||
|
||
TEST(FunctionTest, Case) {} |