Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 17 additions & 11 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -51,20 +51,26 @@
programs.ormolu.enable = true; # Haskell
programs.cabal-fmt.enable = true;
programs.shfmt.enable = true;
programs.yamlfmt.enable = true;
programs.yamlfmt.enable = pkgs.system != "x86_64-darwin"; # a treefmt-nix+yamlfmt bug on Intel Macs
};
};

flake.hydraJobs = {
testgen-hs = lib.genAttrs (config.systems ++ ["x86_64-windows"]) (
targetSystem: inputs.self.internal.${targetSystem}.hydraPackage
);
required = inputs.nixpkgs.legacyPackages.x86_64-linux.releaseTools.aggregate {
name = "github-required";
meta.description = "All jobs required to pass CI";
constituents =
lib.collect lib.isDerivation inputs.self.hydraJobs.testgen-hs;
flake.hydraJobs = let
allJobs = {
testgen-hs = lib.genAttrs (config.systems ++ ["x86_64-windows"]) (
targetSystem: inputs.self.internal.${targetSystem}.hydraPackage
);
inherit (inputs.self) checks;
};
in
allJobs
// {
required = inputs.nixpkgs.legacyPackages.x86_64-linux.releaseTools.aggregate {
name = "github-required";
meta.description = "All jobs required to pass CI";
constituents =
lib.collect lib.isDerivation allJobs;
};
};
};
});
}
17 changes: 14 additions & 3 deletions testgen-hs/CLI.hs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import qualified Data.Version as V
import Options.Applicative as O
import qualified Paths_testgen_hs as V

data Command = Generate GenerateOptions | Deserialize ByteString | DeserializeStream deriving (Show)
data Command = Generate GenerateOptions | Deserialize ByteString | DeserializeStream | EvaluateStream deriving (Show)

data GenerateOptions = GenerateOptions (Maybe Seed) GenSize NumCases TypeCommand deriving (Show)

Expand All @@ -30,14 +30,15 @@ data TypeCommand
= GHCInteger
| DataText
| ExampleADT
| Tx'Conway
| Tx'ConwayDummy
| ApplyTxErr'Byron
| ApplyTxErr'Shelley
| ApplyTxErr'Allegra
| ApplyTxErr'Mary
| ApplyTxErr'Alonzo
| ApplyTxErr'Babbage
| ApplyTxErr'Conway
| TxScriptFailure'Conway
deriving (Show)

parse :: IO Command
Expand Down Expand Up @@ -90,6 +91,15 @@ commandParser =
(progDesc "Deserialize an STDIN stream of multiple lines of base16-encoded CBOR of ‘HardForkApplyTxErr’")
)
)
<> ( command
"evaluate-stream"
( info
( pure EvaluateStream
<**> helper
)
(progDesc "Evaluate an STDIN stream of Txs with Utxos")
)
)
)

optionsParser :: Parser GenerateOptions
Expand Down Expand Up @@ -138,14 +148,15 @@ typeCommandParser :: Parser TypeCommand
typeCommandParser =
subparser
( mempty
<> mkTypeCommand Tx'Conway
<> mkTypeCommand Tx'ConwayDummy
<> mkTypeCommand ApplyTxErr'Byron
<> mkTypeCommand ApplyTxErr'Shelley
<> mkTypeCommand ApplyTxErr'Allegra
<> mkTypeCommand ApplyTxErr'Mary
<> mkTypeCommand ApplyTxErr'Alonzo
<> mkTypeCommand ApplyTxErr'Babbage
<> mkTypeCommand ApplyTxErr'Conway
<> mkTypeCommand TxScriptFailure'Conway
<> mkTypeCommand GHCInteger
<> mkTypeCommand DataText
<> mkTypeCommand ExampleADT
Expand Down
Loading