Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
nix: Add checks for release packages
- Loading branch information
Showing
5 changed files
with
165 additions
and
51 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
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
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
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
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,49 @@ | ||
#!/usr/bin/env ruby | ||
|
||
############################################################################ | ||
# Checks that every executable required in the release package is | ||
# present and works. | ||
############################################################################ | ||
|
||
require 'open3' | ||
|
||
tests = { | ||
"cardano-wallet-jormungandr" => [ "jormungandr", "jcli" ], | ||
"cardano-wallet-byron" => [ "cardano-node", "cardano-cli", "bech32", "cardano-tx", "cardano-address" ], | ||
"cardano-wallet-shelley" => [ "cardano-node", "cardano-cli", "bech32", "cardano-tx", "cardano-address" ] | ||
} | ||
|
||
if ARGV.length < 1 || ARGV.length > 2 || tests[ARGV[0]] == nil | ||
STDERR.puts "Usage: check-bundle cardano-wallet-(jormungandr|byron|shelley) [RUNNER]" | ||
exit 1 | ||
end | ||
|
||
wallet = ARGV[0] | ||
|
||
# Runner is used to run windows exes under wine. | ||
runner = ARGV.fetch(1, "") | ||
|
||
$failed = 0 | ||
|
||
def report(cmd, status) | ||
res = status == 0 ? "pass" : "FAIL" | ||
puts "#{cmd.ljust(40)}[#{res}]" | ||
if status then | ||
$failed = status | ||
end | ||
end | ||
|
||
cmd = "#{wallet} version" | ||
ver, status = Open3.capture2("#{runner} #{cmd}") | ||
report(cmd, status) | ||
|
||
tests[wallet].each do |cmd| | ||
begin | ||
stdout_str, status = Open3.capture2("#{runner} #{cmd} --help") | ||
report(cmd, 0) | ||
rescue Errno::ENOENT | ||
report(cmd, 1) | ||
end | ||
end | ||
|
||
exit($failed) |