From 19979b020b6631190b6d8d0ce0b3d2c9950b7928 Mon Sep 17 00:00:00 2001 From: mirror12k Date: Fri, 26 Jan 2018 19:17:56 -0500 Subject: [PATCH 1/7] - hopefully fixed an issue with d11 ex05 --- config_d11.pl | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/config_d11.pl b/config_d11.pl index 007da42..7ea0999 100644 --- a/config_d11.pl +++ b/config_d11.pl @@ -229,13 +229,13 @@ } ==== check -t ==== %tests = ( - "$program" => "\n", - "$program asdf" => "asdf,\n", - "$program asdf qwer" => "qwer,asdf,\n", - "$program asdf qwer zxcv" => "zxcv,qwer,asdf,\n", - "$program ''" => ",\n", - "$program 15 '' 25" => "25,,15,\n", - "$program wat" => "wat,\n", + "$program" => "$program,\n", + "$program asdf" => "$program,asdf,\n", + "$program asdf qwer" => "$program,qwer,asdf,\n", + "$program asdf qwer zxcv" => "$program,zxcv,qwer,asdf,\n", + "$program ''" => "$program,,\n", + "$program 15 '' 25" => "$program,25,,15,\n", + "$program wat" => "$program,wat,\n", ); ==== From 39f342b66c32e6e4891c51d895cc68242b30510d Mon Sep 17 00:00:00 2001 From: Berry Semexan Date: Sat, 27 Jan 2018 12:39:16 -0800 Subject: [PATCH 2/7] test update --- config_d11.pl | 34 +++++++--------------------------- 1 file changed, 7 insertions(+), 27 deletions(-) diff --git a/config_d11.pl b/config_d11.pl index 7ea0999..b528a5a 100644 --- a/config_d11.pl +++ b/config_d11.pl @@ -230,12 +230,12 @@ ==== check -t ==== %tests = ( "$program" => "$program,\n", - "$program asdf" => "$program,asdf,\n", - "$program asdf qwer" => "$program,qwer,asdf,\n", - "$program asdf qwer zxcv" => "$program,zxcv,qwer,asdf,\n", - "$program ''" => "$program,,\n", - "$program 15 '' 25" => "$program,25,,15,\n", - "$program wat" => "$program,wat,\n", + "$program asdf" => "asdf,$program,\n", + "$program asdf qwer" => "qwer,asdf,$program,\n", + "$program asdf qwer zxcv" => "zxcv,qwer,asdf,$program,\n", + "$program ''" => ",$program,\n", + "$program 15 '' 25" => "25,,15,$program,\n", + "$program wat" => "wat,$program,\n", ); ==== @@ -278,7 +278,7 @@ l->next->next = CE("zxcv"); t_list* addresses[] = {l, l->next, l->next->next}; qsort(addresses, 3, sizeof(t_list*), (int(*)(const void*, const void*))compare_ints); - + ft_list_clear(&l); // verify that this is set to a null pointer now printf("is null? %p\n", l); @@ -948,23 +948,3 @@ "$program zxcv doop qwer asdf uiop hjkl vbnm" => "vbnm,hjkl,uiop,asdf,qwer,doop,zxcv,\n", ); ==== - - - - - - - - - - - - - - - - - - - - From 2aaf326fbd47e014c2638ade9c7a47ccd6afda5f Mon Sep 17 00:00:00 2001 From: Ian Gallacher Date: Thu, 15 Feb 2018 16:42:02 -0800 Subject: [PATCH 3/7] add test case to day05 ex10 - add capital letter after any non alpha numeric character --- config_d05.pl | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/config_d05.pl b/config_d05.pl index 7f87da8..e3c8cd7 100644 --- a/config_d05.pl +++ b/config_d05.pl @@ -154,10 +154,12 @@ ex10 char* ft_strcapitalize(char* str) main -m ==== -char str[] = "asdf qWeRtY ZXCV 100TIS"; +char str[] = "asdf qWeRtY ZXCV 100TIS\n"; printf("%s", ft_strcapitalize(str)); +char str2[] = "asdf-qWeRtY ZXCV 100TIS"; +printf("%s", ft_strcapitalize(str2)); ==== check -e ==== -$expected = 'Asdf Qwerty Zxcv 100tis'; +$expected = "Asdf Qwerty Zxcv 100tis\nAsdf-Qwerty Zxcv 100tis"; ==== ex11 From 3532404061c0114bb2c33759ed1fb5d2238821ed Mon Sep 17 00:00:00 2001 From: Ian Gallacher Date: Thu, 15 Feb 2018 16:56:36 -0800 Subject: [PATCH 4/7] add test case to day07 ex02 - makes use of the size variable. --- config_d07.pl | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/config_d07.pl b/config_d07.pl index fee6dd7..9efa2d4 100644 --- a/config_d07.pl +++ b/config_d07.pl @@ -57,6 +57,7 @@ size = ft_ultimate_range(&res, 5, 10); printf("is_null? %d\n", res == NULL); +printf("size is %i\n", size); for (i = 0; i < 5; i++) printf("%d,", res[i]); printf("\n"); @@ -64,6 +65,7 @@ res = NULL; size = ft_ultimate_range(&res, -20, -17); printf("is_null? %d\n", res == NULL); +printf("size is %i\n", size); for (i = 0; i < 3; i++) printf("%d,", res[i]); printf("\n"); @@ -71,12 +73,16 @@ res = (int*)1; size = ft_ultimate_range(&res, 10, 5); printf("is_null? %d\n", res == NULL); +printf("size is %i\n", size); ==== check -e ==== $expected = 'is_null? 0 +size is 5 5,6,7,8,9, is_null? 0 +size is 3 -20,-19,-18, is_null? 1 +size is 0 '; ==== From 7da83fa1d977b5eabc44a9631c92cc34e1d886ab Mon Sep 17 00:00:00 2001 From: Ian Gallacher Date: Thu, 15 Feb 2018 19:13:08 -0800 Subject: [PATCH 5/7] remove compile error from day07-ex01 --- config_d07.pl | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/config_d07.pl b/config_d07.pl index 9efa2d4..0289de3 100644 --- a/config_d07.pl +++ b/config_d07.pl @@ -20,6 +20,8 @@ ex01 int* ft_range(int min, int max) main -m ==== +#include +#include int* res; int i; res = ft_range(5, 10); @@ -38,7 +40,7 @@ printf("\n"); res = ft_range(10, 5); -printf("%x\n", (unsigned int)res); +printf("%" PRIxPTR "\n", (uintptr_t) res); ==== check -e ==== $expected = '5,6,7,8,9, -20,-19,-18,-17,-16, From 58ab8913cb44060b6f9399c79378f4e23ea76f8a Mon Sep 17 00:00:00 2001 From: mirror12k Date: Fri, 16 Feb 2018 12:21:52 -0500 Subject: [PATCH 6/7] Update README.md i swear, i know how to write markdown... --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index d4c70da..c74833f 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ -#42 Stupidity +# 42 Stupidity A tool for quickly testing answers to the piscine questions -##usage +## usage clone this repository, and then clone a student's work repo inside of this one. run ```./spawn.pl THEIR_WORK_REPO/ config.pl``` (replace THEIR_WORK_REPO with the repo that you cloned, and config.pl with the name of the config file that you wish to test (they are named by day, so d02 would be config_d02.pl)). the spawn script will create test files for all exercises that it finds present. after spawning, run ```./tools/build.sh``` to build their files with the provided main.c's. run ```./tools/verify.sh``` to have norminette verify all files. finally, run ```./tools/check_all.sh``` to perform all tests. good tests will simply state 'good', errors will be printed with big exclamation marks. From ef364f7cfc61a581ad53e73ebdcd2d5f9ad46177 Mon Sep 17 00:00:00 2001 From: Kristof Kocsis Date: Fri, 12 Jul 2019 21:47:06 -0700 Subject: [PATCH 7/7] Made the readme file more understandable I tried to keep all the original information. I just restructured the original text. --- README.md | 35 +++++++++++++++++++++++++++++++---- 1 file changed, 31 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index c74833f..f09966e 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,34 @@ # 42 Stupidity -A tool for quickly testing answers to the piscine questions -## usage -clone this repository, and then clone a student's work repo inside of this one. run ```./spawn.pl THEIR_WORK_REPO/ config.pl``` (replace THEIR_WORK_REPO with the repo that you cloned, and config.pl with the name of the config file that you wish to test (they are named by day, so d02 would be config_d02.pl)). the spawn script will create test files for all exercises that it finds present. +A tool for quickly test solutions for the piscine exercises. -after spawning, run ```./tools/build.sh``` to build their files with the provided main.c's. run ```./tools/verify.sh``` to have norminette verify all files. finally, run ```./tools/check_all.sh``` to perform all tests. good tests will simply state 'good', errors will be printed with big exclamation marks. +## Usage + +1. Clone 42us-stupidity +2. Go inside 42us-stupidity +3. Clone a day's repo inside 42us-stupidity +4. Run `./spawn.pl config_d.pl`
+ Replacing the placeholders! This will create the test files for all the exercises. +5. Run `./tools/build.sh`
+ Build the exercies' files with the provided main.c's. +6. Run `./tools/verify.sh`
+ This makes norminette verify all the files. (Only works from the iMacs in the labs.) +7. Run `./tools/check_all.sh`
+ This will perform every test. If tests pass then they will say `good` otherwise errors are printed on the terminal. + +## Example workflow + +``` +$ git clone https://github.com/mirror12k/42us-stupidity.git stupidMoulinette +... +$ cd stupidMoulinette +$ cp ~/Desktop/day03 day03 +$ ./spawn.pl day03 config_d03.pl +... +$ ./tools/build.sh +... +$ ./tools/verify.sh +... +$ ./tools/check_all.sh +... +```