Skip to content

Commit

Permalink
#32: update comments
Browse files Browse the repository at this point in the history
  • Loading branch information
tlamonthezie committed Jul 23, 2024
1 parent 82ba57e commit 4707631
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 8 deletions.
15 changes: 9 additions & 6 deletions ci/test_cpp.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,17 @@ mkdir -p /opt/src/vt-tv/output/

# run tests (allow failure but generate report to analyze failures later in CI)
ctest --output-junit Testing/Temporary/junit-report.xml --output-on-failure || true

# collect test logs for exporting
mkdir -p /tmp/artifacts/

# add artifact: LastTest.log
cp /opt/build/vt-tv/Testing/Temporary/LastTest.log /tmp/artifacts/ || true
cp /opt/build/vt-tv/Testing/Temporary/junit-report.xml /tmp/artifacts/ || true
# output LastTest.log to screen
cat /opt/build/vt-tv/Testing/Temporary/LastTest.log

# output PNG images from the test_render tests
[ -f "/opt/src/vt-tv/output/test-render/test_vt_tv0.png" ] && cp "/opt/src/vt-tv/output/test-render/test_vt_tv0.png" /tmp/artifacts/
[ -f "/opt/src/vt-tv/output/test-render/ccm_example0.png" ] && cp "/opt/src/vt-tv/output/test-render/ccm_example0.png" /tmp/artifacts/
# add artifacts: PNG images from the test_parse_render tests
[ -f "/opt/src/vt-tv/output/tests/test_vt_tv0.png" ] && cp "/opt/src/vt-tv/output/tests/test_vt_tv0.png" /tmp/artifacts/
[ -f "/opt/src/vt-tv/output/tests/ccm_example0.png" ] && cp "/opt/src/vt-tv/output/tests/ccm_example0.png" /tmp/artifacts/

# coverage reporting
if [[ $VT_TV_COVERAGE_ENABLED == "ON" ]]; then
Expand All @@ -34,10 +34,13 @@ if [[ $VT_TV_COVERAGE_ENABLED == "ON" ]]; then
lcov --list lcov_vt-tv_test_no_deps.info
# add simple coverage artifact
lcov --list lcov_vt-tv_test_no_deps.info > lcov-list-report.txt

# add artifacts: coverage list
cp lcov_vt-tv_test_no_deps.info /tmp/artifacts/
cp /opt/src/vt-tv/output/lcov-list-report.txt /tmp/artifacts/

# extract total coverage (Lines) for later use in a badge in the CI
# add artifacts: coverage total (percentage / lines)
# might be useful for later badging
LCOV_SUMMARY=$(lcov --summary lcov_vt-tv_test_no_deps.info)
LCOV_TOTAL_LINES_COV=$(echo $LCOV_SUMMARY | grep -E -o 'lines......: ([0-9.]+)*' | grep -o -E '[0-9]+.[0-9]+')
echo $LCOV_TOTAL_LINES_COV > lcov-lines-total.txt
Expand Down
4 changes: 2 additions & 2 deletions tests/unit/render/test_render.cc
Original file line number Diff line number Diff line change
Expand Up @@ -73,13 +73,13 @@ class RenderTest :public ::testing::TestWithParam<std::string> {
// Make the output directory for these tests
std::filesystem::create_directory(fmt::format("{}/output", SRC_DIR));
std::filesystem::create_directory(fmt::format("{}/output/tests", SRC_DIR));
std::filesystem::create_directory(fmt::format("{}/output/test_render", SRC_DIR));
std::filesystem::create_directory(fmt::format("{}/output/tests/render", SRC_DIR));
}

protected:
Render createRender(YAML::Node config, Info info, std::string &output_dir) {
// change output directory to use specific one for these tests
output_dir = "output/test_render";
output_dir = "output/tests/render";

std::filesystem::path output_path(output_dir);
if (output_path.is_relative()) {
Expand Down

0 comments on commit 4707631

Please sign in to comment.