paleofetch icon indicating copy to clipboard operation
paleofetch copied to clipboard

Implement Testing

Open ss7m opened this issue 4 years ago • 3 comments

I think that this project is big enough now that we may want to add some testing, but I'm not sure exactly what that'd look like, especially since many things in paleofetch are dependent on hardware. And I'll be the first to admit that I'm not sure how best to write tests for a C project.

I definitely think that passing the valgrind-smell-test should be part of test, for any number of situations, including:

  • Plainly running paleofetch
  • Running paleofetch --recache
  • Running paleofetch when reading from cache
  • Running SHELL="" paleofetch (or any situation causing a value to be empty)
  • Repeating all those for when there is no X server running

ss7m avatar Apr 23 '20 14:04 ss7m

Here's my result. #25

ghost avatar Apr 23 '20 15:04 ghost

While paleofetch isn't exactly mission-critical, it'd be cool if we could throw AFL at it to find any weird edge cases. A solid step in the right direction there might be to extract the various paths we fopen() to a central location; that'd make it a lot easier to pass potentially bug-inducing data in.

allisio avatar Apr 24 '20 09:04 allisio

I'm not familiar with AFL, I'll try and take a look at it later today or over the weekend.

ss7m avatar Apr 24 '20 13:04 ss7m