vimamsa 0.1.27 → 0.1.28

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (156) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +139 -89
  3. data/custom_example.rb +18 -6
  4. data/doc/TODO.md +327 -110
  5. data/doc/action_names_plan.md +442 -0
  6. data/doc/bundling_plan.md +2 -1
  7. data/doc/delta_syntax_plan.md +293 -0
  8. data/doc/demo_recording_plan.md +288 -0
  9. data/doc/design_goals.md +27 -0
  10. data/doc/intro_page_plan.md +266 -0
  11. data/doc/key_bindings_report_plan.md +45 -0
  12. data/doc/line_tree_plan.md +89 -0
  13. data/doc/missing_vim_bindings.md +34 -44
  14. data/doc/modules_settings_plan.md +1 -1
  15. data/doc/registries_plan.md +202 -0
  16. data/doc/startup_speed_plan.md +97 -0
  17. data/doc/treap_visualizer.html +585 -0
  18. data/doc/vim_compatibility_plan.md +186 -31
  19. data/doc/vimlike_vim_conflicts.md +236 -228
  20. data/doc/vm_snapshots_plan.md +4 -4
  21. data/doc/wysiwyg_plan.md +231 -0
  22. data/exe/run_tests.rb +8 -1
  23. data/exe/vimamsa +49 -6
  24. data/help/intro.txt +30 -0
  25. data/help/vim_intro.txt +31 -0
  26. data/img/demo.gif +0 -0
  27. data/img/demo.mp4 +0 -0
  28. data/lang/hyperplaintext.lang +1 -1
  29. data/lib/vimamsa/ack.rb +2 -0
  30. data/lib/vimamsa/actions.rb +381 -36
  31. data/lib/vimamsa/bookmarks.rb +8 -8
  32. data/lib/vimamsa/buffer.rb +83 -37
  33. data/lib/vimamsa/buffer_changetext.rb +58 -36
  34. data/lib/vimamsa/buffer_list.rb +2 -2
  35. data/lib/vimamsa/buffer_manager.rb +6 -6
  36. data/lib/vimamsa/cli_help.rb +75 -0
  37. data/lib/vimamsa/clipboard.rb +6 -3
  38. data/lib/vimamsa/conf.rb +9 -0
  39. data/lib/vimamsa/crash_handler.rb +2 -2
  40. data/lib/vimamsa/debug.rb +2 -2
  41. data/lib/vimamsa/demo_player.rb +458 -0
  42. data/lib/vimamsa/demo_recorder.rb +277 -0
  43. data/lib/vimamsa/diff_buffer.rb +1 -1
  44. data/lib/vimamsa/dot_repeat.rb +104 -0
  45. data/lib/vimamsa/easy_jump.rb +54 -3
  46. data/lib/vimamsa/editor.rb +89 -46
  47. data/lib/vimamsa/file_history.rb +1 -1
  48. data/lib/vimamsa/file_manager.rb +23 -23
  49. data/lib/vimamsa/form_input.rb +388 -0
  50. data/lib/vimamsa/gui.rb +83 -13
  51. data/lib/vimamsa/gui_command_line.rb +44 -5
  52. data/lib/vimamsa/gui_form_generator.rb +17 -6
  53. data/lib/vimamsa/gui_key_hint.rb +165 -0
  54. data/lib/vimamsa/gui_keylog_panel.rb +164 -2
  55. data/lib/vimamsa/gui_menu.rb +69 -50
  56. data/lib/vimamsa/gui_select_window.rb +77 -43
  57. data/lib/vimamsa/gui_settings.rb +9 -5
  58. data/lib/vimamsa/gui_sourceview.rb +15 -81
  59. data/lib/vimamsa/gui_theme.rb +11 -2
  60. data/lib/vimamsa/hook.rb +2 -0
  61. data/lib/vimamsa/intro_page.rb +368 -0
  62. data/lib/vimamsa/key_actions.rb +315 -225
  63. data/lib/vimamsa/key_binding_tree.rb +228 -61
  64. data/lib/vimamsa/key_bindings_notepad.rb +18 -16
  65. data/lib/vimamsa/key_bindings_report.rb +290 -67
  66. data/lib/vimamsa/key_bindings_vim.rb +47 -297
  67. data/lib/vimamsa/key_bindings_vimlike.rb +347 -339
  68. data/lib/vimamsa/key_names.rb +80 -0
  69. data/lib/vimamsa/line_tree.rb +367 -0
  70. data/lib/vimamsa/macro.rb +20 -3
  71. data/lib/vimamsa/rbvma.rb +15 -0
  72. data/lib/vimamsa/registers.rb +125 -0
  73. data/lib/vimamsa/run_ruby.rb +64 -0
  74. data/lib/vimamsa/search_replace.rb +4 -4
  75. data/lib/vimamsa/string_util.rb +17 -3
  76. data/lib/vimamsa/tests.rb +8 -8
  77. data/lib/vimamsa/text_objects.rb +11 -54
  78. data/lib/vimamsa/text_transforms.rb +4 -0
  79. data/lib/vimamsa/tmp_user_dir.rb +39 -0
  80. data/lib/vimamsa/user_dirs.rb +83 -0
  81. data/lib/vimamsa/version.rb +1 -1
  82. data/lib/vimamsa/vim_core.rb +355 -0
  83. data/lib/vimamsa/vim_operators.rb +365 -0
  84. data/modules/calculator/calculator.rb +5 -5
  85. data/modules/color_highlight/color_highlight.rb +3 -3
  86. data/modules/dictation/dictation.rb +32 -32
  87. data/modules/ollama/ollama.rb +5 -5
  88. data/modules/terminal/terminal.rb +5 -5
  89. data/modules/tts/tts.rb +10 -10
  90. data/run_e2e_vm.sh +3 -3
  91. data/run_tests_vm.rb +138 -0
  92. data/scripts/demo/demo_easyjump_steps.txt +60 -0
  93. data/scripts/demo/demo_files_steps.txt +52 -0
  94. data/scripts/demo/demo_steps.txt +9 -1
  95. data/scripts/demo/notes.txt +6 -0
  96. data/scripts/demo/record_demo.rb +60 -81
  97. data/scripts/demo/report.rb +7 -0
  98. data/scripts/demo/shapes.rb +1 -0
  99. data/scripts/demo/square/shapes.rb +29 -0
  100. data/scripts/demo/square/steps.txt +185 -0
  101. data/scripts/lib/perf_startup.rb +138 -0
  102. data/scripts/lib/script_helpers.rb +53 -0
  103. data/scripts/perf_compare.rb +34 -0
  104. data/scripts/profile_startup.rb +72 -0
  105. data/tests/test_action_ids.rb +232 -0
  106. data/tests/test_auto_format.rb +2 -2
  107. data/tests/test_autocomplete.rb +1 -1
  108. data/tests/test_basic_editing.rb +18 -18
  109. data/tests/test_bookmarks.rb +6 -6
  110. data/tests/test_bracket_match.rb +3 -0
  111. data/tests/test_cli_help.rb +64 -0
  112. data/tests/test_color_highlight.rb +2 -2
  113. data/tests/test_command_line.rb +1 -1
  114. data/tests/test_context_menu_file.rb +18 -0
  115. data/tests/test_copy_paste.rb +33 -33
  116. data/tests/test_custom_two_phase.rb +1 -1
  117. data/tests/test_demo_player.rb +301 -0
  118. data/tests/test_demo_recorder.rb +202 -0
  119. data/tests/test_dictation.rb +16 -16
  120. data/tests/test_dot_repeat.rb +88 -0
  121. data/tests/test_easy_jump.rb +93 -0
  122. data/tests/test_extract_file_links.rb +3 -3
  123. data/tests/test_file_panel.rb +2 -2
  124. data/tests/test_flash.rb +1 -1
  125. data/tests/test_fold.rb +1 -1
  126. data/tests/test_form_input.rb +203 -0
  127. data/tests/test_func_panel.rb +2 -2
  128. data/tests/test_gtk_sync.rb +7 -7
  129. data/tests/test_intro_page.rb +437 -0
  130. data/tests/test_key_categories.rb +163 -0
  131. data/tests/test_keylog_panel.rb +163 -3
  132. data/tests/test_line_ends.rb +51 -0
  133. data/tests/test_line_tree.rb +86 -0
  134. data/tests/test_lsp_clangd.rb +2 -2
  135. data/tests/test_macro.rb +2 -2
  136. data/tests/test_module_interface.rb +9 -9
  137. data/tests/test_notepad_bindings.rb +5 -5
  138. data/tests/test_perf_startup.rb +28 -0
  139. data/tests/test_random_edit.rb +27 -27
  140. data/tests/test_registers.rb +122 -0
  141. data/tests/test_run_ruby.rb +77 -0
  142. data/tests/test_startup_file.rb +1 -1
  143. data/tests/test_text_objects.rb +1 -1
  144. data/tests/test_text_transforms.rb +12 -0
  145. data/tests/test_tmp_user_dir.rb +79 -0
  146. data/tests/test_tts.rb +10 -10
  147. data/tests/test_undo.rb +34 -34
  148. data/tests/test_user_dirs.rb +122 -0
  149. data/tests/test_vim_bindings.rb +107 -6
  150. data/tests/test_vim_conflicts.rb +41 -4
  151. data/tests/test_vim_operators.rb +116 -0
  152. data/tests/test_window_layout.rb +83 -0
  153. data/vimamsa.gemspec +1 -1
  154. data/vm_guest_run.sh +22 -2
  155. metadata +58 -3
  156. data/run_tests_vm.sh +0 -130
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vimamsa
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.27
4
+ version: 0.1.28
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sami Sieranoja
@@ -256,15 +256,25 @@ files:
256
256
  - custom_example.rb
