|
5 | 5 | import sys |
6 | 6 | from testutils import cppcheck, assert_cppcheck |
7 | 7 |
|
| 8 | +__script_dir = os.path.dirname(os.path.abspath(__file__)) |
8 | 9 |
|
9 | 10 | def test_project_force_U(tmpdir): |
10 | 11 | # 10018 |
@@ -845,22 +846,18 @@ def test_compdb_D(tmpdir): |
845 | 846 | assert ret == 0, stdout |
846 | 847 |
|
847 | 848 |
|
848 | | -def test_shared_items_project(tmpdir = ""): |
849 | | - # tmpdir is unused |
850 | | - solutionDir = os.path.join(os.getcwd(), 'shared-items-project') |
851 | | - solutionFile = os.path.join(solutionDir, 'Solution.sln') |
| 849 | +def test_shared_items_project(): |
| 850 | + solution_file = os.path.join('shared-items-project', 'Solution.sln') |
852 | 851 |
|
853 | 852 | args = [ |
854 | 853 | '--platform=win64', |
855 | | - '--project={}'.format(solutionFile), |
856 | | - '--project-configuration=Release|x64', |
857 | | - '-j1' |
| 854 | + '--project={}'.format(solution_file), |
| 855 | + '--project-configuration=Release|x64' |
858 | 856 | ] |
859 | 857 |
|
860 | | - exitcode, stdout, stderr = cppcheck(args) |
| 858 | + exitcode, stdout, stderr = cppcheck(args, cwd=__script_dir) |
861 | 859 | assert exitcode == 0 |
862 | | - lines = stdout.splitlines() |
863 | 860 |
|
864 | 861 | # Assume no errors, and that shared items code files have been checked as well |
865 | | - assert any('2/2 files checked 100% done' in x for x in lines) |
| 862 | + assert '2/2 files checked ' in stdout # only perform partial check since -j2 does not report a percentage right now |
866 | 863 | assert stderr == '' |
0 commit comments