Coder Social home page Coder Social logo

Add valgrind test targets about imageflow HOT 3 CLOSED

imazen avatar imazen commented on May 21, 2024
Add valgrind test targets

from imageflow.

Comments (3)

lilith avatar lilith commented on May 21, 2024

Fix warnings from png encoding

from imageflow.

lilith avatar lilith commented on May 21, 2024

What we used to do:


desc "run with valgrind"
valgrind_task("--leak-check=full --show-leak-kinds=all", :valgrind => PROFILING_PROGRAM)

desc "run with callgrind"
valgrind_task("--tool=callgrind --dump-instr=yes --cache-sim=yes --branch-sim=yes", :callgrind => PROFILING_PROGRAM)

desc "run with cachegrind"
task :cachegrind => PROFILING_PROGRAM do |t|
  cachegrind_out_file = "/tmp/cachegrind-out-file"
  with_ld_library_path('.') do
    sh "valgrind #{VALGRIND_OPTS} --tool=cachegrind --branch-sim=yes --cachegrind-out-file=#{cachegrind_out_file} ./#{t.prerequisites.first}"
  end
  sh "cg_annotate #{cachegrind_out_file}"
end

desc "build the test program"
file TEST_PROGRAM => TEST_OBJECTS + LIB_OBJECTS do |t|
  sh "#{CXX} -Werror #{t.prerequisites.join(" ")} -o #{t.name}"
end

desc "build the theft_test program"
file "theft_test" => THEFT_TEST_OBJECTS + LIB_OBJECTS do |t|
  sh "#{CXX} -Werror #{t.prerequisites.join(" ")} -ltheft -o #{t.name}"
end

task :test => TEST_PROGRAM do
  sh "./#{TEST_PROGRAM} #{ENV['ARGS']}"
end

desc "Run the test program with valgrind"
valgrind_task("--leak-check=full --show-leak-kinds=all --error-exitcode=2", :test_with_valgrind => TEST_PROGRAM)

desc "Run theft_test with valgrind"
valgrind_task("--leak-check=full --show-leak-kinds=all", :theft_test_with_valgrind => "theft_test")

from imageflow.

lilith avatar lilith commented on May 21, 2024

This is now part of build.sh for both C and Rust. CI fails if any leaks or undefined behaviors are detected.

from imageflow.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.