ntl: add test (#4895)
This commit is contained in:
parent
66f66908ff
commit
cd876eac94
1 changed files with 25 additions and 0 deletions
|
@ -23,4 +23,29 @@ class Ntl < Formula
|
|||
system "make", "install"
|
||||
end
|
||||
end
|
||||
|
||||
test do
|
||||
(testpath/"square.cc").write <<-EOS.undent
|
||||
#include <iostream>
|
||||
#include <NTL/ZZ.h>
|
||||
|
||||
int main()
|
||||
{
|
||||
NTL::ZZ a;
|
||||
std::cin >> a;
|
||||
std::cout << NTL::power(a, 2);
|
||||
return 0;
|
||||
}
|
||||
EOS
|
||||
gmp = Formula["gmp"]
|
||||
flags = %W[
|
||||
-I#{include}
|
||||
-L#{gmp.opt_lib}
|
||||
-L#{lib}
|
||||
-lgmp
|
||||
-lntl
|
||||
]
|
||||
system ENV.cxx, "square.cc", "-o", "square", *flags
|
||||
assert_equal "4611686018427387904", pipe_output("./square", "2147483648")
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue