Skip to content

Commit c25e0e9

Browse files
committed
calculate percentage in test
1 parent 0426473 commit c25e0e9

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

test/cli/proj2_test.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,10 +74,12 @@ def test_absolute_path():
7474
assert stdout.find('Checking %s ...' % file2) >= 0
7575

7676
def test_progress_threads():
77+
size1 = os.path.getsize(os.path.join(__proj_dir, 'a', 'a.c'))
78+
size2 = os.path.getsize(os.path.join(__proj_dir, 'b', 'b.c'))
7779
__create_compile_commands()
7880
ret, stdout, _ = cppcheck(['--project=' + os.path.join(__proj_dir, __COMPILE_COMMANDS_JSON), '-j2'], cwd=__script_dir)
7981
assert ret == 0, stdout
80-
assert stdout.find('1/2 files checked 76% done') >= 0
82+
assert stdout.find('1/2 files checked %d%% done' % (100 * size1 // (size1 + size2))) >= 0
8183
assert stdout.find('2/2 files checked 100% done') >= 0
8284

8385
def test_gui_project_loads_compile_commands_1():

0 commit comments

Comments
 (0)