[Libft] Test Program

이대현·2020년 4월 11일
1

42SEOUL

목록 보기
5/27
  • Libftest
    위 저장소의 테스트 프로그램을 사용했다. 가장 기본적이고, bonus 파트의 함수들까지 테스트가 가능하다.

This repository contains script to test your libft project. The script will do the following tests :

  • Check if libft.h exists
  • Check norme of libft.h
  • Check if the Makefile file exists
  • Check rules in Makefile
  • Check compilation's flag in Makefile
  • Compil library (파트1, 2, 보너스 모두 Make로 컴파일)
  • Check norme errors
  • Check forbidden functions
  • Tests functions

At the end of the tests, a deepthought file will be created, inside which you can find all the results and error/failure messages. You can also see your results in tests directory.

The script will compil your files with your libft, so you must have your Makefile up to date.

⚠️All the tests made are not the official tests⚠️

1. Getting Started

Installation

git clone https://github.com/jtoty/Libftest

2. Running script

Run the script from the directory where you cloned

bash grademe.sh

Configuration

최초에 script를 실행시키면 my_config.sh file 파일이 자동으로 생성된고, 거기서 내 libft 프로젝트의 경로를 지정해준다.

3. 나의 사용법

  • check_compilation.sh 파일에서 compilation() 함수의 clanggcc로 바꿔줬다.

  • 아니면 우분투에 clang 설치하는 방법도 있다.

    Ubuntu에 gcc 8, clang 6 설치하기

  • KO가 뜬 함수는 Libftest/test/각함수별폴더 에서 output파일과 user_output 파일을 비교하며 수정해준다. 생각지도 못했던 테스트케이스가 많았다.

  • 몇몇 문제는 main함수 자체의 수정이 필요하기도 했다. ft_memchr 나 ft_spilt 등.

4. 다른 좋은 테스트 프로그램들

  • libft-unit-test
    메모리 누수, segmentation fault, 오버플로우 여부를 확인할 수 있다. 실제 함수들과의 처리 속도를 비교해주는 bench mode도 지원한다.
  • libft-war-machine
    워머신 이름값 한다. 세 개의 테스트 프로그램 중 가장 깐깐하게 체크한다. 여기서 OK 떴으면 뮬리넷도 OK를 준다. 다만 bonus 파트를 지원하지 않는 점이 아쉽다.
profile
삽질의 기록들 👨‍💻

0개의 댓글