summaryrefslogtreecommitdiffstats
path: root/tests/ref.rs
AgeCommit message (Collapse)Author
2019-02-07Dynamically resize terminal for errors/warningsChristian Duerr
The warning and error messages now don't overwrite other terminal content anymore but instead resize the terminal to make sure that text can always be read. Instead of just showing that there is a new error and pointing to the log, errors will now be displayed fully in multiple lines of text, assuming that there is enough space left in the terminal. Explicit mouse click handling has also been added to the message bar, which made it possible to add a simple `close` button in the form of `[X]`. Alacritty's log file location is now stored in the `$ALACRITTY_LOG` environment variable which the shell inherits automatically. Previously there were some issues with the log file only being deleted when certain methods for closing Alacritty were used (like typing `exit`). This has been reworked and now Ctrl+D, exit and signals should all work properly. Before the config is reloaded, all current messages are now dropped. This should help with multiple terminals all getting clogged up at the same time when the config is broken. When one message is removed, all other duplicate messages are automatically removed too.
2018-12-10Upgrade to Rust 2018Joe Wilm
This resolves a lot of NLL issues, however full NLL will be necessary to handle a couple of remaining issues.
2018-12-09Fix rendering of zero-width charactersChristian Duerr
Instead of rendering zero-width characters as full characters, they are now properly rendered without advancing the cursor. Because of performance limitations, this implementation only supports up to 5 zero-width characters per cell. However, as a result of this limitation there should not be any performance impact. This fixes #1317, fixes #696 and closes #1318.
2018-12-08Fix recording of ref testsChristian Duerr
Due to the lazy initialization of lines in the Alacritty history, the recording of ref tests was broken. Because a WM would often resize the ref test window after it was spawned, some additional lines were initialized in the stored ref test. To make sure lazy initialization does not play any role in the recording and replaying of reftests, before recording and replaying the tests, the complete grid is initialized and then truncated. This should make sure that only the relevant lines are kept.
2018-06-02Truncate invisible lines before storing ref-testsChristian Duerr
Because there is no good way to store invisible lines in a backwards- and forwards-compatible way, they buffer now gets truncated before dumping the state of a grid when creating a ref-test. This involved a few workaround of which a few required adding additional methods which are only used in ref-tests, these should be minimal though. Since this required the creation of a truncation method anyways, some logic has been added which automatically truncates the invisible buffer when there are more than X (set to 100) invisible lines. This should not impact performance because it rarely occurs, but it could save a bit of memory when the history size is shrunk during runtime (see #1293). This also adds an optional `config.json` file to the ref-test output where it is possible to manually specify variables which should override config defaults, this has been used only for history_size so far. Creating a new ref-test does also still work, so there was no regression here, if history size is altered, the config.json just has to be created manually with the content `{"history_size":HIST_SIZE}`, where `HIST_SIZE` is the desired history size.
2018-06-02Improve storage comparison algorithmChristian Duerr
Instead of iterating over the raw storage vector because the offsets don't allow direct comparison, the comparison is now done in chunks. Based on benchmarking this is a lot more efficient than using split_off + append or iterating over the elements of the buffer. The `history_size` field has also been removed from the storage structure because it can be easily calculated by substracting the number of visible lines from the length of the raw storage vector.
2018-06-02Reset grid content when running `reset`Christian Duerr
In the current scrollback PR the `reset` command does not affect the scrollback history. To make sure the terminal is properly reset, it should clear the scrollback history. This commit fixes this by creating a new and empty grid whenever `reset` is executed. It takes the current dimensions and history size from the old grid. Right now there's an empty ref-test called `grid_reset` without any content, this should be implemented once #1244 is resolved. This fixes #1242.
2018-06-02Enable history comparison in ref-testsChristian Duerr
Previously ref-tests just ignored the scrollback history to keep the old tests working, this would lead to new tests which rely on scrollback history to succeeed even though they should not. This has been fixed and it is now possible to create ref-tests with and without scrollback history. When available the scrollback history is compared, but the old tests still work without having to adjust them. This fixes #1244.
2018-06-02Remove some unused methods and implsJoe Wilm
2018-06-02Back Grid with VecDequeJoe Wilm
VecDeque offers improved performance beyond a plain Vec for common scrolling situations (full screen scroll). Additionally, VecDeque is necessary for performant scrollback since recycling old rows for a Vec would be expensive (push/pop front would shift entire vec).
2017-11-11Add ref test for 855Joe Wilm
2017-11-11Run all ref testsJoe Wilm
There were two ref tests that were not being run. Oops!
2017-09-30Add ref test for CSI REPJoe Wilm
2017-05-01Fix bug with tab renderingJoe Wilm
Closes #494. Resolves #529. Resolves #512. Resolves #493.
2017-05-01Support insert modeJoe Wilm
2017-05-01Implement tab stop manipulationJoe Wilm
Adds implementations for TBC (tabulation clear) and HTS (set horizontal tabstop).
2017-04-19Add more vttest ref testsJoe Wilm
2017-04-19Add reftest for vttest 2 scrollJoe Wilm
2017-04-04Add ref test for tab renderingJoe Wilm
2017-04-03Add better printing for ref test failureJoe Wilm
The previous format was extremely difficult for a human to parse.
2017-02-27Add ref test for tab background highlightingJoe Wilm
Generated with echo -e "\x1b[48;5;31m1\t2\n\n3\x1b[0;m"
2017-02-07Add zsh tab completion ref testJoe Wilm
2017-02-03Alacritty now compiles on stable Rust :tada:Joe Wilm
2017-01-29support for inverting the cursor or using colorsDanny Dulai
2017-01-23Dynamically generate test harnessSteven Fackler
This uses the rustc-test crate, a copy of the standard test crate, to dynamically create tests for each reference test. No need to remember to update the macro, just add the directory to ref!
2016-12-16add fish_cc refquininer kel
and update Cargo.lock
2016-12-11Implement Handler::identify_terminal for TermJoe Wilm
The identify_terminal function signature had to change to support writing to the terminal before processing additional input.
2016-12-11Add support for indexed colorsJoe Wilm
ANSI escape sequences like `\x1b[48;5;10m` were not supported until now. Specifically, the second attribute, 5, says that the following attribute is a color index. The ref tests were updated since `enum Color` variants changed.
2016-12-11Refactor cell selection out of rendererJoe Wilm
The terminal now has a `renderable_cells()` function that returns a `RenderableCellIter` iterator. This allows reuse of the cell selection code by multiple renderers, makes it testable, and makes it independently optimizable. The render API now takes an `Iterator<Item=IndexedCell>` to support both the new renderable cells iterator and the `render_string()` method which generates its own iterator. The `vim_large_window_scoll` ref test was added here because it provides a nice large and busy grid to benchmark the cell selection with.
2016-11-20Remove unnecessary slicingJoe Wilm
json::from_str takes a &str which will auto deref from &String.
2016-11-19Add a number of simple ref-testsJoe Wilm
Also adds a feature `err-println` for enabling `err_println!` printing.
2016-11-19Add support for recording/running ref testsJoe Wilm
Ref tests use a recording of the terminal protocol and a serialization of the grid state to check that the parsing and action handling systems produce the correct result. Ref tests may be recorded by running alacritty with `--ref-test` and closing the terminal by using the window "X" button. At that point, the recording is fully written to disk, and a serialization of important state is recorded. Those files should be moved to an appropriate folder in the `tests/ref/` tree, and the `ref_test!` macro invocation should be updated accordingly. A couple of changes were necessary to make this work: * Ref tests shouldn't create a pty; the pty was refactored out of the `Term` type. * Repeatable lines/cols were needed; on startup, the terminal is resized * by default to 80x24 though that may be changed by passing `--dimensions w h`. * Calculating window size based on desired rows/columns and font metrics required making load_font callable multiple times. * Refactor types into library crate so they may be imported in an integration test. * A whole bunch of types needed symmetric serialization and deserialization. Mostly this was just adding derives, but the custom deserialization of Rgb had to change to a deserialize_with function. This initially adds one ref test as a sanity check, and more will be added in subsequent commits. This initial ref tests just starts the terminal and runs `ll`.