Issue #15763 is again mostly false positive crashes of the unit tests because the code is only partly GIMP code, arranged differently as what a full GIMP process would actually do. The new tests just runs on the real GIMP code. Now the difference is that we don't test the UI by doing this, but this can be debated whether the previous tests were actually running on the UI themselves (they were mostly running some core code directly and sometimes activating some actions or raising dialogs (gimp_test_utils_create_image_from_dialog()), but again not by actually clicking or hitting keys as a human would do. It's not proper UI testing (cf. #9339 of #13376 for further discussions on this topic). So in the meantime, let's go with this intermediate step. At least now, such tests would run actual GIMP code and would catch issues which could really happen in a GIMP process.
112 lines
2.5 KiB
Meson
112 lines
2.5 KiB
Meson
apptests_links = [
|
|
libappconfig,
|
|
libappactions,
|
|
libappdialogs,
|
|
libappdisplay,
|
|
libappgui,
|
|
libappmenus,
|
|
libapppropgui,
|
|
libapptools,
|
|
libappwidgets,
|
|
libgimpbase,
|
|
libgimpcolor,
|
|
libgimpconfig,
|
|
libgimpmath,
|
|
libgimpmodule,
|
|
libgimpthumb,
|
|
libgimpwidgets,
|
|
]
|
|
|
|
|
|
libapptestutils_sources = [
|
|
'gimp-app-test-utils.c',
|
|
'gimp-test-session-utils.c',
|
|
]
|
|
|
|
libapptestutils = static_library('apptestutils',
|
|
libapptestutils_sources,
|
|
dependencies: libapp_dep,
|
|
link_with: apptests_links,
|
|
)
|
|
|
|
apptests_links += libapptestutils
|
|
|
|
|
|
app_tests = [
|
|
'core',
|
|
'gimpidtable',
|
|
#'session-2-8-compatibility-multi-window',
|
|
#'session-2-8-compatibility-single-window',
|
|
'single-window-mode',
|
|
#'tools',
|
|
'ui',
|
|
'xcf',
|
|
]
|
|
|
|
# Prevent parallel builds for the tests
|
|
# The tests must not be run in parallel or in a different order as specified
|
|
|
|
prio = 1000
|
|
foreach test_name : app_tests
|
|
test_exe = executable(test_name,
|
|
'test-@0@.c'.format(test_name),
|
|
'tests.c',
|
|
dependencies: [ libapp_dep, appstream ],
|
|
link_with: apptests_links,
|
|
)
|
|
|
|
test(test_name,
|
|
test_exe,
|
|
env: [
|
|
'GIMP_TESTING_ABS_TOP_SRCDIR=' + meson.project_source_root(),
|
|
'GIMP_TESTING_ABS_TOP_BUILDDIR='+ meson.project_build_root(),
|
|
'GIMP_TESTING_PLUGINDIRS=' + meson.project_build_root()/'plug-ins'/'common',
|
|
'UI_TEST=yes',
|
|
],
|
|
suite: 'app',
|
|
timeout: 60,
|
|
is_parallel : false,
|
|
priority: prio,
|
|
)
|
|
|
|
prio = prio - 10
|
|
|
|
endforeach
|
|
|
|
## Newer Tests using GIMP directly ##
|
|
|
|
if not meson.can_run_host_binaries()
|
|
warning('XCF loading unit testing disabled in cross-building or similar environments.')
|
|
subdir_done()
|
|
endif
|
|
|
|
tests = [
|
|
{
|
|
'name': 'save-and-export',
|
|
}
|
|
]
|
|
|
|
test_env=gimp_run_env
|
|
test_env.set('GIMP_TESTING_ABS_TOP_SRCDIR', meson.project_source_root())
|
|
test_env.set('GIMP_TESTING_ABS_TOP_BUILDDIR', meson.project_build_root())
|
|
|
|
run_python_test = find_program(meson.project_source_root() / 'libgimp/tests/libgimp-run-python-test.py')
|
|
foreach testinfo : tests
|
|
test_name = testinfo['name']
|
|
basename = 'test-' + testinfo['name']
|
|
|
|
py_test = meson.current_source_dir() / basename + '.py'
|
|
if testinfo.has_key('input')
|
|
test(test_name, run_python_test,
|
|
args: [ gimp_exe.full_path(), py_test, testinfo['input']],
|
|
env: test_env,
|
|
suite: ['app'],
|
|
timeout: 90)
|
|
else
|
|
test(test_name, run_python_test,
|
|
args: [ gimp_exe.full_path(), py_test ],
|
|
env: test_env,
|
|
suite: ['app'],
|
|
timeout: 90)
|
|
endif
|
|
endforeach
|