Giter VIP home page Giter VIP logo

42filechecker's Introduction

42FileChecker

42FileChecker is a tiny bash script developed at 42 school for testing and checking the files according to the rules of the subjects.

The script is designed as a reminder:

  • author file terminated by a Line Feed
  • count and files name
  • code's standard
  • required and forbidden functions
  • macro definitions
  • static variables & functions declarations
  • makefile rules

Extra tests may also be performed:

  • memory leaks detection
  • speed test comparison
  • Unit Tests

Complete unit tests are handled through external frameworks whose sources are automatically downloaded, configured and updated in background when you run the script:

install & launch

git clone https://github.com/jgigault/42FileChecker ~/42FileChecker
cd ~/42FileChecker && bash ./42FileChecker.sh

You may also want to set an alias to run it from everywhere, even in your project path. Add this line of code at the end of your shell initialization file (e.g.: ~/.zshrc):

alias 42FileChecker='bash ~/42FileChecker/42FileChecker.sh'

At launch, 42FileChecker invites you to get the latest version of the sources when available. You may just simply accept or skip the message.

non-interactive mode

The non-interactive mode enables you to launch a test suite without any prompt.
You must specify the two options --project and --path.
Here is an example of use with the project libft:

bash ~/42FileChecker/42FileChecker.sh --project "libft" --path "/Users/admin/Projects/libft/"

options

--project + $PROJECT

Required for non-interactive mode.
Specify the name of the project you want to test.
e.g.: bash ./42FileChecker.sh --project "libft".
Must be one of the following values: fillit, libft, libftasm, gnl, get_next_line, ft_ls, ft_printf, minishell.

--path + $PATH

Required for non-interactive mode.
This option has no effect when used without the option --project.
Specify the absolute path of directory of your project.
e.g.: bash ./42FileChecker.sh --project "libft" --path "/Users/admin/Projects/libft/".

--no-update

Do not check for updates at launch.

--no-color

Do not display color tags.

--no-timeout

Disable timeout.

--no-disclaimer, --no-auteur, --no-author, --no-norminette, --no-leaks, --no-speedtest, --no-basictests, --no-makefile, --no-forbidden, --no-staticdeclarations, --no-libftfilesexists, --no-gnlmultiplefd, --no-gnlonestatic, --no-gnlmacro, --no-gnltofreeornottofree, --no-moulitest, --no-libftunittest, --no-fillitchecker, --no-maintest, --no-42shelltester

Disable a specific test.

supported projects

fillit libft libftasm gnl ft_ls ft_printf minishell
author file Yes Yes Yes Yes Yes Yes
norminette Yes Yes Yes Yes Yes Yes
makefile Yes Yes Yes Yes Yes Yes Yes
forbidden functions Yes Yes Yes Yes Yes Yes Yes
extra functions Yes Yes
leaks Yes Yes Yes
speed test Yes Yes
unit tests Yes Yes Yes Yes
integration tests Yes Yes Yes

official team and credits

42FileChecker is an open source project distributed under licence Apache 2.0.

Originally developed by Jean Michel Gigault @jgigault, the team also is composed of:

logo credits

Edouard Audeguy
Illustrateur / Infographiste
https://edouardaudeguy.wix.com/portfolio

contribute

If you want to be part of the project, to fix and to improve the 42FileChecker, please follow the guide lines Contributing to 42FileChecker, or if you want your own unit testing framework to be integrated in the 42FileChecker, just let me know at [email protected].

42FileChecker has an online wiki that gives you tips and lessons in Bash programming.

Known Issues

  • At 42 school, when running the leaks test for the first time, a box can appear and prompt you for administrator username and password. Run the leaks command outside of 42FileChecker and enter exam and exam as username and password, then everything should go along.

other scripts

42FileChecker 42MapGenerator 42ShellTester

42filechecker's People

Contributors

cbcercas avatar dbousque avatar denis2222 avatar jgigault avatar lpoujade avatar m-michel avatar pamicel avatar seluj78 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

42filechecker's Issues

42FileChecker: Author Files and makefile

Hi,

I'm a student at 42 in the U.S. and just found your 42FileChecker program It's very useful, but it doesn't recognize author files in english (spelled "author" instead of "auteur") and makefile (spelled "makefile" instead of "Makefile", though that might be on purpose on your part I guess). I just thought you would like to know since I assume more people from our campus will probably be using it soon. Thanks!

Best,
David Huang

Get next line, basic test, pas d'open dans le main

Bonjour,
Avant tout merci pour l'excellent travail que tu met à disposition de 42 avec 42FC ! Je travail en ce moment sur get_next_line et dans les basic test, il y en à 12 qui fails. Comme mes test personnel sur les même fichiers que tu utilise pour 42FC donnaient les résultat attendu, j'ai regardé le code des test.

