#!/bin/env ruby

test_bin = "/home/aczid/workspace/grid-mw-security/ees/src/.libs/test_app"
test_configs = "/home/aczid/workspace/grid-mw-security/ees/test_configs"

describe test_bin do
  Dir.foreach(test_configs){|file|
    unless file.match(/^\..*/)
      command = "valgrind #{test_bin} #{File.join(test_configs,file)} 2&1> /dev/null"
      it "Should parse file #{file} without memory leaks" do
        `#{command}`
        `fgrep "All heap blocks were freed" /tmp/vgrun.out`.should_not be_empty
        `fgrep "Warning" /tmp/vgrun.out`.should == ""
      end
    end
  }
end

