lol
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

nixosTests.musescore: handleTest -> runTest

+73 -76
+1 -1
nixos/tests/all-tests.nix
··· 901 901 mumble = runTest ./mumble.nix; 902 902 # Fails on aarch64-linux at the PDF creation step - need to debug this on an 903 903 # aarch64 machine.. 904 - musescore = handleTestOn [ "x86_64-linux" ] ./musescore.nix { }; 904 + musescore = runTestOn [ "x86_64-linux" ] ./musescore.nix; 905 905 music-assistant = runTest ./music-assistant.nix; 906 906 munin = runTest ./munin.nix; 907 907 mutableUsers = runTest ./mutable-users.nix;
+72 -75
nixos/tests/musescore.nix
··· 1 - import ./make-test-python.nix ( 2 - { pkgs, ... }: 1 + { lib, hostPkgs, ... }: 3 2 4 - let 5 - # Make sure we don't have to go through the startup tutorial 6 - customMuseScoreConfig = pkgs.writeText "MuseScore4.ini" '' 7 - [application] 8 - hasCompletedFirstLaunchSetup=true 3 + let 4 + # Make sure we don't have to go through the startup tutorial 5 + customMuseScoreConfig = hostPkgs.writeText "MuseScore4.ini" '' 6 + [application] 7 + hasCompletedFirstLaunchSetup=true 9 8 10 - [project] 11 - preferredScoreCreationMode=1 12 - ''; 13 - in 14 - { 15 - name = "musescore"; 16 - meta = with pkgs.lib.maintainers; { 17 - maintainers = [ turion ]; 18 - }; 9 + [project] 10 + preferredScoreCreationMode=1 11 + ''; 12 + in 13 + { 14 + name = "musescore"; 15 + meta = with lib.maintainers; { 16 + maintainers = [ turion ]; 17 + }; 19 18 20 - nodes.machine = 21 - { ... }: 19 + nodes.machine = 20 + { pkgs, ... }: 21 + { 22 + imports = [ 23 + ./common/x11.nix 24 + ]; 22 25 23 - { 24 - imports = [ 25 - ./common/x11.nix 26 - ]; 26 + services.xserver.enable = true; 27 + environment.systemPackages = with pkgs; [ 28 + musescore 29 + pdfgrep 30 + ]; 31 + }; 27 32 28 - services.xserver.enable = true; 29 - environment.systemPackages = with pkgs; [ 30 - musescore 31 - pdfgrep 32 - ]; 33 - }; 33 + enableOCR = true; 34 34 35 - enableOCR = true; 35 + testScript = 36 + { ... }: 37 + '' 38 + start_all() 39 + machine.wait_for_x() 36 40 37 - testScript = 38 - { ... }: 39 - '' 40 - start_all() 41 - machine.wait_for_x() 41 + # Inject custom settings 42 + machine.succeed("mkdir -p /root/.config/MuseScore/") 43 + machine.succeed( 44 + "cp ${customMuseScoreConfig} /root/.config/MuseScore/MuseScore4.ini" 45 + ) 42 46 43 - # Inject custom settings 44 - machine.succeed("mkdir -p /root/.config/MuseScore/") 45 - machine.succeed( 46 - "cp ${customMuseScoreConfig} /root/.config/MuseScore/MuseScore4.ini" 47 - ) 47 + # Start MuseScore window 48 + machine.execute("env XDG_RUNTIME_DIR=$PWD DISPLAY=:0.0 mscore >&2 &") 48 49 49 - # Start MuseScore window 50 - machine.execute("env XDG_RUNTIME_DIR=$PWD DISPLAY=:0.0 mscore >&2 &") 50 + # Wait until MuseScore has launched 51 + machine.wait_for_window("MuseScore Studio") 51 52 52 - # Wait until MuseScore has launched 53 - machine.wait_for_window("MuseScore Studio") 53 + machine.screenshot("MuseScore0") 54 54 55 - machine.screenshot("MuseScore0") 55 + # Create a new score 56 + machine.send_key("ctrl-n") 56 57 57 - # Create a new score 58 - machine.send_key("ctrl-n") 58 + # Wait until the creation wizard appears 59 + machine.wait_for_window("New score") 59 60 60 - # Wait until the creation wizard appears 61 - machine.wait_for_window("New score") 61 + machine.screenshot("MuseScore1") 62 62 63 - machine.screenshot("MuseScore1") 63 + machine.send_key("tab") 64 + machine.send_key("tab") 65 + machine.send_key("ret") 64 66 65 - machine.send_key("tab") 66 - machine.send_key("tab") 67 - machine.send_key("ret") 67 + machine.sleep(2) 68 68 69 - machine.sleep(2) 69 + machine.send_key("tab") 70 + # Type the beginning of https://de.wikipedia.org/wiki/Alle_meine_Entchen 71 + machine.send_chars("cdef6gg5aaaa7g") 72 + machine.sleep(1) 70 73 71 - machine.send_key("tab") 72 - # Type the beginning of https://de.wikipedia.org/wiki/Alle_meine_Entchen 73 - machine.send_chars("cdef6gg5aaaa7g") 74 - machine.sleep(1) 74 + machine.screenshot("MuseScore2") 75 75 76 - machine.screenshot("MuseScore2") 77 - 78 - # Go to the export dialogue and create a PDF 79 - machine.send_key("ctrl-p") 76 + # Go to the export dialogue and create a PDF 77 + machine.send_key("ctrl-p") 80 78 81 - # Wait until the Print dialogue appears. 82 - machine.wait_for_window("Print") 79 + # Wait until the Print dialogue appears. 80 + machine.wait_for_window("Print") 83 81 84 - machine.screenshot("MuseScore4") 85 - machine.send_key("alt-p") 86 - machine.sleep(1) 82 + machine.screenshot("MuseScore4") 83 + machine.send_key("alt-p") 84 + machine.sleep(1) 87 85 88 - machine.screenshot("MuseScore5") 86 + machine.screenshot("MuseScore5") 89 87 90 - # Wait until PDF is exported 91 - machine.wait_for_file('"/root/Untitled score.pdf"') 88 + # Wait until PDF is exported 89 + machine.wait_for_file('"/root/Untitled score.pdf"') 92 90 93 - ## Check that it contains the title of the score 94 - machine.succeed('pdfgrep "Untitled score" "/root/Untitled score.pdf"') 95 - machine.copy_from_vm("/root/Untitled score.pdf") 96 - ''; 97 - } 98 - ) 91 + ## Check that it contains the title of the score 92 + machine.succeed('pdfgrep "Untitled score" "/root/Untitled score.pdf"') 93 + machine.copy_from_vm("/root/Untitled score.pdf") 94 + ''; 95 + }