From 58fb41fef7744c252d23e649712c9917808f700f Mon Sep 17 00:00:00 2001 From: "Felipe S. Prado" Date: Thu, 28 Feb 2019 17:34:17 +0100 Subject: [PATCH] Redefine directory for .gcda files and adjust path to source code files --- .gitlab-ci.yml | 10 +++++++++- DRAMSys/tests/DDR3/ci.yml | 19 +++++++++++-------- DRAMSys/tests/WIDEIO/ci.yml | 9 +++++---- 3 files changed, 25 insertions(+), 13 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index f4776ac5..700ec923 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -22,12 +22,19 @@ build: - qmake ../DRAMSys/DRAMSys.pro - make -j4 - find . -name "*.o" -type f -delete + - rm -rf ${CI_PROJECT_DIR}/coverage + - mkdir -p ${CI_PROJECT_DIR}/coverage + cache: key: build paths: - build/ policy: push - + + artifacts: + paths: + - coverage/ + coverage: stage: Coverage coverage: '/Total:\|(\d+\.?\d+\%)/' @@ -37,6 +44,7 @@ coverage: - ls coverage/ -lah - lcov `find coverage -type f -exec echo "-a {}" \;` -o coverage/final.out - lcov --list coverage/final.out + artifacts: paths: - coverage/final.out diff --git a/DRAMSys/tests/DDR3/ci.yml b/DRAMSys/tests/DDR3/ci.yml index b92199d0..a5afa603 100644 --- a/DRAMSys/tests/DDR3/ci.yml +++ b/DRAMSys/tests/DDR3/ci.yml @@ -2,6 +2,8 @@ example_ddr3: stage: DDR3 script: + - export GCOV_PREFIX=$(pwd) + - export GCOV_PREFIX_STRIP=$(pwd | awk -F"/" '{print NF-1}') - cd build/simulator - ./DRAMSys ../../DRAMSys/tests/DDR3/simulations/ddr3-example.xml ../../DRAMSys/tests/DDR3/ - ls -lah @@ -11,15 +13,14 @@ example_ddr3: - cd ../traceAnalyzer - python3 ../../DRAMSys/traceAnalyzer/scripts/tests.py ../simulator/ddr3-example_ddr3_ch0.tdb | if ! grep "failed"; then exit 0; else exit 1; fi # Run Code Coverage - - mkdir -p ${CI_PROJECT_DIR}/coverage - - lcov -q -c -d ${CI_PROJECT_DIR}/build/ -o ${CI_PROJECT_DIR}/coverage/${CI_JOB_NAME}.out + - lcov -q -c --rc geninfo_adjust_src_path=$GCOV_PREFIX -d ${CI_PROJECT_DIR}/build/ -o ${CI_PROJECT_DIR}/coverage/${CI_JOB_NAME}.out cache: key: build paths: - build/ policy: pull - + artifacts: paths: - build/simulator/ddr3-example_ddr3_ch0.tdb @@ -30,6 +31,8 @@ example_ddr3: fr_fcfs: stage: DDR3 script: + - export GCOV_PREFIX=$(pwd) + - export GCOV_PREFIX_STRIP=$(pwd | awk -F"/" '{print NF-1}') - cd build/simulator - ./DRAMSys ../../DRAMSys/tests/DDR3/simulations/ddr3-fr_fcfs.xml ../../DRAMSys/tests/DDR3/ - ls -lah @@ -39,8 +42,7 @@ fr_fcfs: - cd ../traceAnalyzer - python3 ../../DRAMSys/traceAnalyzer/scripts/tests.py ../simulator/ddr3-fr_fcfs_ddr3_ch0.tdb | if ! grep "failed"; then exit 0; else exit 1; fi # Run Code Coverage - - mkdir -p ${CI_PROJECT_DIR}/coverage - - lcov -q -c -d ${CI_PROJECT_DIR}/build/ -o ${CI_PROJECT_DIR}/coverage/${CI_JOB_NAME}.out + - lcov -q -c --rc geninfo_adjust_src_path=$GCOV_PREFIX -d ${CI_PROJECT_DIR}/build/ -o ${CI_PROJECT_DIR}/coverage/${CI_JOB_NAME}.out cache: key: build @@ -56,17 +58,18 @@ fr_fcfs: - coverage/${CI_JOB_NAME}.out expire_in: 2 days -# Testing with TLM Protocol Cchecker +# Testing with TLM Protocol Checker protocol_checker: stage: DDR3 script: + - export GCOV_PREFIX=$(pwd) + - export GCOV_PREFIX_STRIP=$(pwd | awk -F"/" '{print NF-1}') - cd build/simulator - ./DRAMSys ../../DRAMSys/tests/DDR3/simulations/ddr3-protocol_checker.xml ../../DRAMSys/tests/DDR3/ > output.txt - echo "TODO" - ls -lah # Run Code Coverage - - mkdir -p ${CI_PROJECT_DIR}/coverage - - lcov -q -c -d ${CI_PROJECT_DIR}/build/ -o ${CI_PROJECT_DIR}/coverage/${CI_JOB_NAME}.out + - lcov -q -c --rc geninfo_adjust_src_path=$GCOV_PREFIX -d ${CI_PROJECT_DIR}/build/ -o ${CI_PROJECT_DIR}/coverage/${CI_JOB_NAME}.out cache: key: build diff --git a/DRAMSys/tests/WIDEIO/ci.yml b/DRAMSys/tests/WIDEIO/ci.yml index 2b79cb5b..e04215e0 100644 --- a/DRAMSys/tests/WIDEIO/ci.yml +++ b/DRAMSys/tests/WIDEIO/ci.yml @@ -2,10 +2,12 @@ example_wideio: stage: WIDEIO script: + - export GCOV_PREFIX=$(pwd) + - export GCOV_PREFIX_STRIP=$(pwd | awk -F"/" '{print NF-1}') # Generate specific traces for WIDEIO: - cd DRAMSys/tests/WIDEIO/traces/ - perl generator.pl - - cd ../../../../ + - cd - # Run DRAMSys - cd build/simulator - ./DRAMSys ../../DRAMSys/tests/WIDEIO/simulations/wideio-example.xml ../../DRAMSys/tests/WIDEIO/ @@ -17,15 +19,14 @@ example_wideio: - python3 ../../DRAMSys/traceAnalyzer/scripts/tests.py ../simulator/wideio-example_wideio_ch2.tdb | if ! grep "failed"; then exit 0; else exit 1; fi - python3 ../../DRAMSys/traceAnalyzer/scripts/tests.py ../simulator/wideio-example_wideio_ch3.tdb | if ! grep "failed"; then exit 0; else exit 1; fi # Run Code Coverage - - mkdir -p ${CI_PROJECT_DIR}/coverage - - lcov -q -c -d ${CI_PROJECT_DIR}/build/ -o ${CI_PROJECT_DIR}/coverage/${CI_JOB_NAME}.out + - lcov -q -c --rc geninfo_adjust_src_path=$GCOV_PREFIX -d ${CI_PROJECT_DIR}/build/ -o ${CI_PROJECT_DIR}/coverage/${CI_JOB_NAME}.out cache: key: build paths: - build/ policy: pull - + allow_failure: true # TODO: should be removed once the problems are fixed! artifacts: