• Stars
    star
    447
  • Rank 97,700 (Top 2 %)
  • Language
    C
  • Created about 9 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

libft Unit tests

⚠️ Important note: this version targets the new 42 subject of libft, if you want to use the old one you can access it on the old branch.

libft-unit-test is a complete testing suite for 42's libft project, allowing you to test your lib, track your progress and benchmarking your lib (with system's libc or with another lib)

🤖 Important information 🤖

This repository this not maintained by the owner anymore, an automated merge bot is setup to merge all the pull requests that are reviewed by at least one contributor of this project.

In other words if something is broken and you want to fix it, the only thing you have to do is create a pull request and find someone that has already pushed code to this repository to review your work. You can see the list of people that can review your work here: libft-uni-test contributors.

Installation

You must have the following file structure:

.
|- libft/
|- libft-unit-tests/

Whereas: libft is your project folder. libft-unit-tests is the folder containing this repository.

Afterwards, you can just make.

(NOTE: Before running make, you can edit the LIBFTDIR variable containing the path to your libft folder.)

Usage

Run make f or ./run_test when inside the repo's directory. ./run_test -b to use the Benchmark mode. (-b option to compare with system's libc and -v <libft file> option to compare with another libft file (should be libft.so).

the -nospeed option is available if you're mad enough at your optimization. :)

Results

The test result will be displayed directly in the console with a simple color code.

Color Meaning
Red The function did not behaved correctly or crashed during the test.
Orange The function exceeded the maximal execution time, Probably due to an infinite loop.
Yellow The function failed to handle an extreme case, Most of the time, it's okay to consider the function as correct.
Green The function is correct.

More information about the test context and code is available in the result.log written at the root of the test repository.

Note that in the results, there is a big difference between [CRASH] or [FAIL] and [KO]. While both crash and fail means that the function does not work and should be graded as invalid it's not the case for KO, KO means that the functions fails to handle a case not intended to be tested by 42's grading system and that in some case may exceed the scope of the function.

Linux

To get it work on linux:

  • Install this two packages libbsd-dev and libncurses-dev
  • Add a rule called 'so' in your Makefile to compile your libft in dynamic library instead of static (must be called "libft.so").
  • To make it work in ubuntu you might need to add the flag -nostartfiles

Example:

so:
	$(CC) -fPIC $(CFLAGS) $(SRC)
	gcc -shared -o libft.so $(OBJ)

Example (ubuntu):

so:
	$(CC) -nostartfiles -fPIC $(CFLAGS) $(SRC)
	gcc -nostartfiles -shared -o libft.so $(OBJ)

Screenshots

Default mode

Unit_Testing

Benchmark mode

Benchmarking

More Repositories

1

NodeGraphProcessor

Node graph editor framework focused on data processing using Unity UIElements and C# 4.6
C#
2,137
star
2

HDRP-Custom-Passes

A bunch of custom passes made for HDRP
C#
1,260
star
3

Mixture

Mixture is a powerful node-based tool crafted in unity to generate all kinds of textures in realtime
C#
930
star
4

Procedural-Worlds-Editor

Procedural World Editor is a node based procedural terrain generator
C#
273
star
5

HDRP-UI-Camera-Stacking

Optimized implementation of camera stacking for UI only in HDRP.
ShaderLab
135
star
6

MasterUnityHandles

Unity custom handles examples
C#
96
star
7

printf-unit-test

C++
30
star
8

SOIL2

C
15
star
9

ProceduralTerrainGPU

HLSL
11
star
10

shaderRender

C
9
star
11

PolygonBurst

C#
7
star
12

VoxelEngine

Vulkan engine in c++ exploiting the compute shaders to generate voxel terrain
C++
6
star
13

ShaderSourceExtractor

Unity shader source extractor
ShaderLab
5
star
14

MixAndGameJam_2019

Mix and Game jam 2019
C#
5
star
15

PostEffects

Small unity post processing effects missing from the post processing stack
C#
5
star
16

THE_FUTURE

program used to render shaders on multiple imacs during the artistik rezo party
GLSL
5
star
17

UnityGraphSerialization

Unity graph serialization tests
C#
4
star
18

42sh

42sh
C
4
star
19

LightweightGraphicCore

Lightweight Graphic Vulkan wrapper to manage windows, allocations, shader compilation, GUI and more
C++
4
star
20

DistanceFieldGraph

C#
3
star
21

GGJ2019

C#
3
star
22

ProceduralTextureExporter

C#
3
star
23

Mixture-dev

ShaderLab
3
star
24

DistributionVisualization

C#
2
star
25

Coders-of-the-caribbean

Unity visualizer for CondiinGame challenge: Coders of the Caribbean
C#
2
star
26

Ludum-Dare-43

C#
2
star
27

Touhou-jam

C#
1
star
28

2D-JamStartupKit

A Unity kit of assets and scripts for game jams
C#
1
star
29

Unity-analytics-test

C#
1
star
30

JamKit

A bunch of useful scripts for jam games
C#
1
star
31

Binary-Security

C
1
star
32

Open-Game-Jam-1

C#
1
star
33

AudioFractal

Little Audio fractal visualizer using KlakLasp
C#
1
star
34

malloc

C
1
star
35

HDRP-Mobile

Unlock HDRP to build on mobile devices
C#
1
star