|
| 1 | +# typed: true |
| 2 | +# frozen_string_literal: true |
| 3 | + |
| 4 | +# Homebrew formula for MFC (Multiphase Flow Code) |
1 | 5 | class Mfc < Formula |
2 | 6 | desc "Exascale multiphase/multiphysics compressible flow solver" |
3 | 7 | homepage "https://mflowcode.github.io/" |
@@ -38,10 +42,10 @@ def install |
38 | 42 | # - bootstrap/ for build/lint/format scripts |
39 | 43 | # - templates/ for HPC job submission |
40 | 44 | prefix.install "toolchain" |
41 | | - |
| 45 | + |
42 | 46 | # Install examples |
43 | 47 | pkgshare.install "examples" |
44 | | - |
| 48 | + |
45 | 49 | # Create a wrapper that sets up the environment and calls mfc.sh |
46 | 50 | # The wrapper changes to the installation directory because mfc.sh |
47 | 51 | # expects to be run from MFC's root (checks for toolchain/util.sh) |
@@ -74,23 +78,22 @@ def caveats |
74 | 78 |
|
75 | 79 | test do |
76 | 80 | # Test that the binaries exist |
77 | | - assert_predicate bin/"pre_process", :exist? |
78 | | - assert_predicate bin/"simulation", :exist? |
79 | | - assert_predicate bin/"post_process", :exist? |
80 | | - |
| 81 | + assert_path_exists bin/"pre_process" |
| 82 | + assert_path_exists bin/"simulation" |
| 83 | + assert_path_exists bin/"post_process" |
| 84 | + |
81 | 85 | # Test mfc wrapper |
82 | 86 | system bin/"mfc", "--help" |
83 | | - |
| 87 | + |
84 | 88 | # Test that binaries can execute |
85 | 89 | system bin/"pre_process", "-h" |
86 | 90 | system bin/"simulation", "-h" |
87 | | - |
| 91 | + |
88 | 92 | # Test that mfc.sh is accessible in libexec |
89 | | - assert_predicate libexec/"mfc.sh", :exist? |
90 | | - assert_predicate prefix/"toolchain", :exist? |
91 | | - |
| 93 | + assert_path_exists libexec/"mfc.sh" |
| 94 | + assert_path_exists prefix/"toolchain" |
| 95 | + |
92 | 96 | # Test that mfc can parse a case file (lighter than full simulation) |
93 | 97 | system bin/"mfc", "count", "#{pkgshare}/examples/1D_sodshocktube/case.py" |
94 | 98 | end |
95 | 99 | end |
96 | | - |
|
0 commit comments