Last active
January 31, 2016 04:49
-
-
Save zbeekman/0fd245c175925b9d6bd8 to your computer and use it in GitHub Desktop.
[Homebrew](http://brew.sh) formula for datetime-fortran.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class DatetimeFortran < Formula | |
desc "Fortran time and date manipulation library" | |
homepage "https://github.com/milancurcic/datetime-fortran" | |
url "https://github.com/milancurcic/datetime-fortran/archive/v1.4.2.tar.gz" | |
sha256 "b500da7e28241ffecb3d06d93fc4d25df71509cb949e472e92a96df843a9f4c9" | |
head do | |
url "https://github.com/milancurcic/datetime-fortran.git" | |
depends_on "autoconf" => :build | |
depends_on "automake" => :build | |
depends_on "pkg-config" => :build | |
end | |
option "without-test", "Run build time tests" | |
depends_on :fortran | |
def install | |
system "autoreconf", "-fvi" if build.head? | |
system "./configure", "--prefix=#{prefix}", | |
"--disable-silent-rules" | |
system "make", "check" if build.with? "test" | |
system "make", "install" | |
(pkgshare/"test").install "src/tests/datetime_tests.f90" | |
end | |
test do | |
ENV.fortran | |
system ENV.fc, "-odatetime_test", "-ldatetime", "-I#{HOMEBREW_PREFIX}/include", pkgshare/"test/datetime_tests.f90" | |
system testpath/"datetime_test" | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class DatetimeFortran < Formula | |
desc "Fortran time and date manipulation library" | |
homepage "https://github.com/milancurcic/datetime-fortran" | |
url "https://github.com/milancurcic/datetime-fortran/archive/v1.4.2.tar.gz" | |
sha256 "a164d377884828b43c01a46ebbc0e95f7549dd8ea198ee9868f3b9eddf3addf3" | |
head do | |
url "https://github.com/milancurcic/datetime-fortran.git" | |
depends_on "autoconf" => :build | |
depends_on "automake" => :build | |
depends_on "pkg-config" => :build | |
end | |
option "without-test", "Run build time tests" | |
depends_on :fortran | |
def install | |
system "autoreconf", "-fvi" if build.head? | |
system "./configure", "--prefix=#{prefix}", | |
"--disable-silent-rules" | |
system "make", "check" if build.with? "test" | |
system "make", "install" | |
(pkgshare/"test").install "src/tests/datetime_tests.f90" | |
end | |
test do | |
ENV.fortran | |
system ENV.fc, "-odatetime_test", "-ldatetime", "-I#{HOMEBREW_PREFIX}/include", pkgshare/"test/datetime_tests.f90" | |
system testpath/"datetime_test" | |
end | |
end |
I would love to parse the output of system testpath/"datetime_test"
for /FAIL/
but my ruby is sadly too limited to figure out how to do this...
!assert_match /FAIL.*/, `#{testpath}/datetime_test`
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Very neat-looking.