Karya, built on Sun Nov 26 01:04:37 PST 2017 (patch 0a920b2bde70c0cbac8ee09d158064798b61bbe5)

Safe HaskellNone




Utilities for cmd tests.


running cmds

run_tracks :: [UiTest.TrackSpec] -> Cmd.CmdId a -> Result a Source #

Run cmd with the given tracks.

run_tracks_ruler :: [UiTest.TrackSpec] -> Cmd.CmdId a -> Result a Source #

Like run_tracks, but the ruler only extends to the end of the last event.

run_tracks_with_performance :: [UiTest.TrackSpec] -> Cmd.CmdT IO a -> IO (Result a) Source #

Derive the tracks and then run the cmd with the performance available.

run :: Ui.State -> Cmd.State -> Cmd.CmdId a -> Result a Source #

Run a cmd and return everything you could possibly be interested in.

eval :: Ui.State -> Cmd.State -> Cmd.CmdId a -> a Source #

Run a Cmd and return just the value.

run_sel :: Types.TrackNum -> [UiTest.TrackSpec] -> Cmd.CmdId a -> Result a Source #

Like run, but with a selection on the given track at 0 and note duration set to what will be a ScoreTime 1 with the ruler supplied by UiTest.

update_perf :: Ui.State -> Result val -> IO (Result val) Source #

Update performances after running a Cmd and getting its Result.

extract_derive :: (Score.Event -> a) -> Result _a -> ([a], [Text]) Source #

Run a DeriveTest extractor on a CmdTest Result.

extract_derive_result :: Result a -> Result Source #

Reconstruct a Derive.Result from the root performance, or throw an exception if there is a problem getting it.

update_performance :: Ui.State -> Ui.State -> Cmd.State -> [Update.CmdUpdate] -> IO Cmd.State Source #

Update the performances based on the UI state change and updates. This manually runs that part of the responder, and is needed for tests that rely on the performances.

thread :: Ui.State -> Cmd.State -> [Cmd.CmdId a] -> Either Text (Ui.State, Cmd.State) Source #

Run several cmds, threading the state through. The first cmd that fails aborts the whole operation.


set_point_sel_block :: Ui.M m => Text -> Types.TrackNum -> ScoreTime -> m () Source #

Set a point selection on the default view of the given block name.

select_all :: Cmd.M m => m () Source #


type Extracted val = Either Text (val, [Text]) Source #

The output of the extract family of functions: Either error (val, [log])

trace_logs :: Extracted a -> Either Text a Source #

Run this on either extract or extract_state when you don't care about the logs.


extract :: (val -> e) -> Result val -> Extracted (Maybe e) Source #

Extract the value from a cmd. This is meant to be used as the single check on a cmd operation, so it also returns logs and whether the cmd failed or not (the latter is mandatory since otherwise there is no value).


extract_state :: (Ui.State -> Cmd.State -> e) -> Result val -> Extracted e Source #

Get something out of the Result from one of the states. Like extract, this is meant to be used as the single check on a cmd operation.

inst db

set_synths_simple :: [MidiInst.Synth] -> DeriveTest.SimpleAllocations -> Ui.State -> Cmd.State -> (Ui.State, Cmd.State) Source #

Configure ustate and cstate with the given instruments.



setup cmds

set_env :: Cmd.M m => BlockId -> BlockId -> TrackId -> [(EnvKey.Key, BaseTypes.Val)] -> m () Source #

Fake up just enough Performance to have environ in it.