42FileChecker is a tiny bash script developped 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 definitionsl
- 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:
- moulitest, developed by @yyang42 and other contributors
- libft-unit-test, developed by @alelievr (for libft project only)
- fillit_checker, developed by @anisg (for fillit project only)
- Maintest, developed by @QuentinPerez and other contributors
git clone https://github.com/jgigault/42FileChecker ~/42FileChecker
cd ~/42FileChecker && sh ./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='sh ~/42FileChecker/42FileChecker.sh'
--no-update // Do not check for updates at launch
--no-color // Do not display color tags
--no-timeout // Disable time-out
--no-norminette // Disable code's standard check
--no-leaks // Disable memory leaks detection
--no-speedtest // Disable speed test comparison
--no-moulitest // Disable moulitest
--no-libftunittest // Disable libft-unit-test
--no-fillitchecker // Disable fillit_checker
--no-maintest // Disable Maintest
Add your options as arguments before launch:
sh ./42FileChecker.sh --no-update --no-timeout
libft | libftasm | gnl | ft_ls | ft_printf | fdf | |
auteur | Yes | Yes | Yes | Yes | Yes | Yes |
norminette | Yes | Yes | Yes | Yes | Yes | |
makefile | Yes | Yes | Yes | Yes | Yes | Yes |
forbidden functions | Yes | Yes | Yes | Yes | Yes | Yes |
extra functions | Yes | Yes | ||||
leaks | Yes | Yes | Yes | |||
speed test | Yes | Yes | ||||
tests with compilation | Yes | Yes | Yes | |||
moulitest | Yes | Yes | Yes | Yes | ||
libft-unit-test | Yes |
At launch, 42FileChecker invites you to get the latest version of the sources and dependencies when available. You may just simply accept or skip the message.
If you want to fix or to improve the 42FileChecker, 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 jgigault@student.42.fr
42FileChecker has an online wiki on github that gives you tips and lessons in Bash programming:
- What is Bash
- What is a bash script
- What is 42FileChecker
- Contributing to 42FileChecker
- Bash syntax: Variables
- Bash syntax: Conditions
- Bash syntax: Functions
- Bash builtin commands
- Bash tools: Awk
- Bash tools: Cat
- Bash tools: Grep
- Bash tools: Sed
- Bash sample code: auto-update (git tool)
- Bash sample code: Create an interactive menu
- Bash sample code: Animated spinner with a time out
- Bash sample code: static var test
- Bash sample code: Check the basic rules of a makefile
- Bash sample code: forbidden functions test
- Bash sample code: leaks test
- Bash sample code: Create a speed test