summary({'execinfo' : ['stacktrace supported:', false]}, section : 'Debugging', bool_yn : true)
endif
+conf_data.set('ENABLE_UNIT_TESTS', 0)
+option = get_option('unit_tests')
+if not option.disabled()
+ conf_data.set('ENABLE_UNIT_TESTS', 1)
+ # Summary is handled below, where the test() itself is defined.
+endif
+
conf_data.set('HAVE_ARCHIVE', 0)
libarchive_dep = []
req_version = '>=3.4.0'
subdir('po')
subdir('plugins')
+conditional_unit_test_deps = []
+if conf_data.get('ENABLE_UNIT_TESTS', 0) == 1
+ system_gtest_dep = dependency('gtest', main : false, required : false)
+ system_gmock_dep = dependency('gmock', required : false)
+ if system_gtest_dep.found() and system_gmock_dep.found()
+ conditional_unit_test_deps += system_gtest_dep
+ conditional_unit_test_deps += system_gmock_dep
+ else
+ # Use the subproject gtest as a fallback.
+ gtest_subproj = subproject('gtest')
+ conditional_unit_test_deps += gtest_subproj.get_variable('gtest_dep')
+ conditional_unit_test_deps += gtest_subproj.get_variable('gmock_dep')
+ endif
+endif
+
# Generate the executable
subdir('src')
configure_file(input: 'geeqie.spec.in', output: 'geeqie.spec', configuration: conf_data)
+isolate_test_sh = find_program('isolate-test.sh', dirs : scriptsdir, required : true)
+
# Basic test of the executable
-# is_parallel false is to avoid problems with images tests
xvfb = find_program('xvfb-run', required : false)
if xvfb.found()
- test('Basic test', xvfb, args: ['--auto-servernum', geeqie_exe, '--version'], is_parallel : false, timeout: 100)
+ test_cmd = [xvfb.full_path(), '--auto-servernum', geeqie_exe.full_path(), '--version']
+ test('Basic test', isolate_test_sh, args: test_cmd, timeout: 100, suite: 'functional')
summary({'xvfb' : ['Test runs:', true]}, section : 'Testing', bool_yn : true)
else
summary({'xvfb' : ['Test runs:', false]}, section : 'Testing', bool_yn : true)
sources = sources_list.stdout().strip().split('\n')
foreach image : sources
- image_path = '@0@'.format(image)
- path_array = image_path.split('/')
+ path_array = image.split('/')
image_name = path_array[path_array.length() - 1]
- if image_name.startswith('fail')
- test('Image_ ' + image_name, image_test_sh, args: [geeqie_exe, image], is_parallel : false, should_fail : true, timeout: 100)
- else
- test('Image_ ' + image_name, image_test_sh, args: [geeqie_exe, image], is_parallel : false, timeout: 100)
- endif
+ should_fail = image_name.startswith('fail')
+ test_cmd = [image_test_sh.full_path(), geeqie_exe.full_path(), image]
+ test('Image_ ' + image_name, isolate_test_sh, args: test_cmd, should_fail : should_fail, timeout: 100, suite: ['functional', 'image'])
endforeach
summary({'Image tests' : ['Test runs:', true]}, section : 'Testing', bool_yn : true)
else
source_file_name = fs.name(source_file)
config_file = join_paths(meson.project_source_root(), '.clang-tidy')
- test('Code Correctness_ ' + source_file_name, clang_tidy_exe, args : ['-p', './build', '-quiet', '--config-file', config_file, source_file], timeout : 100)
+ test('Code Correctness_ ' + source_file_name, clang_tidy_exe, args : ['-p', './build', '-quiet', '--config-file', config_file, source_file], timeout : 100, suite : 'analysis')
endif
endforeach
if enum_check_sh.found()
foreach source_file : main_sources + pan_view_sources + view_file_sources
source_file_name = fs.name(source_file)
- test('Single Value enum_ ' + source_file_name, enum_check_sh, args : [source_file], timeout : 100)
+ test('Single Value enum_ ' + source_file_name, enum_check_sh, args : [source_file], timeout : 100, suite : 'analysis')
endforeach
summary({'Single Value enum' : ['Test runs:', true]}, section : 'Testing', bool_yn : true)
foreach source_file : main_sources + pan_view_sources + view_file_sources
source_file_name = fs.name(source_file)
if (source_file_name != 'debug.h')
- test('Debug Statements_ ' + source_file_name, debug_check_sh, args : [source_file], timeout : 100)
+ test('Debug Statements_ ' + source_file_name, debug_check_sh, args : [source_file], timeout : 100, suite : 'analysis')
endif
endforeach
summary({'Debug Statements' : ['Test runs:', false]}, section : 'Testing', bool_yn : true)
endif
+# Temporary comments checks
+tmp_comments_check_sh = find_program('temporary-comments-check.sh', dirs : scriptsdir, required : true)
+if tmp_comments_check_sh.found()
+ foreach source_file : main_sources + pan_view_sources + view_file_sources
+ source_file_name = fs.name(source_file)
+ if (source_file_name != 'debug.h')
+ test('Temporary Comments_ ' + source_file_name, tmp_comments_check_sh, args : [source_file], timeout : 100, suite : 'analysis')
+ endif
+ endforeach
+
+ summary({'Temporary Comments' : ['Test runs:', true]}, section : 'Testing', bool_yn : true)
+else
+ summary({'Temporary Comments' : ['Test runs:', false]}, section : 'Testing', bool_yn : true)
+endif
+
+# Untranslated text checks
+untranslated_text_sh = find_program('untranslated-text.sh', dirs : scriptsdir, required : true)
+if untranslated_text_sh.found()
+ foreach source_file : main_sources + pan_view_sources + view_file_sources
+ if fs.name(source_file).endswith('.cc')
+ source_file_name = fs.name(source_file)
+ test('Untranslated Text_ ' + source_file_name, untranslated_text_sh, args : [source_file], timeout : 200, suite : 'analysis')
+ endif
+ endforeach
+
+ summary({'Untranslated Text' : ['Test runs:', true]}, section : 'Testing', bool_yn : true)
+else
+ summary({'Untranslated Text' : ['Test runs:', false]}, section : 'Testing', bool_yn : true)
+endif
+
# Lua test
option = get_option('lua')
if not option.disabled()
if lua_dep.found()
if xvfb.found()
lua_test_sh = find_program('lua-test.sh', dirs : scriptsdir, required : true)
- test('Lua test', lua_test_sh, args: [geeqie_exe], is_parallel : false, timeout: 100)
+ test('Lua test', isolate_test_sh, args: [lua_test_sh.full_path(), geeqie_exe.full_path()], timeout: 100, suite : 'analysis')
summary({'lua' : ['Test runs:', true]}, section : 'Testing', bool_yn : true)
else
# Ancillary files test
test_ancillary_files_sh = find_program('test-ancillary-files.sh', dirs : scriptsdir, required : true)
-test('Ancillary files', test_ancillary_files_sh, args: [meson.current_source_dir()], timeout: 100)
+test('Ancillary files', test_ancillary_files_sh, args: [meson.current_source_dir()], timeout: 100, suite : 'analysis')
summary({'Ancillary files' : ['Test runs:', true]}, section : 'Testing', bool_yn : true)
+
+# Unit tests
+if conf_data.get('ENABLE_UNIT_TESTS', 0) == 1
+ test('Unit tests', isolate_test_sh, args: [geeqie_exe.full_path(), '--run-unit-tests'], suite : 'unit')
+ summary({'unit_tests' : ['Tests run:', true]}, section : 'Testing', bool_yn : true)
+else
+ summary({'unit_tests' : ['Tests run:', false]}, section : 'Testing', bool_yn : true)
+endif