xicodomingues / francinette

An easy to use testing framework for the 42 projects
MIT License
463 stars 44 forks source link

ft_printf not testing in Ubuntu #49

Open ArenKae opened 1 year ago

ArenKae commented 1 year ago

Hi and thank you for your work. I tried to run francinette on Ubuntu Budgie 22.10, but there is a problem when testing ft_printf.

image

execution.log

xicodomingues commented 1 year ago

Hello! For now I'm not giving much priority to problems while running on Linux. I'l keep it in the backlog and may get around to fix it, but not in the meantime.

ArenKae commented 1 year ago

No probs. I'm done with this project anyway, just bringing out the issue ! Thanks again for your reply and for this nice tool :)

llevasse commented 1 year ago

Hello, I had the same problem a few weeks ago and managed to fix it, so I'll just post it here if anyone needs it. cd francinette/tests/printf/printfTester open the makefile and search those lines

$(MANDATORY): %: mandatory_start $(UTILS_O)
    @$(CC) $(CFLAGS) -D TIMEOUT_US=$(TIMEOUT_US) $(UTILS_O) $(TESTS_PATH)$*_test.cpp -L.. -lftprintf -o $*_test && $(VALGRIND) ./$*_test $(TEST_NUMBER) && rm -f $*_test

$(BONUS): %: bonus_start $(UTILS_O)
    @$(CC) $(CFLAGS) -D TIMEOUT_US=$(TIMEOUT_US) $(UTILS_O) $(TESTS_PATH)$*_test.cpp -L.. -lftprintf -o $*_test && (VALGRIND) ./$*_test $(TEST_NUMBER) && rm -f $*_test

I don't remember why I deleted the $(UTILS_O) but to fix the issue you would need to add the flag -gdwarf-4

$(MANDATORY): %: mandatory_start
    @$(CC) $(CFLAGS) -gdwarf-4 -D TIMEOUT_US=$(TIMEOUT_US) $(UTILS) $(TESTS_PATH)$*_test.cpp -L.. -lftprintf -o $*_test && $(VALGRIND) ./$*_test $(TEST_NUMBER) && rm -f $*_test

$(BONUS): %: bonus_start
    @$(CC) $(CFLAGS) -gdwarf-4 -D TIMEOUT_US=$(TIMEOUT_US) $(UTILS) $(TESTS_PATH)$*_test.cpp -L.. -lftprintf -o $*_test && $(VALGRIND) ./$*_test $(TEST_NUMBER) && rm -f $*_test
mrsourcerer commented 1 year ago

Hello, I had the same problem and it vanished as soon as I upgraded valgrind to 3.20 version. Now Tripouille's test runs OK. But the test of fsoares does not show information and exits as it was ok but performs no tests at all (no OK, KO showing). I don't know if it's related to the valgrind upgrade... but I don't think so because other tests of fsoares (libft or getnextline) run ok.

tats-faire commented 1 year ago

@llevasse's fix didn't work for me, but @mrsourcerer's did. I had to update manually, as apt-get claims "valgrind is already the newest version (1:3.18.1-1ubuntu2)." I followed these steps: wget https://sourceware.org/pub/valgrind/valgrind-3.20.0.tar.bz2 (In the folder where you want to install Valgrind) tar -xjf valgrind-3.20.0.tar.bz2 (If you get an error message, run sudo apt-get install tar) cd valgrind-3.20.0 ./configure --prefix=/usr/local make sudo make install

tats-faire commented 1 year ago

@llevasse's fix didn't work for me, but @mrsourcerer's did. I had to update manually, as apt-get claims "valgrind is already the newest version (1:3.18.1-1ubuntu2)." I followed these steps: wget https://sourceware.org/pub/valgrind/valgrind-3.20.0.tar.bz2 (In the folder where you want to install Valgrind) tar -xjf valgrind-3.20.0.tar.bz2 (If you get an error message, run sudo apt-get install tar) cd valgrind-3.20.0 ./configure --prefix=/usr/local make sudo make install

Just adding: Valgrind already has a newer version. Check https://valgrind.org/downloads/current.html or https://sourceware.org/pub/valgrind/?C=M;O=D for the most recent one.