1. 30 Jan, 2020 13 commits
    • Pekka Paalanen's avatar
      tests: migrate devices · 3fb67936
      Pekka Paalanen authored
      
      
      The devices test was actually using the defaults instead of
      weston-test-desktop-shell in meson.build, so this patch keeps it that way.
      Signed-off-by: default avatarPekka Paalanen <pekka.paalanen@collabora.com>
      3fb67936
    • Pekka Paalanen's avatar
      meson: remove tests_weston_plugin · af18eb0b
      Pekka Paalanen authored
      
      
      All plugin tests have been converted to the new harness, so the old definition
      can be removed.
      
      The one remaining test surface-screenshot is a manual test, the plugin only
      installs a debug key binding. Hence it is open-coded as a normal plugin, not as
      a test.
      Signed-off-by: default avatarPekka Paalanen <pekka.paalanen@collabora.com>
      af18eb0b
    • Pekka Paalanen's avatar
      tests: migrate surface, surface-global · 99c536db
      Pekka Paalanen authored
      
      
      These are normal plugin tests, moved to the new harness.
      Signed-off-by: default avatarPekka Paalanen <pekka.paalanen@collabora.com>
      99c536db
    • Pekka Paalanen's avatar
      9615ad8b
    • Pekka Paalanen's avatar
      tests: migrate ivi-shell-app · 431ec067
      Pekka Paalanen authored
      
      
      Moving to the new test harness.
      
      Carrying the test ini file still just to keep it the same even though I
      accidentally noticed the test succeeds also with --no-config.
      Signed-off-by: default avatarPekka Paalanen <pekka.paalanen@collabora.com>
      431ec067
    • Pekka Paalanen's avatar
      tests: migrate ivi-layout-internal · ad1a4102
      Pekka Paalanen authored
      
      
      Moving to the new harness.
      
      It would be possible to convert every case here into a separate PLUGIN_TEST,
      but I did not see the value in that at this time.
      Signed-off-by: default avatarPekka Paalanen <pekka.paalanen@collabora.com>
      ad1a4102
    • Pekka Paalanen's avatar
      tests: migrate ivi-layout-test · 7f840b72
      Pekka Paalanen authored
      
      
      The ivi-layout-test comprises of two halves: the client and the plugin. This
      migrates the test to the new test harness.
      
      In the old harness, the plugin was built as the test in meson.build and it fork
      & exec'd the client part. In the new harness client tests start from the client
      program which sets up the compositor in-process, so now the client is built as
      the test in meson.build and the plugin is just an additional file.
      
      Therefore there is not need for the plugin for fork & exec anything anymore, so
      all that code is removed.
      Signed-off-by: default avatarPekka Paalanen <pekka.paalanen@collabora.com>
      7f840b72
    • Pekka Paalanen's avatar
      tests: migrate string and vertex-clip · 57a4508e
      Pekka Paalanen authored
      
      
      These are the only remaining standalone non-ZUC tests. They do not need any
      changes to be built with the new harness - in fact they have already been
      running through the new harness.
      Signed-off-by: default avatarPekka Paalanen <pekka.paalanen@collabora.com>
      57a4508e
    • Pekka Paalanen's avatar
      doc: overview of the test suite · c22f3574
      Pekka Paalanen authored
      
      
      This should lower the barrier to entry for writing more tests.
      Signed-off-by: default avatarPekka Paalanen <pekka.paalanen@collabora.com>
      c22f3574
    • Pekka Paalanen's avatar
      tests: stop relying on environment in the new harness · 82dd6ce8
      Pekka Paalanen authored
      
      
      Instead of relying on Meson setting up environment so that Weston and tests
      find all their files, build those values into the tests. This way one can
      execute a test program successfully wihtout Meson, simply by running it.
      
      The old environment variables are still honoured if set. This might change in
      the future.
      
      Baking the source or build directory paths into the tests should not regress
      reproducible builds, because the binaries where test-config.h values are used
      will not be installed.
      Signed-off-by: default avatarPekka Paalanen <pekka.paalanen@collabora.com>
      82dd6ce8
    • Pekka Paalanen's avatar
      tests: thread-based client harness · babb3b3b
      Pekka Paalanen authored
      
      
      This replaces the old test harness with a new one.
      
      The old harness relied on fork()'ing each test which makes tests independent,
      but makes debugging them harder. The new harness runs client code in a thread
      instead of a new process. A side-effect of not fork()'ing anymore is that any
      failure will stop running a test series short. Fortunately we do not have any
      tests that are expected to crash or fail.
      
      The old harness executed 'weston' from Meson, with lots of setup as both
      command line options and environment variables. The new harness executes
      wet_main() instead: the test program itself calls the compositor main function
      to execute the compositor in-process. Command line arguments are configured in
      the test program itself, not in meson.build. Environment variables aside, you
      are able to run a test by simply executing the test program, even if it is a
      plugin test.
      
      The new harness adds a new type of iteration: fixtures. For now, fixtures are
      used to set up the compositor for tests that need a compositor. If necessary, a
      fixture setup may include a data array of arbitrary type for executing the test
      series for each element in the array. This will be most useful for running
      screenshooting tests with both Pixman- and GL-renderers.
      
      The new harness outputs TAP formatted results into stdout. Meson is not
      switched to consume TAP yet though, because it would require a Meson version
      requirement bump and would not have any benefits at this time. OTOH outputting
      TAP is trivial and sets up a clear precedent of random test chatter belonging
      to stderr.
      
      This commit migrates only few tests to actually make use of the new features:
      roles is a basic client test, subsurface-shot is a client test that
      demonstrates the fixture array, and plugin-registry is a plugin test. The rest
      of the tests will be migrated later.
      
      Once all tests are migrated, we can remove the test-specific setup from
      meson.build, leaving only the actual build instructions in there.
      
      The not migrated tests and stand-alone tests suffer only a minor change: they
      no longer fork() for each TEST(), otherwise they keep running as before.
      Signed-off-by: default avatarPekka Paalanen <pekka.paalanen@collabora.com>
      babb3b3b
    • Pekka Paalanen's avatar
      tests: move exit() from run_test() · 2c8203dc
      Pekka Paalanen authored
      
      
      I will be able to re-use this function if it does not call exit() itself.
      Signed-off-by: default avatarPekka Paalanen <pekka.paalanen@collabora.com>
      2c8203dc
    • Pekka Paalanen's avatar
      compositor: add test suite data · 61a6b03d
      Pekka Paalanen authored
      
      
      Allow to set and get one opaque pointer. The test suite will then use this to
      pass data from the test runner to the test plugin, so that the plugin can then
      run what it needs to. This is useful when the test runner calls wet_main()
      directly instead of forking a compositor.
      Signed-off-by: default avatarPekka Paalanen <pekka.paalanen@collabora.com>
      61a6b03d
  2. 29 Jan, 2020 26 commits
  3. 28 Jan, 2020 1 commit