← Back to team overview

widelands-dev team mailing list archive

[Merge] lp:~widelands-dev/widelands/bug-1825486-inputqueue-test into lp:widelands

 

GunChleoc has proposed merging lp:~widelands-dev/widelands/bug-1825486-inputqueue-test into lp:widelands.

Requested reviews:
  Widelands Developers (widelands-dev)
Related bugs:
  Bug #1825486 in widelands: "input_queues test will often stall"
  https://bugs.launchpad.net/widelands/+bug/1825486

For more details, see:
https://code.launchpad.net/~widelands-dev/widelands/bug-1825486-inputqueue-test/+merge/368430

Just for triggering Travis at this point - can't reproduce locally.
-- 
Your team Widelands Developers is requested to review the proposed merge of lp:~widelands-dev/widelands/bug-1825486-inputqueue-test into lp:widelands.
=== modified file '.travis.sh'
--- .travis.sh	2019-01-12 12:36:28 +0000
+++ .travis.sh	2019-06-06 05:50:03 +0000
@@ -69,5 +69,7 @@
 if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then
   # Run the regression suite. Haven't gotten it working on osx, due to problems with xvfb and/or opengl support.
   cd ..
-  ./regression_test.py -b build/src/widelands
+  # NOCOM ./regression_test.py -b build/src/widelands
+  ./widelands --verbose=true --datadir=data --datadir_for_testing=. --nosound --language=en_US --scenario=test/maps/plain.wmf --script=test/maps/plain.wmf/scripting/test_inputqueues.lua
+
 fi

=== modified file 'test/maps/plain.wmf/scripting/test_inputqueues.lua'
--- test/maps/plain.wmf/scripting/test_inputqueues.lua	2018-10-27 09:45:14 +0000
+++ test/maps/plain.wmf/scripting/test_inputqueues.lua	2019-06-06 05:50:03 +0000
@@ -4,17 +4,21 @@
 run(function()
 
    local function assert_all_queues_are_full(building)
+   print("NOCOM 1")
       local inputs = building:get_inputs("all")
       for name, amount in pairs(building.valid_inputs) do
          assert_equal(amount, inputs[name])
       end
+      print("NOCOM 2")
    end
 
    local function assert_all_queues_are_empty(building)
+   print("NOCOM 3")
       local inputs = building:get_inputs("all")
       for name, amount in pairs(building.valid_inputs) do
          assert_equal(0, inputs[name])
       end
+      print("NOCOM 4")
    end
 
    sleep(1000)
@@ -22,35 +26,57 @@
    local b = p1:place_building("barbarians_barracks", map:get_field(25, 25), false, true)
    sleep(1000)
 
+   print("NOCOM 5")
+
    -- Test start/stop and ensure that the building is stopped
    local building_was_stopped = b.is_stopped
 
+   print("NOCOM 6")
+
    b:toggle_start_stop()
    sleep(1000)
+   print("NOCOM 7")
    assert_equal(not building_was_stopped, b.is_stopped)
+   print("NOCOM 8")
 
    b:toggle_start_stop()
    sleep(1000)
+   print("NOCOM 9")
    assert_equal(building_was_stopped, b.is_stopped)
+   print("NOCOM 10")
 
    if not b.is_stopped then
+   print("NOCOM 11")
       b:toggle_start_stop()
       sleep(1000)
    end
 
+   print("NOCOM 12")
+
    -- Now test filling the queues and workers
    assert_all_queues_are_empty(b)
 
+   print("NOCOM 13")
+
    b:set_inputs(b.valid_inputs)
+   print("NOCOM 14")
    b:set_workers(b.valid_workers)
 
+   print("NOCOM 15")
+
    assert_all_queues_are_full(b)
 
+   print("NOCOM 16")
+
    stable_save(game, "inputqueues")
+
+   print("NOCOM 17")
    sleep(1000)
 
    assert_all_queues_are_full(b)
 
+   print("NOCOM 18")
+
    print("# All Tests passed.")
    wl.ui.MapView():close()
 end)


Follow ups