257
257
  - demo.txt
258
258
  - doc/TODO.md
259
+ - doc/action_names_plan.md
259
260
  - doc/bundling_plan.md
261
+ - doc/delta_syntax_plan.md
262
+ - doc/demo_recording_plan.md
263
+ - doc/design_goals.md
264
+ - doc/intro_page_plan.md
260
265
  - doc/key_bindings_report_plan.md
266
+ - doc/line_tree_plan.md
261
267
  - doc/missing_vim_bindings.md
262
268
  - doc/modules_settings_plan.md
263
269
  - doc/refactor_dedup_plan.md
270
+ - doc/registries_plan.md
271
+ - doc/startup_speed_plan.md
272
+ - doc/treap_visualizer.html
264
273
  - doc/unused_code_plan.md
265
274
  - doc/vim_compatibility_plan.md
266
275
  - doc/vimlike_vim_conflicts.md
267
276
  - doc/vm_snapshots_plan.md
277
+ - doc/wysiwyg_plan.md
268
278
  - docker_cmd.sh
269
279
  - exe/run_tests.rb
270
280
  - exe/vimamsa
@@ -272,8 +282,11 @@ files:
272
282
  - ext/vmaext/vmaext.c
273
283
  - fonts/OFL-Oxanium.txt
274
284
  - fonts/Oxanium[wght].ttf
