From 957ab9cfd9ce4771da932c04a4e16fcf1f130bb4 Mon Sep 17 00:00:00 2001 From: Jack Nagel Date: Fri, 1 Feb 2013 23:12:35 -0600 Subject: gfortran: use test DSL --- Library/Formula/gfortran.rb | 34 ++++++++++++++++------------------ 1 file changed, 16 insertions(+), 18 deletions(-) (limited to 'Library/Formula') diff --git a/Library/Formula/gfortran.rb b/Library/Formula/gfortran.rb index f872775a5..794b8419f 100644 --- a/Library/Formula/gfortran.rb +++ b/Library/Formula/gfortran.rb @@ -94,24 +94,22 @@ class Gfortran < Formula # (share/'locale').rmtree end - def test - mktemp do - fixture = <<-EOS.undent - integer,parameter::m=10000 - real::a(m), b(m) - real::fact=0.5 - - do concurrent (i=1:m) - a(i) = a(i) + fact*b(i) - end do - print *, "done" - end - EOS - Pathname('in.f90').write(fixture) - system "#{bin}/gfortran -c in.f90" - system "#{bin}/gfortran -o test in.o" - `./test`.strip =='done' - end + test do + fixture = <<-EOS.undent + integer,parameter::m=10000 + real::a(m), b(m) + real::fact=0.5 + + do concurrent (i=1:m) + a(i) = a(i) + fact*b(i) + end do + print *, "done" + end + EOS + Pathname('in.f90').write(fixture) + system "#{bin}/gfortran -c in.f90" + system "#{bin}/gfortran -o test in.o" + `./test`.strip =='done' end def caveats; <<-EOS.undent -- cgit v1.2.3