Là je me suis rendu compte que sur les 12 test qui sont marqué comme fails dans 42FC, il manque à chaque fois la fonction open pour ouvrir le fichier, le fd employé est donc toujours à 0 et forcément les test sont toujours fails.

En rajoutant moi même open tout refonctionne correctement. Voila voila, je devrais me le faire corriger aujourd'hui et j'espère que les correcteurs sauront comprendre que normalement tout marche bien ^^'

Merci encore et au plaisir :)

[EDIT] J'ai lancé le test sur le gnl de queqlu'un et il n'y a aucune erreur.. je me sent un peux bête, d'autant plus que je ne comprends pas ! Par exemple dans gnl1_1.c il y a bien ->

// gnl1_1.c
filename = "./srcs/gnl/gnl1_1.txt";
fd = open(filename, O_RDONLY);
if (argc && argv && fd > 2)

et dans l'un des fichier que j'ai en fail il manque bien la fonction open ->

// gnl2_1.c
filename = "./srcs/gnl/gnl1_1.txt";
fd = 0;
if (argc && argv)

Pourtant sur le gnl d'un pote sa ne pose pas de problème Oo, je sais pas trop quoi penser.

FT_PRINTF - Cant launch errors checks

Hi,
I really found useful the 42FileChecker for the GNL and now I wanted to use it even for my printf. So I started by launching your basic tests but I keep getting this same error and I dont know how to fix it:
#1

ft_printf("");
includes/ft_printf.sh: line 166: printf: includes/ft_printf.sh: line 119: ./tmp/ft_printf_0: No such file or directory: invalid number

  1. ( 0) -->includes/ft_printf.sh: line 119: ./tmp/ft_printf_0: No such file or directory<--
  2. ( 0) --><--

...
#0197 (unsigned int)

ft_printf("@moulitest: %.5u", "42");
includes/ft_printf.sh: line 166: printf: includes/ft_printf.sh: line 119: ./tmp/ft_printf_u: No such file or directory: invalid number

  1. ( 0) -->includes/ft_printf.sh: line 119: ./tmp/ft_printf_u: No such file or directory<--
  2. ( 17) -->@moulitest: 00042<--

However, both the makefile test and the Moulitest (both launched within the 42FileCheker) work perfectly.
Do you have any idea on how to fix this ??

Thank you in advance,

cmutti

42FileChecker key loop

Si on reste appuyer sur le numpad pendant les tests le 42FileChecker commence a agir de maniere indeterminer.

test leaks sur get_next_line

C'est pas vraiment un bug, mais plutôt une astuce. Sur les postes de 42, le system demande les identifiants administrateur. Mais on les a pas. Donc j'ai trouvé une solution, c'est de rentrer les identifiant : exam exam 👍 et ça marche :)

Test sur strcmp && strncmp libft

Apres test du moulitest + unit test m'ayant pas pris en comptes certaines erreurs;

exemple : strcmp("", " ") || strncmp("", " ");
strcmp("aaa", "") || strncmp("aaa", "");

28/28 unit-test+moulitest != 26/28 moulinette;

moulitest ne trouve pas #<libft.h>

Comme le dit le titre, je viens de tester une nouvelle version de ma libft avec 42FileChecker, et j'ai utilisé des dossiers pour ranger les .h, .o et .c (respectivement "include", "src", "OBJ").
Tous les test ce passent bien, même ceux de unit-test, mais moulittest (son Makefile) ne prend pas en compte la possibilité de l'utilisation d'un sous dossier pour libft.h.
Éventuellement, on devrait utiliser un libft.h propre a moulitest et ne pas utiliser celui de l'élève (je ne pense pas que ça change grand chose pour les tests).

Integration with travis

Hi.

It will be interesting to have a way to pass arguments to the shell file to be able to use Travis.
For example

./42FileChecker --path=/home/travis/libft --project=libft --tests=all --no-norminette

will launch 42FileChecker for the libft, pass moulitest and libftunit-test, doesn't check norminette and the libft is in /home/travis/libft directory.

Idée à voir

Bonsoir, il serait intéressant de rediriger la sortie d'erreur afin de pouvoir checker les messages d'erreur présents à l'exécution de nos programmes.

Cordialement
msorin

printf("% v")

Salut,

Je ne comprends pas bien ce que tu cherches a tester dans les "basic tests" avec "% v"... ce n'est certainement pas a gerer! Man 3 printf dit:

The AltiVec Technology Programming Interface Manual also defines five additional length modifiers which can be used (in place of the conventional modifiers) for the printing of AltiVec or SSE vectors:
v Treat the argument as a vector value, unit length will be determined by the conversion specifier (default = 16 8-bit units for all integer conversions, 4 32-bit units for floating point conversions).

