Skip to content

Commit

Permalink
even better
Browse files Browse the repository at this point in the history
  • Loading branch information
myrrc committed Jul 12, 2024
1 parent b4fbf06 commit 5e2eaff
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 18 deletions.
3 changes: 1 addition & 2 deletions .github/workflows/wf.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@ jobs:
run: cd tests; chmod +x prepare; ./prepare
- run: |
export DISPLAY=:99; sudo Xvfb -ac :99 -screen 0 1280x1024x24 > /dev/null 2>&1 &
cd tests; chmod +x copy-configs patch-settings test
cd tests; chmod +x copy-configs test
./copy-configs
./patch-settings
./test
exit $?
8 changes: 3 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,7 @@ to [examples](#some-ideas-to-start-with).
## Installation

- Add `https://raw.githubusercontent.com/gwatcha/reaper-keys/master/index.xml` to Reapack.
- Optionally, install [SWS](https://sws-extension.org/) (by hand or from ReaTeam
Extensions). Although this extension _may_ work without SWS, the experience will be
worse.
- Install [SWS](https://sws-extension.org/) by hand or from ReaTeam Extensions.

## Features
### Bind key sequences
Expand Down Expand Up @@ -152,16 +150,16 @@ For running tests locally you'd need some Linux distribution with X11 and `xdoto

```sh
cd tests;
chmod +x prepare copy-configs patch-settings test
chmod +x prepare copy-configs test

./prepare # This will create a local Reaper installation
./copy-configs # This will make current instance of reaper-keys testable
./patch-settings # Or change test to true in internal/definitions/config.lua
./test # This will run every test and compare with reference projects
```

If you don't use X11 you can have a look at `.github/workflows/wf.yml` to see how x11 is
emulated with Xvfb.
Use `./test -s` to skip first invocation which bypasses "Still evaluating" window.

### Writing tests

Expand Down
2 changes: 1 addition & 1 deletion internal/gui/feedback/controller.lua
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ function feedback.update()
feedback_view = FeedbackView:new()
feedback_view:open()

if config.show_start_up_message and not config.test then
if config.show_start_up_message then
reaper.ShowMessageBox(startup_msg, "Reaper Keys Open Message", 1)
end

Expand Down
4 changes: 2 additions & 2 deletions internal/state_machine/state_machine.lua
Original file line number Diff line number Diff line change
Expand Up @@ -129,14 +129,14 @@ local function input()
local hotkey = { context = section_id == 0 and "main" or "midi", key = ctxToState(ctx) }

log.info("Input: " .. format.line(hotkey))
if config.show_feedback_window and not config.test then feedback.clear() end
if config.show_feedback_window then feedback.clear() end

local state = state_interface.get()
local new_state = step(state, hotkey)
state_interface.set(new_state)

log.info("New state: " .. format.block(new_state))
if config.test or not config.show_feedback_window then return end
if not config.show_feedback_window then return end

feedback.displayState(new_state)
feedback.update()
Expand Down
6 changes: 1 addition & 5 deletions tests/compare
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,7 @@ from pathlib import Path
from sys import argv
left_file, right_file = Path(argv[1]).read_text(), Path(argv[2]).read_text()
out = 0
ignored_keys = ["<TRACK", "TRACKID", "EGUID"]

if len(left_file) != len(right_file):
print("Different sizes")
out = 1
ignored_keys = ["<TRACK", "TRACKID", "EGUID", "FIXEDLANES"]

# skip project declaration
for left, right in zip(left_file.split("\n")[1:], right_file.split("\n")[1:]):
Expand Down
2 changes: 0 additions & 2 deletions tests/patch-settings

This file was deleted.

2 changes: 1 addition & 1 deletion tests/test
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash
ret=0
timeout 5 ./reaper/reaper -new -nosplash &>/dev/null # still evaluating
[ $# -eq 0 ] && timeout 6 ./reaper/reaper -new -nosplash &>/dev/null # still evaluating

for test in *.rks; do
echo "Running $test"
Expand Down

0 comments on commit 5e2eaff

Please sign in to comment.