homebrew-core/Formula/cxxtest.rb

52 lines
1.8 KiB
Ruby
Raw Normal View History

class Cxxtest < Formula
2015-12-19 06:52:24 +00:00
desc "xUnit-style unit testing framework for C++"
homepage "http://cxxtest.com"
url "https://github.com/CxxTest/cxxtest/releases/download/4.4/cxxtest-4.4.tar.gz"
mirror "https://mirrors.kernel.org/debian/pool/main/c/cxxtest/cxxtest_4.4.orig.tar.gz"
sha256 "1c154fef91c65dbf1cd4519af7ade70a61d85a923b6e0c0b007dc7f4895cf7d8"
2015-06-01 12:59:44 +00:00
bottle do
2016-02-23 21:38:18 +00:00
cellar :any_skip_relocation
2016-09-28 23:27:39 +00:00
sha256 "09aa93c60544867a44c3ad711f7ad9207f3f097505ce658e12d4d8ae11287c82" => :sierra
2016-02-23 21:38:18 +00:00
sha256 "d35cfbbea5de989734e9f859531b203dffc870fdf931a5a7f12302adc7354c87" => :el_capitan
2015-08-03 05:29:08 +00:00
sha256 "a69d95d4c027024e6c14a999c679106cf6259e22bb748205d93dbc5d0596a8e3" => :yosemite
sha256 "2e8e487aac953d698f38f89ae9946572f8d072ec35b91683aa66bc147cec2fa4" => :mavericks
sha256 "de1e98e94198507c65ecb17ae240b995ae8f03dadeafbde27bb704df2e10737c" => :mountain_lion
2015-06-01 12:59:44 +00:00
end
depends_on :python if MacOS.version <= :snow_leopard
def install
ENV["PYTHONPATH"] = lib+"python2.7/site-packages"
ENV.prepend_create_path "PYTHONPATH", lib+"python2.7/site-packages"
cd "./python" do
system "python", *Language::Python.setup_install_args(prefix)
end
bin.env_script_all_files(libexec+"bin", :PYTHONPATH => ENV["PYTHONPATH"])
include.install "cxxtest"
doc.install Dir["doc/*"]
end
test do
testfile = testpath/"MyTestSuite1.h"
testfile.write <<-EOS.undent
#include <cxxtest/TestSuite.h>
class MyTestSuite1 : public CxxTest::TestSuite {
public:
void testAddition(void) {
TS_ASSERT(1 + 1 > 1);
TS_ASSERT_EQUALS(1 + 1, 2);
}
};
EOS
system bin/"cxxtestgen", "--error-printer", "-o", testpath/"runner.cpp", testfile
system ENV.cxx, "-o", testpath/"runner", testpath/"runner.cpp"
system testpath/"runner"
end
end