Ca fait certainement partie des trucs "bizarres" dans tous les cas, et c'est meme un bonus bien relou a gerer. Es-tu bien sur que tu voulais faire cela? Si oui, tu peux expliquer un peu la demerche? Merci!

F.

Leaks - besoin des perms admins

La nouvelle version demande les droits admin pour s'executer donc elle fail quand on l'execute a l'ecole, peut etre repasse a l'ancienne methode

ne compile pas avec libft.a

Le 42FileChecker de get_next_line ne compile pas libft.a ... le nom du dossier libft est peu claire

bisou :D

Autor check on fillit

Hi,

You check the presence of autor file in fillit project. It is not mandatory for this project. Instead of just put an error, maybe add a message like "Autor file is not mandatory for this project, but you should add it".

bug 42filechecker

thx for this tools
but there is always a warning with the norm he can't checka file but all's right

42Filechecker FdF

check de la norme sur mlx.h

ducoup la norme aime pas trop xD
merci pour ton taf sa aide :)

GNL Error

Salut le moulitest ne passe pas pour GNL
j'ai 4 erreur basique mais quand je corrige une faute de norme ( donc rien avoir ) bah sa change mes erreurs.

il m'en reste une puis je refais une erreur de norme pour tester et biim 4 erreurs

[FUITE]

Encore salut !
Dans le moulitest, un processus continue de tournee en boucle en fond et cree des problemes
"Your system has running out of memory"
je l'ai kill, mais voila,
process "gnl9"

auteur file

for 42USA students the auteur file is renamed to author file. this causes issues in the program.

Bug forbidden fonction

apres avoir dl a partir de fb ma libft.zip, sachant que tous les tests etaient vert je lance une derniere fois le full test, la norminette ne fonctionne plus on est obligé de couper la commande, et les forbidden fonction font apparaitre une bonne vingtaine de ligne d'erreur awk: can't open file 2/libft/ft_memmove.c
source line number 1
awk: can't open file 2/libft/ft_putstr.c
source line number 1
awk: can't open file 2/libft/ft_lstforeach_if.c
source line number 1
awk: can't open file 2/libft/ft_atoi.c
source line number 1
awk: can't open file 2/libft/ft_factorial.c
source line number 1
awk: can't open file 2/libft/ft_strsub.c
source line number 1
awk: can't open file 2/libft/ft_lstnew.c
source line number 1
awk: can't open file 2/libft/ft_strrchr.c
source line number 1
awk: can't open file 2/libft/ft_putchar.c
source line number 1
awk: can't open file 2/libft/ft_isascii.c
8 -> forbidden functions No forbidden function found
9 -> moulitest (https://github.com/yyang42/moulitest_42projects) Not performed
A -> libft-unit-test (https://github.com/alelievr/libft-unit-test) Not performed
B -> Maintest (https://github.com/QuentinPerez/Maintest) Not performed
source line number 1

  1. OK
  2. more info: required functions
  3. more info: bonus functions
  4. more info: extra functions
  5. more info: norminette
  6. more info: static declarations
  7. more info: makefile
  8. more info: forbidden functions
  9. more info: moulitest
    A) more info: libft-unit-test
    B) more info: Maintest

C) REPORT A BUG ON 42FILECHECKER
D) REPORT A BUG ON MOULITEST
E) REPORT A BUG ON LIBFT-UNIT-TEST
F) REPORT A BUG ON MAINTEST
G) BACK TO MAIN MENU

source line number 1
awk: can't open file 2/libft/ft_strncpy.c
source line number 1
awk: can't open file 2/libft/ft_memalloc.c
source line number 1
awk: can't open file 2/libft/ft_strcat.c
source line number 1
awk: can't open file 2/libft/ft_putchar_fd.c
source line number 1
awk: can't open file 2/libft/ft_strnequ.c
source line number 1
awk: can't open file 2/libft/ft_power.c
source line number 1
awk: can't open file 2/libft/ft_memset.c
source line number 1
awk: can't open file 2/libft/ft_strcmp.c
source line number 1
awk: can't open file 2/libft/ft_memcmp.c
source line number 1
awk: can't open file 2/libft/ft_bzero.c
source line number 1
awk: can't open file 2/libft/ft_isprint.c
source line number 1
awk: can't open file 2/libft/ft_putendl_fd.c
source line number 1
awk: can't open file 2/libft/ft_memdel.c
source line number 1
awk: can't open file 2/libft/ft_swap.c
source line number 1
awk: can't open file 2/libft/ft_strdup.c
source line number 1
awk: can't open file 2/libft/ft_strlcat.c
source line number 1
awk: can't open file 2/libft/ft_tolower.c
source line number 1
awk: can't open file 2/libft/ft_lstpush_back.c
source line number 1
awk: can't open file 2/libft/ft_putendl.c
source line number 1

