Skip to content

Commit

Permalink
Run the libyui tests
Browse files Browse the repository at this point in the history
  • Loading branch information
mvidner committed Oct 6, 2020
1 parent d2dafcc commit 9f14131
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 10 deletions.
6 changes: 3 additions & 3 deletions package/yast2-ruby-bindings.spec
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,9 @@ BuildRequires: yast2-ycp-ui-bindings-devel >= 4.3.1
# The test suite includes a regression test (std_streams_spec.rb) for a
# libyui-ncurses bug fixed in 2.47.3
BuildRequires: libyui-ncurses >= 2.47.3
# The mentioned test requires to check if tmux is there, because tmux is
# needed to execute the test in headless systems
BuildRequires: which
# The mentioned test requires tmux in order to be executed in headless systems
# Also many other lubyui tests to come
BuildRequires: tmux

# only a soft dependency, the Ruby debugger is optional
Suggests: rubygem(%{rb_default_ruby_abi}:byebug)
Expand Down
16 changes: 13 additions & 3 deletions tests/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
#
# CMakeLists.txt for yast2/ruby-bindings/tests/ruby
#
# CMakeLists.txt for yast-ruby-bindings/tests

# use
# make test
# or, for verbose output,
# make test ARGS=-V
# ARGS is passed to ctest; see also
# man ctest

ENABLE_TESTING()

Expand All @@ -12,3 +17,8 @@ endforeach(test)

ADD_TEST("integration" ruby ${CMAKE_CURRENT_SOURCE_DIR}/integration/run.rb)
ADD_TEST("translations" rspec --format doc ${CMAKE_CURRENT_SOURCE_DIR}/integration/translations_spec.rb)

file(GLOB libyui_tests "libyui/*.test")
foreach(test ${libyui_tests})
ADD_TEST(${test} ${test})
endforeach()
2 changes: 1 addition & 1 deletion tests/libyui/README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@

- `foo` - main script of the test case
- `foo.test` - main script of the test case
- `foo.rb` - UI set up
9 changes: 8 additions & 1 deletion tests/libyui/table_sort_wrong_cell_1165388.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
#!/usr/sbin/yast
#! /usr/bin/env ruby
require_relative "../test_helper"
require "yast"

if Yast.ui_component == ""
Yast.ui_component = ARGV[0] || "ncurses"
end

module Yast
class TableCellClient < Client
def main
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
#!/bin/sh
set -u # unset variables are an error
. ../examples/screenshots-tui/scripts/tmux-uitest.sh
MYDIR=$(dirname $0)
. "$MYDIR"/tmux-uitest.sh
BASE=table_sort_wrong_cell_1165388

tmux_new_session /usr/sbin/yast ./"$BASE".rb || exit
tmux_new_session "$MYDIR"/"$BASE".rb || exit
tmux_await "Table sorting test" || exit
sleep 0.1 # draw the rest of the screen

Expand Down

0 comments on commit 9f14131

Please sign in to comment.