285
+ - help/intro.txt
286
+ - help/vim_intro.txt
275
287
  - icon.png
276
288
  - img/demo.gif
289
+ - img/demo.mp4
277
290
  - img/screenshot1.png
278
291
  - img/screenshot2.png
279
292
  - install.sh
@@ -290,13 +303,17 @@ files:
290
303
  - lib/vimamsa/buffer_list.rb
291
304
  - lib/vimamsa/buffer_manager.rb
292
305
  - lib/vimamsa/bundled_fonts.rb
306
+ - lib/vimamsa/cli_help.rb
293
307
  - lib/vimamsa/clipboard.rb
294
308
  - lib/vimamsa/conf.rb
295
309
  - lib/vimamsa/constants.rb
296
310
  - lib/vimamsa/crash_handler.rb
297
311
  - lib/vimamsa/debug.rb
312
+ - lib/vimamsa/demo_player.rb
313
+ - lib/vimamsa/demo_recorder.rb
298
314
  - lib/vimamsa/desktop_install.rb
299
315
  - lib/vimamsa/diff_buffer.rb
316
+ - lib/vimamsa/dot_repeat.rb
300
317
  - lib/vimamsa/easy_jump.rb
301
318
  - lib/vimamsa/editor.rb
302
319
  - lib/vimamsa/encrypt.rb