apres avoir dit que tous les test etaient valides, bizzare.

Libft should give a timeout after 10 seconds

For the libft, I found in the hard way :( that Moulinette will give a timeout if the following takes more than 10 seconds to finish this:

make clean && make && make fclean && make && make re && ls -l libft.a

This means that even though, everything is correct, if you add a lot of extra functions (in my case, about 35), it will time out and give you a zero, no matter what.

[ALIAS ERROR]

Salut !
Premièrement, merci pour ce projet, vraiment super utiles !
Juste, impossible d'aliasé la commande "~/42FileChecker/42FileCheacker.sh"
sa donne des problemes d'include..
Je vais essayer de resoudre le probleme sur ma machine.
Je te tien au courent.

Cordialement,

BUG ON CORR PRINTF

for the basic test #46, 047 048 :
#47 (int)

ft_printf("@moulitest: %.x", %.0x, 0, 0); <-- wrong

  1. ( 16) -->@moulitest: 0, 0<--
  2. ( 14) -->@moulitest: , <--
    ty

Sujet et leaks

Salut!
On a deja du te le report (<- et je suppose qu'on te dis ca souvent) (<- et ca aussi) (<-habituelement il n'y a que moi qui vais jusque la)
mais pour Get_next_line, ton test necessite d'avoir libft.h a la racine du dossier de rendu - le sujet precise que ce fichier doit etre dans le dossier libft, lui meme a la racine.
Aussi, la detection des memory leaks necessite une authentification staff helas :/ - ou autre, je ne suis pas renseigne. Mais il nous ai bien demander les id/mdp du group Developer Tools

Voila :) En esperant etre utile
cordialement
nmougino

Can't change path for FDF

Hi,
For fdf tests; the path can't be changed for other than home (for me; maybe it can't be changed for other than subfolder of first choice )
And, nor ctrl-c (does nothing) or escape (act like tab) can't stop the script
thx !

make all twice returns false error

Hi,

While running make all twice in a row i get the message make[1]: nothing to be done for "all" but your test returns an error. I believe checking if RET0 and RET2 are both different from "" (line 71) in makefile.sh is the source of the error, because they actually both return " " when running make all twice. Not sure why that is tho. :D

Bug sur Maintest qperez, pas de trace ?

Bonjour, je te contacte par rapport au main de test ajouté à la dernière update. En effet, je me retrouve avec une erreur de compilation ("An error occured while compiling your program") mais impossible d'obtenir la moindre trace en appuyant sur B contrairement aux autres tests (comme si je n'avais appuyé sur aucune touche).

Merci d'avance pour ta réponse :).

_edit_
J'ai testé le main directement en le compilant avec ma libft en dehors de 42filechecker et là il n'y a aucune erreur, tout fonctionne parfaitement.

big (really big) .mymaintest_ft_ls

Hello,
Pas vraiment un bug, et d'ailleurs ça vient plutôt du maintest de qperez (non, en vrai c'est la faute de mon ft_ls ), mais je me retrouve avec ça :

-rw-r--r-- 1 lpoujade 2015_paris 9,9G 23 mai 15:08 .mymaintest_ft_ls

ça m'aura au moins permis de vérifier que les sessions ne sont pas automatiquement vidées quand on dépasse les 5Go ! :)
Mais comme probablement ça peut arriver à d'autres aussi, je signale, peut être que ça vaudrait le coup de rajouter un delete des fichiers de logs ?
Encore merci pour tes scripts en tout cas !

erreur fichier auteur

bonjour, il y a un petit problème sur la versification du fichier auteur, 42FC ne vérifie pas si il y a des '\n' après le log.

Makefile error 're'

It seems that there is an error caused by same inode unchanged.

I give you the info... maybe i am wrong on my Makefile, but i have some doubt on it.

CHECKING RULE: re
-> Failing rule: It should have compiled again the binary named 'libftprintf.a' (inode unchanged)

good luck :0

Une erreur de norme

Sur la libft quand on fait un check alors que dans le fichier il signale un warning. Je te mets le fichier ci dessous, et gg pour ton 42filechecker cest du bon boulot !!
mynorminette copy.txt

GNL Basic Tests returning false error

In file get_next_line.sh while doing
if ["$RET0" != "OK"]
then
(( errors += 1 ))
fi
$RET0 is eventually set to 0 -> 1 / 123
1 -> abc
2 -> 0 /
OK
causing $errors to be wrongfully incremented.
Just a tiny little thing, awesome work, thx a lot !

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.