Skip to content

Commit

Permalink
tests: Try to make the solib test less fickle
Browse files Browse the repository at this point in the history
  • Loading branch information
SimonKagstrom committed Jul 16, 2024
1 parent 8b020af commit 618a6cf
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
3 changes: 3 additions & 0 deletions tests/shared-library/solib.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,10 @@ int vobb(int a)
a = a + 1;

if (a > 2)
{
printf("a is greater than 2\n");
return 1;
}

return 0;
}
Expand Down
4 changes: 2 additions & 2 deletions tests/tools/test_compiled.py
Original file line number Diff line number Diff line change
Expand Up @@ -498,7 +498,7 @@ def runTest(self):
assert cobertura.hitsPerLine(dom, "dlopen.cc", 11) == 1
assert cobertura.hitsPerLine(dom, "dlopen.cc", 12) == 0
assert cobertura.hitsPerLine(dom, "solib.c", 5) == 1
assert cobertura.hitsPerLine(dom, "solib.c", 12) == 0
assert cobertura.hitsPerLine(dom, "solib.c", 15) == 0


class dlopen_in_ignored_source_file(libkcov.TestCase):
Expand All @@ -516,7 +516,7 @@ def runTest(self):
dom = cobertura.parseFile(self.outbase + "/kcov/dlopen/cobertura.xml")
assert cobertura.hitsPerLine(dom, "dlopen-main.cc", 10) == 1
assert cobertura.hitsPerLine(dom, "solib.c", 5) == 1
assert cobertura.hitsPerLine(dom, "solib.c", 12) == 0
assert cobertura.hitsPerLine(dom, "solib.c", 15) == 0


class daemon_no_wait_for_last_child(libkcov.TestCase):
Expand Down
5 changes: 2 additions & 3 deletions tests/tools/test_compiled_basic.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,10 @@ def runTest(self):
+ "/shared_library_test",
False,
)
self.skipTest("Fickle test, ignoring")
assert rv == 0

dom = cobertura.parseFile(self.outbase + "/kcov/shared_library_test/cobertura.xml")
assert cobertura.hitsPerLine(dom, "main.c", 9) == 1
assert cobertura.hitsPerLine(dom, "main.c", 9) >= 1
assert cobertura.hitsPerLine(dom, "solib.c", 5) is None


Expand Down Expand Up @@ -74,7 +73,7 @@ def runTest(self):
dom = cobertura.parseFile(self.outbase + "/kcov/shared_library_test/cobertura.xml")
assert cobertura.hitsPerLine(dom, "main.c", 9) == 1
assert cobertura.hitsPerLine(dom, "solib.c", 5) == 1
assert cobertura.hitsPerLine(dom, "solib.c", 10) == 1
assert cobertura.hitsPerLine(dom, "solib.c", 11) >= 1


class MainTestBase(libkcov.TestCase):
Expand Down

0 comments on commit 618a6cf

Please sign in to comment.