-
-
Notifications
You must be signed in to change notification settings - Fork 12.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Rui Chen <[email protected]> binocle: update test Signed-off-by: Rui Chen <[email protected]>
- Loading branch information
1 parent
e2ce6d1
commit 20012c1
Showing
1 changed file
with
36 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
class Binocle < Formula | ||
desc "Graphical tool to visualize binary data" | ||
homepage "https://github.com/sharkdp/binocle" | ||
url "https://github.com/sharkdp/binocle/archive/refs/tags/v0.3.2.tar.gz" | ||
sha256 "b58d450f343539242b9f146606f5e70d0d183e12ce03e1b003c5197e6e41727b" | ||
license any_of: ["Apache-2.0", "MIT"] | ||
head "https://github.com/sharkdp/binocle.git", branch: "master" | ||
|
||
depends_on "rust" => :build | ||
|
||
on_linux do | ||
depends_on "libx11" | ||
depends_on "libxcursor" | ||
depends_on "libxrandr" | ||
end | ||
|
||
def install | ||
system "cargo", "install", *std_cargo_args | ||
end | ||
|
||
test do | ||
assert_match version.to_s, shell_output("#{bin}/binocle --version") | ||
|
||
# Fails in Linux CI with | ||
# "Failed to initialize any backend! Wayland status: XdgRuntimeDirNotSet X11 status: XOpenDisplayFailed" | ||
return if OS.linux? && ENV["HOMEBREW_GITHUB_ACTIONS"] | ||
|
||
expected = if Hardware::CPU.arm? | ||
"Error: No such file or directory" | ||
else | ||
"Error: No suitable `wgpu::Adapter` found." | ||
end | ||
|
||
assert_match expected, shell_output("#{bin}/binocle test.txt 2>&1", 1) | ||
end | ||
end |