LedgerHQ / ragger

Small wrapper around Speculos, LedgerWallet & LedgerComm to ease instrumentation

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Rethink the tmp screen saving

fbeutin-ledger opened this issue · comments

Currently ragger speculos :

  • takes a screenshot of the screen and saves it in tmp
  • takes a screenshot of the screen and compares it with the golden

This is to align the speculos behavior with the ledgerwallet behavior compare_screen_with_snapshot

I had a timing issue where the tmp screenshot was different from the screenshot taken for the comparison, we should only take one screenshot

Draft solution by @xchapron-ledger

def compare_screen_with_snapshot(golden_path, tmp_path=None, golden_run=False):
LedgerWallet et LedgerComm ignorent tmp_path  et golden_run
Speculos fait un truc du genre :
get_screenshot
save in tmp_path
if golden_run:
save in golden_path
compare  tmp_path and golden_path