Skip to content

Commit 4faf04c

Browse files
committed
account for different file orders
1 parent 4745c6d commit 4faf04c

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
@@ -76,10 +76,12 @@ def test_absolute_path():
7676
def test_progress_threads():
7777
size1 = os.path.getsize(os.path.join(__proj_dir, 'a', 'a.c'))
7878
size2 = os.path.getsize(os.path.join(__proj_dir, 'b', 'b.c'))
79+
perc1 = 100 * size1 // (size1 + size2)
80+
perc2 = 100 * size2 // (size1 + size2)
7981
__create_compile_commands()
8082
ret, stdout, _ = cppcheck(['--project=' + os.path.join(__proj_dir, __COMPILE_COMMANDS_JSON), '-j2'], cwd=__script_dir)
8183
assert ret == 0, stdout
82-
assert stdout.find('1/2 files checked %d%% done' % (100 * size1 // (size1 + size2))) >= 0
84+
assert stdout.find('1/2 files checked %d%% done' % perc1) >= 0 or stdout.find('1/2 files checked %d%% done' % perc2) >= 0
8385
assert stdout.find('2/2 files checked 100% done') >= 0
8486

8587
def test_gui_project_loads_compile_commands_1():

0 commit comments

Comments
 (0)