@@ -304,6 +321,7 @@ files:
304
321
  - lib/vimamsa/file_history.rb
305
322
  - lib/vimamsa/file_manager.rb
306
323
  - lib/vimamsa/fold.rb
324
+ - lib/vimamsa/form_input.rb
307
325
  - lib/vimamsa/gui.rb
308
326
  - lib/vimamsa/gui_command_line.rb
309
327
  - lib/vimamsa/gui_dialog.rb
@@ -311,6 +329,7 @@ files:
311
329
  - lib/vimamsa/gui_form_generator.rb
312
330
  - lib/vimamsa/gui_func_panel.rb
313
331
  - lib/vimamsa/gui_image.rb
332
+ - lib/vimamsa/gui_key_hint.rb
314
333
  - lib/vimamsa/gui_keylog_panel.rb
315
334
  - lib/vimamsa/gui_menu.rb
316
335
  - lib/vimamsa/gui_select_window.rb
@@ -321,16 +340,21 @@ files:
321
340
  - lib/vimamsa/gui_theme.rb
322
341
  - lib/vimamsa/hook.rb
323
342
  - lib/vimamsa/hyper_plain_text.rb
343
+ - lib/vimamsa/intro_page.rb
324
344
  - lib/vimamsa/key_actions.rb
325
345
  - lib/vimamsa/key_binding_tree.rb
326
346
  - lib/vimamsa/key_bindings_notepad.rb
327
347
  - lib/vimamsa/key_bindings_report.rb
328
348
  - lib/vimamsa/key_bindings_vim.rb
329
349
  - lib/vimamsa/key_bindings_vimlike.rb
350
+ - lib/vimamsa/key_names.rb
330
351
  - lib/vimamsa/langservp.rb
352
+ - lib/vimamsa/line_tree.rb
331
353
  - lib/vimamsa/macro.rb
332
354
  - lib/vimamsa/main.rb
333
355
  - lib/vimamsa/rbvma.rb
356
+ - lib/vimamsa/registers.rb
357
+ - lib/vimamsa/run_ruby.rb
334
358
  - lib/vimamsa/search.rb
335
359
  - lib/vimamsa/search_replace.rb
336
360
  - lib/vimamsa/string_util.rb
@@ -339,8 +363,12 @@ files:
339
363
  - lib/vimamsa/tests.rb
340
364
  - lib/vimamsa/text_objects.rb
341
365
  - lib/vimamsa/text_transforms.rb
366
+ - lib/vimamsa/tmp_user_dir.rb
367
+ - lib/vimamsa/user_dirs.rb
342
368
  - lib/vimamsa/util.rb
343
369
  - lib/vimamsa/version.rb
370
+ - lib/vimamsa/vim_core.rb
371
+ - lib/vimamsa/vim_operators.rb
344
372
  - modules/calculator/calculator.rb
345
373
  - modules/calculator/calculator_info.rb
346
374
  - modules/color_highlight/color_highlight.rb
@@ -356,15 +384,25 @@ files:
356
384
  - modules/tts/tts_info.rb
357
385
  - run_e2e_vm.sh
358
386
  - run_tests.rb
359
- - run_tests_vm.sh
387
+ - run_tests_vm.rb
360
388
  - scripts/appimage/AppRun
361
389
  - scripts/appimage/Dockerfile
362
390
  - scripts/appimage/build.sh
363
391
  - scripts/appimage/build_in_container.sh
364
392
  - scripts/appimage/smoke_test.sh
393
+ - scripts/demo/demo_easyjump_steps.txt
394
+ - scripts/demo/demo_files_steps.txt
365
395
  - scripts/demo/demo_steps.txt
396
+ - scripts/demo/notes.txt
366
397
  - scripts/demo/record_demo.rb
