48 lines
1.5 KiB
Ruby
48 lines
1.5 KiB
Ruby
class Cxxtest < Formula
|
|
include Language::Python::Virtualenv
|
|
|
|
desc "C++ unit testing framework similar to JUnit, CppUnit and xUnit"
|
|
homepage "https://cxxtest.com/"
|
|
url "https://github.com/CxxTest/cxxtest/releases/download/4.4/cxxtest-4.4.tar.gz"
|
|
mirror "https://deb.debian.org/debian/pool/main/c/cxxtest/cxxtest_4.4.orig.tar.gz"
|
|
sha256 "1c154fef91c65dbf1cd4519af7ade70a61d85a923b6e0c0b007dc7f4895cf7d8"
|
|
license "LGPL-3.0"
|
|
revision 1
|
|
|
|
bottle do
|
|
cellar :any_skip_relocation
|
|
sha256 "90b9ca9996eb575a2e8665223f38731979a38630f5462fd3c2babf81ce7ceee4" => :catalina
|
|
sha256 "d6f91fba5743dc04e2c929036f59a34cd7833e5a75a6ebf6785209f8fabca4f1" => :mojave
|
|
sha256 "99b1ea9c495bf4ee03b88aadb33a5ae964741bcd387d678c6dcc5a18c925ad12" => :high_sierra
|
|
end
|
|
|
|
depends_on "python@3.8"
|
|
|
|
def install
|
|
venv = virtualenv_create(libexec, Formula["python@3.8"].opt_bin/"python3")
|
|
venv.pip_install_and_link buildpath/"python"
|
|
|
|
include.install "cxxtest"
|
|
doc.install Dir["doc/*"]
|
|
end
|
|
|
|
test do
|
|
testfile = testpath/"MyTestSuite1.h"
|
|
testfile.write <<~EOS
|
|
#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
|