tbb: add test

Closes Homebrew/homebrew#35491.

Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
This commit is contained in:
Xu Cheng 2015-01-03 15:46:12 +08:00 committed by Mike McQuaid
parent a08492c8b1
commit 201c16c1de

View file

@ -1,5 +1,3 @@
require "formula"
class Tbb < Formula
homepage "http://www.threadingbuildingblocks.org/"
url "https://www.threadingbuildingblocks.org/sites/default/files/software_releases/source/tbb43_20141023oss_src.tgz"
@ -34,4 +32,19 @@ class Tbb < Formula
lib.install Dir["build/BUILDPREFIX_release/*.dylib"]
include.install "include/tbb"
end
test do
(testpath/"test.cpp").write <<-EOS.undent
#include <tbb/task_scheduler_init.h>
#include <iostream>
int main()
{
std::cout << tbb::task_scheduler_init::default_num_threads();
return 0;
}
EOS
system ENV.cxx, "test.cpp", "-ltbb", "-o", "test"
system "./test"
end
end