398
+ - scripts/demo/report.rb
367
399
  - scripts/demo/shapes.rb
400
+ - scripts/demo/square/shapes.rb
401
+ - scripts/demo/square/steps.txt
402
+ - scripts/lib/perf_startup.rb
403
+ - scripts/lib/script_helpers.rb
404
+ - scripts/perf_compare.rb
405
+ - scripts/profile_startup.rb
368
406
  - sheep.jpg
369
407
  - styles/134272-molokai.xml
370
408
  - styles/dark.xml
@@ -374,6 +412,7 @@ files:
374
412
  - tests/support/virtual_keyboard.rb
375
413
  - tests/support/virtual_mic.rb
376
414
  - tests/test_ack.rb
415
+ - tests/test_action_ids.rb
377
416
  - tests/test_auto_format.rb
378
417
  - tests/test_autocomplete.rb
379
418
  - tests/test_autosave.rb
@@ -381,6 +420,7 @@ files:
381
420
  - tests/test_bookmarks.rb
382
421
  - tests/test_bracket_match.rb
383
422
  - tests/test_bundling.rb
423
+ - tests/test_cli_help.rb
384
424
  - tests/test_color_highlight.rb
385
425
  - tests/test_command_line.rb
386
426
  - tests/test_command_line_file.rb
@@ -388,14 +428,18 @@ files:
388
428
  - tests/test_copy_paste.rb
389
429
  - tests/test_crash_handler.rb
390
430
  - tests/test_custom_two_phase.rb
431
+ - tests/test_demo_player.rb
432
+ - tests/test_demo_recorder.rb
391
433
  - tests/test_dialog_callback_errors.rb
392
434
  - tests/test_dictation.rb
393
435
  - tests/test_diff_buffer_name.rb
436
+ - tests/test_dot_repeat.rb
394
437
  - tests/test_double_click.rb
395
438
  - tests/test_drag_selection.rb
396
439
  - tests/test_e2e_cmdline.rb
397
440
  - tests/test_e2e_dictation.rb
398
441
  - tests/test_e2e_replace_char.rb
442
+ - tests/test_easy_jump.rb
399
443
  - tests/test_extract_file_links.rb
400
444
  - tests/test_file_format.rb
401
445
  - tests/test_file_manager.rb
@@ -403,14 +447,19 @@ files:
403
447
  - tests/test_flash.rb
404
448
  - tests/test_fold.rb
405
449
  - tests/test_font_refresh.rb
450
+ - tests/test_form_input.rb
406
451
  - tests/test_func_panel.rb
407
452
  - tests/test_grep_apply.rb
408
453
  - tests/test_gtk_sync.rb
409
454
  - tests/test_hpt_highlight_visible.rb
410
455
  - tests/test_hpt_link_highlight.rb
456
+ - tests/test_intro_page.rb
411
457
  - tests/test_jump_to_file.rb
412
458
  - tests/test_key_bindings.rb
459
+ - tests/test_key_categories.rb
413
460
  - tests/test_keylog_panel.rb
461
+ - tests/test_line_ends.rb
462
+ - tests/test_line_tree.rb
414
463
  - tests/test_lsp_clangd.rb
415
464
  - tests/test_lsp_jump.rb
416
465
  - tests/test_lsp_position_encoding.rb
@@ -420,17 +469,23 @@ files:
420
469
  - tests/test_mode_badge.rb
421
470
  - tests/test_module_interface.rb
422
471
  - tests/test_notepad_bindings.rb
472
+ - tests/test_perf_startup.rb
423
473
  - tests/test_popup_queue.rb
424
474
  - tests/test_random_edit.rb
475
+ - tests/test_registers.rb
425
476
  - tests/test_revert.rb
477
+ - tests/test_run_ruby.rb
426
478
  - tests/test_startup_file.rb
427
479
  - tests/test_status_area.rb
428
480
  - tests/test_text_objects.rb
429
481
  - tests/test_text_transforms.rb
482
+ - tests/test_tmp_user_dir.rb
430
483
  - tests/test_tts.rb
431
484
  - tests/test_undo.rb
