zpm-project / zpm-zsh

zsh plugin manager in ansi C.
GNU General Public License v3.0
5 stars 3 forks source link

Add Valgrind to Travis CI #22

Closed desyncr closed 7 years ago

desyncr commented 7 years ago

http://valgrind.org/docs/manual/quick-start.html

fennecdjay commented 7 years ago

Well, not specifically for travis, but this could make us able to check memory defaults in a breeze.

fennecdjay commented 7 years ago

Is it ok to make zpm_memory.sh executable? and to have something like

export PATH=$PWD/util:$PATH

in tests/setup.sh or Makefile's test target?

desyncr commented 7 years ago

I'd put it on a make target:

make valgrind

I guess we can set up a 'zpm' function/alias rather than using sed.

fennecdjay commented 7 years ago

it looks like alias will work 🍾 should we add a header in every test file?

[ -z "$ZPM_MEMORY" ] && alias zpm="$ZPM_MEMORY"

then

valgrind:
    export ZPM_MEMORY="$PWD/tests/zpm_memory.sh
    make test
    unset ZPM_MEMORY

changing test files would be easy:

for test_file in *.t                               :(
do echo -e "[ -z \"\$ZPM_MEMORY\" ] && alias zpm=\"\$ZPM_MEMORY\"\n$(cat $test_file)" > "$test_file"
done

what do you think?

desyncr commented 7 years ago

I was thinking on adding it to the tests/setup.sh. I'd also use Travis CI's build matrix feature.

Here's an (untested) patch. Let me know what you think!

fennecdjay commented 7 years ago

Here's an (untested) patch. Let me know what you think! Nifty!

desyncr commented 7 years ago

Want to take over this task? I have done the Travis CI part and you seem more competent with valgrind and c in general.

fennecdjay commented 7 years ago

That fine 😺 I'll work on a PR as soon as I finish the huge Gwion refactor task I'm in right now.

fennecdjay commented 7 years ago

I've got something. see #27.

desyncr commented 7 years ago

Gonna take a look at it tonight! Thanks!

fennecdjay commented 7 years ago

Can be closed as #27 has been merged. :smile:

desyncr commented 7 years ago

Closing this!