GithubHelp home page GithubHelp logo

ft_printf-tester's Introduction

ft_printf-tester(2021+)

This is a tester for the ft_printf project of 42 school. Clone this tester in your ft_printf repository. And prepare CMakeLists.txt for every your repository you use.

only the 'mandatory' part is supported now

dependency

  • cmake
  • g++

How to prepare your test (commands)

cd /path/to/ft_printf
git clone https://github.com/AkkyOrz/ft_printf-tester.git
cd ft_printf-tester
cp ./ft_printf/CMakeLists.txt ../
cp ./ft_printf/libft/CMakeLists.txt ../libft/
cmake -S . -B build && cmake --build build && ./build/main

How to prepare your test

Prepare CMakeLists.txt every in your repository to create your library.

For example, add CMakeLists.txt like below in your libft repository.

ft_printf/libft/CMakeLists.txt (cp ./ft_printf/libft/CMakeLists.txt ../ )

cmake_minimum_required(VERSION 3.14)
set(CMAKE_CXX_STANDARD 11)
project(libft)
add_compile_options(-Wall -Wextra -Werror)
file(GLOB LIBFT "ft_*.c") # you can include files explicitly
add_library(libft STATIC ${LIBFT})

ft_printf/CMakeLists.txt

(cp ./ft_printf/libft/CMakeLists.txt ../libft/ )

cmake_minimum_required(VERSION 3.14)
project(ft_printf)
set(CMAKE_CXX_STANDARD 11)
add_subdirectory(libft) # path to libft
add_compile_options(-Wall -Wextra -Werror)
add_library(libftprintf STATIC ft_printf.c)

my directories

$ tree
.
├── CMakeLists.txt
├── ft_printf-tester
│  ├── build
│  ├── CMakeLists.txt
│  ├── main.cpp
│  └── README.md
├── ft_printf.c
├── ft_printf.h
├── libft
│  ├── CMakeLists.txt # new
│  ├── ft_atoi.c
│  ├── ft_bzero.c
|  ...
│  ├── ft_toupper.c
│  ├── libft.h
│  └── Makefile
└── Makefile

command

replace ./build/main to your executable file.

cmake -S . -B build && cmake --build build && ./build/main

CMake installation

on macOS without root

install in ~/bin folder

mkdir ~/bin
curl -LO https://github.com/Kitware/CMake/releases/download/v3.21.2/cmake-3.21.2-macos-universal.tar.gz
tar xf cmake-3.21.2-macos-universal.tar.gz
cd cmake-3.21.2-macos-universal
mv ./CMake.app ~
echo "export PATH=$HOME/CMake.app/Contents/bin:$PATH" >> ~/.zshrc
source ~/.zshrc

on macOS with MacPorts or brew

sudo port install cmake
brew install cmake

cmake is maybe installed in /usr/loca/bin

on Ubuntu

you can install via snap, apt or compile with src

ft_printf-tester's People

Contributors

akkyorz avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.