tvalgrind.nim 750 B

123456789101112131415161718
  1. discard """
  2. valgrind: true
  3. cmd: "nim $target --gc:arc -d:useMalloc $options $file"
  4. """
  5. # this is the same check used by testament/specs.nim whether or not valgrind
  6. # tests are supported
  7. when defined(linux) and sizeof(int) == 8:
  8. # discarding this allocation will cause valgrind to fail (which is what we
  9. # want), but valgrind only runs on 64-bit Linux machines...
  10. discard alloc(1)
  11. else:
  12. # ...so on all other OS/architectures, simulate any non-zero exit code to
  13. # mimic how valgrind would have failed on this test. We cannot use things like
  14. # `disabled: "freebsd"` in the Testament configs above or else the tests will
  15. # be SKIP-ed rather than FAIL-ed
  16. quit(1) # choose 1 to match valgrind's `--error-exit=1`, but could be anything