From 2f6fa60665fbdd79542429419a1d63c4b0ea25a0 Mon Sep 17 00:00:00 2001 From: LaEntropiaa Date: Sun, 15 Mar 2026 20:31:36 -0600 Subject: [PATCH] Starting stack --- .gitignore | 149 ++++++++++++++++++++++++++++++++++++++++++++ CMakeLists.txt | 32 ++++++++++ include/stack.h | 8 +++ src/main.cpp | 6 ++ test/CMakeLists.txt | 38 +++++++++++ test/test_stack.cpp | 0 6 files changed, 233 insertions(+) create mode 100644 .gitignore create mode 100644 CMakeLists.txt create mode 100644 include/stack.h create mode 100644 src/main.cpp create mode 100644 test/CMakeLists.txt create mode 100644 test/test_stack.cpp diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..6129d0a --- /dev/null +++ b/.gitignore @@ -0,0 +1,149 @@ +##Doxygen +docs +Doxyfile +images + +# Prerequisites +*.d + +# Compiled Object files +*.slo +*.lo +*.o +*.obj + +# Precompiled Headers +*.gch +*.pch + +# Linker files +*.ilk + +# Debugger Files +*.pdb + +# Compiled Dynamic libraries +*.so +*.dylib +*.dll +*.so.* + + +# Fortran module files +*.mod +*.smod + +# Compiled Static libraries +*.lai +*.la +*.a +*.lib + +# Executables +*.exe +*.out +*.app + +# Build directories +build/ +Build/ +build-*/ +out +out/Debug + +# CMake generated files +CMakeFiles/ +CMakeCache.txt +cmake_install.cmake +Makefile +install_manifest.txt +compile_commands.json + +# Temporary files +*.tmp +*.log +*.bak +*.swp + +# vcpkg +vcpkg_installed/ + +# debug information files +*.dwo + +# test output & cache +Testing/ +.cache/Doxygen +docs +Doxyfile +images + +# Prerequisites +*.d + +# Compiled Object files +*.slo +*.lo +*.o +*.obj + +# Precompiled Headers +*.gch +*.pch + +# Linker files +*.ilk + +# Debugger Files +*.pdb + +# Compiled Dynamic libraries +*.so +*.dylib +*.dll +*.so.* + + +# Fortran module files +*.mod +*.smod + +# Compiled Static libraries +*.lai +*.la +*.a +*.lib + +# Executables +*.exe +*.out +*.app + +# Build directories +build/ +Build/ +build-*/ + +# CMake generated files +CMakeFiles/ +CMakeCache.txt +cmake_install.cmake +Makefile +install_manifest.txt +compile_commands.json + +# Temporary files +*.tmp +*.log +*.bak +*.swp + +# vcpkg +vcpkg_installed/ + +# debug information files +*.dwo + +# test output & cache +Testing/ +.cache/ diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000..f880cae --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,32 @@ +cmake_minimum_required(VERSION 3.16) + +project(StackProject + VERSION 1.0 + LANGUAGES CXX +) + +set(CMAKE_CXX_STANDARD 23) +set(CMAKE_CXX_STANDARD_REQUIRED ON) +set(CMAKE_CXX_EXTENSIONS OFF) + +set(CMAKE_EXPORT_COMPILE_COMMANDS ON) + +add_compile_options( + -Wall + -Wextra + -Wpedantic +) + + +add_executable(main_exec + src/main.cpp +) + +target_include_directories(main_exec + PRIVATE + ${PROJECT_SOURCE_DIR}/include +) + +enable_testing() + +add_subdirectory(test) diff --git a/include/stack.h b/include/stack.h new file mode 100644 index 0000000..df6982b --- /dev/null +++ b/include/stack.h @@ -0,0 +1,8 @@ +#ifndef STACK_H +#define STACK_H + +class Stack { + +}; + +#endif // !ST diff --git a/src/main.cpp b/src/main.cpp new file mode 100644 index 0000000..bb7c2e7 --- /dev/null +++ b/src/main.cpp @@ -0,0 +1,6 @@ +#include + +int main(void) { + std::print("hola"); + return 0; +} diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt new file mode 100644 index 0000000..04366af --- /dev/null +++ b/test/CMakeLists.txt @@ -0,0 +1,38 @@ +include(FetchContent) + +FetchContent_Declare( + Catch2 + GIT_REPOSITORY https://github.com/catchorg/Catch2.git + GIT_TAG v3.5.3 +) + +FetchContent_MakeAvailable(Catch2) + +add_executable(test_stack + test_stack.cpp +) + +target_include_directories(test_stack + PRIVATE + ${PROJECT_SOURCE_DIR}/include +) + +target_link_libraries(test_stack + PRIVATE + Catch2::Catch2WithMain +) + +target_compile_options(test_stack PRIVATE + -fsanitize=address + -fno-omit-frame-pointer + -g +) + +target_link_options(test_stack PRIVATE + -fsanitize=address +) + +include(CTest) +include(Catch) + +catch_discover_tests(test_stack) diff --git a/test/test_stack.cpp b/test/test_stack.cpp new file mode 100644 index 0000000..e69de29