Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

handle lcov end line number #105

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions fastcov.py
Original file line number Diff line number Diff line change
Expand Up @@ -807,9 +807,10 @@ def parseInfo(path):
})
current_data = fastcov_json["sources"][current_sf][current_test_name]
elif line.startswith("FN:"):
line_num, function_name = line[3:].strip().split(",")
line_nums, function_name = line[3:].strip().rsplit(",", maxsplit=1)
line_num_start = line_nums.split(",")[0]
current_data["functions"][function_name] = {}
current_data["functions"][function_name]["start_line"] = tryParseNumber(line_num)
current_data["functions"][function_name]["start_line"] = tryParseNumber(line_num_start)
elif line.startswith("FNDA:"):
count, function_name = line[5:].strip().split(",")
current_data["functions"][function_name]["execution_count"] = tryParseNumber(count)
Expand Down
29 changes: 29 additions & 0 deletions test/functional/expected_results/combine6.expected.info
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
TN:
SF:/mnt/workspace/test/functional/cmake_project/src/source1.cpp
FN:3,_Z3foob
FNDA:1,_Z3foob
FNF:1
FNH:1
DA:3,1
DA:5,1
DA:7,1001
DA:8,1000
DA:10,1000
DA:11,0
DA:14,1
LF:7
LH:6
end_of_record
TN:
SF:/mnt/workspace/test/functional/cmake_project/src/source2.cpp
FN:3,_Z3barbii
FNDA:10,_Z3barbii
FNF:1
FNH:1
DA:3,10
DA:5,10
DA:6,10
DA:8,0
LF:4
LH:3
end_of_record
29 changes: 29 additions & 0 deletions test/functional/expected_results/test1.end_line_number_fn.info
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
TN:
SF:/mnt/workspace/test/functional/cmake_project/src/source1.cpp
FN:3,10,_Z3foob
FNDA:1,_Z3foob
FNF:1
FNH:1
DA:3,1
DA:5,1
DA:7,1001
DA:8,1000
DA:10,1000
DA:11,0
DA:14,1
LF:7
LH:6
end_of_record
TN:
SF:/mnt/workspace/test/functional/cmake_project/src/source2.cpp
FN:3,10,_Z3barbii
FNDA:10,_Z3barbii
FNF:1
FNH:1
DA:3,10
DA:5,10
DA:6,10
DA:8,0
LF:4
LH:3
end_of_record
4 changes: 4 additions & 0 deletions test/functional/run_all.sh
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,10 @@ cmp combine3.actual.info ${TEST_DIR}/expected_results/combine3.expected.info
coverage run -a ${TEST_DIR}/fastcov.py -C ${TEST_DIR}/expected_results/combine4a.info ${TEST_DIR}/expected_results/combine4b.info ${TEST_DIR}/expected_results/combine4c.info --lcov -o combine4.actual.info
cmp combine4.actual.info ${TEST_DIR}/expected_results/combine4.expected.info

# Combine operation - End line number in FN
coverage run -a ${TEST_DIR}/fastcov.py -C ${TEST_DIR}/expected_results/test1.end_line_number_fn.info --lcov -o test1.end_line_number_fn.actual.info
cmp test1.end_line_number_fn.actual.info ${TEST_DIR}/expected_results/combine6.expected.info

# Combine operation - Missing TN
coverage run -a ${TEST_DIR}/fastcov.py -C ${TEST_DIR}/expected_results/test1.no_tn.info --lcov -o test1.no_tn.actual.info
cmp test1.no_tn.actual.info ${TEST_DIR}/expected_results/combine5.expected.info
Expand Down
Loading