485
+ - tests/test_user_dirs.rb
432
486
  - tests/test_vim_bindings.rb
433
487
  - tests/test_vim_conflicts.rb
488
+ - tests/test_vim_operators.rb
434
489
  - tests/test_window_layout.rb
435
490
  - vimamsa.gemspec
436
491
  - vm_guest_run.sh
@@ -446,7 +501,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
446
501
  requirements:
447
502
  - - ">="
448
503
  - !ruby/object:Gem::Version
449
- version: '3.1'
504
+ version: '3.2'
450
505
  required_rubygems_version: !ruby/object:Gem::Requirement
451
506
  requirements:
452
507
  - - ">="
data/run_tests_vm.sh DELETED
@@ -1,130 +0,0 @@
1
- #!/usr/bin/env bash
2
- # Run the vimamsa test suite inside the VirtualBox VM named by $VM_NAME, on its real
3
- # logged-in desktop (so the GTK window actually appears in the VM).
4
- #
5
- # Reaches the guest via VBoxManage guestcontrol (Guest Additions) — no SSH or
6
- # shared folder needed. Syncs the current working tree (incl. uncommitted changes),
7
- # provisions the guest on first run, builds the native extension, then runs
8
- # exe/run_tests.rb on DISPLAY :0. Exits with the suite's exit code (0 pass / 1 fail).
9
- #
10
- # Usage (VM_NAME, VM_USER and VM_PASS exported, e.g. in ~/.bashrc):
11
- # ./run_tests_vm.sh [test filter args...]
12
- # Examples:
13
- # ./run_tests_vm.sh # full suite
14
- # ./run_tests_vm.sh undo # tests/test_undo.rb only
15
- # FORCE_PROVISION=1 ./run_tests_vm.sh # re-run apt provisioning
16
- #
17
- # Env:
18
- # VM_NAME (required) VirtualBox VM name
19
- # VM_USER (required) guest login username
20
- # VM_PASS (required) guest login/sudo password for user $VM_USER
21
- # VM_DISPLAY guest desktop X display (default: :0)
22
- # FORCE_PROVISION set to 1 to force guest re-provisioning
23
- set -euo pipefail
24
-
25
- VM_NAME="${VM_NAME:-}"
26
- VM_USER="${VM_USER:-}"
27
- VM_DISPLAY="${VM_DISPLAY:-:0}"
28
- GUEST_HOME="/home/${VM_USER}"
29
-
30
- missing=()
31
- [ -n "$VM_NAME" ] || missing+=(VM_NAME)
32
- [ -n "$VM_USER" ] || missing+=(VM_USER)
33
- [ -n "${VM_PASS:-}" ] || missing+=(VM_PASS)
34
- if [ ${#missing[@]} -gt 0 ]; then
35
- echo "!! Not set: ${missing[*]}. Export VM_NAME (VirtualBox VM), VM_USER (guest user)" >&2
36
- echo " and VM_PASS (guest password), e.g. in ~/.bashrc." >&2
37
- exit 2
38
- fi
39
-
40
- REPO="$(git -C "$(dirname "$0")" rev-parse --show-toplevel)"
41
-
42
- # Temp files: a chmod-600 passwordfile (so the password isn't visible in `ps`)
43
- # and the source tarball. Both are removed on exit.
44
- PF="$(mktemp)"
45
- TAR="$(mktemp --suffix=.tgz)"
46
- chmod 600 "$PF"
47
- printf '%s' "$VM_PASS" > "$PF"
48
- cleanup() { rm -f "$PF" "$TAR"; }
49
- trap cleanup EXIT
50
-
51
- # In VBoxManage 7.x the credentials/options belong to the run/copyto subcommand
52
- # (after it), and use `--opt=value` syntax.
53
- GC=(VBoxManage guestcontrol "$VM_NAME")
54
- CRED=(--username="$VM_USER" --passwordfile="$PF")
55
-
56
- # 1. Ensure the VM is running and Guest Additions answer.
57
- if ! VBoxManage list runningvms | grep -q "\"$VM_NAME\""; then
58
- echo ">> Starting VM $VM_NAME"
59
- VBoxManage startvm "$VM_NAME" --type gui
60
- fi
61
- echo ">> Waiting for Guest Additions in $VM_NAME"
62
- for i in $(seq 1 60); do
63
- if "${GC[@]}" run "${CRED[@]}" --exe=/bin/true -- true >/dev/null 2>&1; then break; fi
64
- if [ "$i" = 60 ]; then
65
- echo "!! Guest Additions not responding after 60s. Is the guest booted and logged in?" >&2
66
- exit 4
67
- fi
68
- sleep 2
69
- done
70
-
71
- # 2. Tarball the working tree (include .git for `gem build`; drop heavy junk).
72
- # tolerate exit 1 ("file changed as we read it" — e.g. .git churning during the
73
- # read); only a fatal tar error (>=2) should abort.
74
- echo ">> Packing working tree"
75
- set +e
76
- tar czf "$TAR" -C "$REPO" \
77
- --warning=no-file-changed \
78
- --exclude='./.git/hooks' \
79
- --exclude='*_vma_autosave' \
80
- --exclude='.*_vma_autosave' \
81
- --exclude='*.gem' \
82
- --exclude='*.o' \
83
- --exclude='*.so' \
84
- --exclude='*.tar.xz' \
85
- --exclude='__pycache__' \
86
- --exclude='*.log' \
87
- --exclude='claude-log.*' \
88
- --exclude='dot_git_old' \
89
- --exclude='./build' \
90
- --exclude='2del_*' \
91
- --exclude='bug*.txt' \
92
- --exclude='*.mp3' --exclude='*.wav' \
93
- .
94
- trc=$?
95
- set -e
96
- if [ "$trc" -gt 1 ]; then
97
- echo "!! tar failed (exit $trc)" >&2
98
- exit 6
99
- fi
100
-
101
- # 3. Copy the tarball and the guest runner into the VM (copyto overwrites by default).
102
- echo ">> Copying source + runner into guest"
103
- "${GC[@]}" copyto "${CRED[@]}" "$TAR" "${GUEST_HOME}/vimamsa_src.tgz"
104
- "${GC[@]}" copyto "${CRED[@]}" "${REPO}/vm_guest_run.sh" "${GUEST_HOME}/vm_guest_run.sh"
105
-
106
- # 4. Run the guest script, streaming output (tee'd so we can parse the result).
107
- # Secrets/env go via --putenv, never onto the repo. NOTE: VBoxManage does not
108
- # propagate the guest exit code, so pass/fail is taken from the VMA_SUITE_EXIT
109
- # sentinel the guest prints, not from VBoxManage's own exit status.
110
- echo ">> Running test suite in guest (DISPLAY $VM_DISPLAY)"
111
- OUT="$(mktemp)"
112
- trap 'rm -f "$PF" "$TAR" "$OUT"' EXIT
113
- set +e
114
- "${GC[@]}" run "${CRED[@]}" --exe=/bin/bash --wait-stdout --wait-stderr \
115
- --putenv="SUDO_PASS=${VM_PASS}" \
116
- --putenv="VMA_DISPLAY=${VM_DISPLAY}" \
117
- --putenv="VMA_TEST_ARGS=$*" \
118
- --putenv="FORCE_PROVISION=${FORCE_PROVISION:-}" \
119
- --putenv="VMA_E2E_INTERACTIVE=${VMA_E2E_INTERACTIVE:-}" \
120
- -- "${GUEST_HOME}/vm_guest_run.sh" 2>&1 | tee "$OUT"
121
- set -e
122
-
123
- sentinel="$(grep -oE 'VMA_SUITE_EXIT=[0-9]+' "$OUT" | tail -1 | cut -d= -f2)"
124
- if [ -z "$sentinel" ]; then
125
- echo "!! Did not receive a VMA_SUITE_EXIT sentinel from the guest — the run did not" >&2
126
- echo " reach the test phase (provisioning/build failure above)." >&2
127
- exit 5
128
- fi
129
- echo ">> Suite exit code (from guest): $sentinel"
130
- exit "$sentinel"