From 4e035cb6bf2619ad3dad76fd697085f3ebe7853b Mon Sep 17 00:00:00 2001
From: francesco <info.francescobianco@gmail.com>
Date: Wed, 1 Jul 2020 23:00:13 +0200
Subject: [PATCH 01/32] wip

---
 README.md                                     |  2 +-
 RELEASE                                       |  1 -
 lcov.sh                                       | 45 ++++++++++++++-----
 test/fixtures/custom.zsh                      |  2 +-
 test/fixtures/sample.sh                       |  2 +-
 test/fixtures/subdir/custom1.zsh              |  2 +-
 test/fixtures/test1.sh                        |  2 +-
 test/fixtures/test2.sh                        |  2 +-
 test/{lcov_done-test.sh => lcov_done.test.sh} |  2 +-
 test/run.test.sh                              |  8 ++++
 test/run_test.sh                              |  8 ----
 11 files changed, 48 insertions(+), 28 deletions(-)
 delete mode 100644 RELEASE
 rename test/{lcov_done-test.sh => lcov_done.test.sh} (72%)
 create mode 100644 test/run.test.sh
 delete mode 100644 test/run_test.sh

diff --git a/README.md b/README.md
index a9d9d65..8ded9ce 100644
--- a/README.md
+++ b/README.md
@@ -35,7 +35,7 @@ Add the following code `[[ -z "${LCOV_DEBUG}" ]] || set -x`
 on top of source file you want in a coverage report, see below example:
 
 ```bash
-#!/bin/bash
+#!/usr/bin/env bash
 [[ -z "${LCOV_DEBUG}" ]] || set -x
 
 welcome () {
diff --git a/RELEASE b/RELEASE
deleted file mode 100644
index ce0d6eb..0000000
--- a/RELEASE
+++ /dev/null
@@ -1 +0,0 @@
-2020-06-06 18:50:10
diff --git a/lcov.sh b/lcov.sh
index c9e01a9..0cb098f 100755
--- a/lcov.sh
+++ b/lcov.sh
@@ -30,7 +30,7 @@
 
 set -ef
 
-VERSION="0.0.1"
+VERSION="0.1.0"
 
 usage () {
     echo "Usage: ./lcov.sh [OPTION]... FILE..."
@@ -225,7 +225,7 @@ lcov_done () {
 ##
 #
 ##
-run_wait () {
+lcov_run_wait() {
     while [[ -f ${output}/test.lock ]]; do sleep 2; done;
     touch ${output}/test.lock
     return 0
@@ -234,7 +234,7 @@ run_wait () {
 ##
 #
 ##
-run_step () {
+lcov_run_step () {
     rm -f ${output}/test.lock
     return 0
 }
@@ -242,7 +242,7 @@ run_step () {
 ##
 # Store running tests stat.
 ##
-run_stat () {
+lcov_run_stat () {
     stat="0 "
     [[ -f "${output}/test.stat" ]] && stat+="$(cat "${output}/test.stat")"
     test=$(expr $(echo ${stat} | cut -d' ' -f2) + $1 || true)
@@ -256,13 +256,13 @@ run_stat () {
 ##
 # Execute testcase and process LCOV info.
 ##
-run_test () {
+lcov_run_test () {
     if [[ ! -z $1 ]]; then
-        run_wait
+        lcov_run_wait
         echo -n "  > "
         if [[ -d $1 ]]; then
             echo -e "${skip_flag} $1/: is directory.";
-            shift; run_stat 1 0 0 1; run_step; run_test "$@"
+            shift; lcov_run_stat 1 0 0 1; lcov_run_step; lcov_run_test "$@"
         elif [[ -f $1 ]]; then
             rm -f ${output}/test.info
             bash -x $1 >${output}/test.out 2>${output}/test.log && true
@@ -279,27 +279,48 @@ run_test () {
                         info=$(grep . ${output}/test.out | tail -1)
                         echo -e "${done_flag} $1: '${info}' (ok)";
                         lcov -q -a ${output}/test.info -a ${output}/lcov.info -o ${output}/lcov.info && true
-                        shift; run_stat 1 1 0 0; run_step; run_test "$@"
+                        shift; lcov_run_stat 1 1 0 0; lcov_run_step; lcov_run_test "$@"
                     fi
                 done < "${output}/test.log"
             else
                 info="$(grep "." "${output}/test.out" | tail -1)"
                 [[ -z "${info}" ]] && info="$(grep "." "${output}/test.log" | tail -1)"
                 echo -e "${fail_flag} $1: '${info}' (exit ${exit_code})"
-                shift; run_stat 1 0 1 0; run_step; run_test "$@"
+                shift; lcov_run_stat 1 0 1 0; lcov_run_step; lcov_run_test "$@"
             fi
         else
             echo -e "${skip_flag} $1: file not found.";
-            shift; run_stat 1 0 0 1; run_step; run_test "$@"
+            shift; lcov_run_stat 1 0 0 1; lcov_run_step; lcov_run_test "$@"
         fi
     fi
     return 0
 }
 
+##
+# Execute testcase and process LCOV info.
+##
+run() {
+    local flags="$-"
+    set +eET
+    local origIFS="$IFS"
+    [[ "${flags}" =~ x ]] || set -x
+    # 'output', 'status', 'lines' are global variables available to tests.
+    # shellcheck disable=SC2034
+    output="$("$@" 2>&1)"
+    # shellcheck disable=SC2034
+    status="$?"
+    [[ "${flags}" =~ x ]] || set +x
+    set +x
+    # shellcheck disable=SC2034,SC2206
+    IFS=$'\n' lines=($output)
+    IFS="$origIFS"
+    set "-$flags"
+}
+
 ##
 # Entry-point
 ##
-main () {
+main() {
     if [[ -z "$(command -v lcov)" ]]; then
         echo "lcov.sh: missing 'lcov' command on your system. (try: sudo apt install lcov)" >&2
         exit 1
@@ -313,7 +334,7 @@ main () {
     lcov_init "${coverage[@]}"
 
     for test in "$@"; do
-        run_test "$test"
+        lcov_run_test "$test"
     done
 
     lcov_done
diff --git a/test/fixtures/custom.zsh b/test/fixtures/custom.zsh
index 754d52b..787e43b 100644
--- a/test/fixtures/custom.zsh
+++ b/test/fixtures/custom.zsh
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
 set -e
 
 if [[ -z "$1" ]]; then
diff --git a/test/fixtures/sample.sh b/test/fixtures/sample.sh
index 754d52b..787e43b 100755
--- a/test/fixtures/sample.sh
+++ b/test/fixtures/sample.sh
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
 set -e
 
 if [[ -z "$1" ]]; then
diff --git a/test/fixtures/subdir/custom1.zsh b/test/fixtures/subdir/custom1.zsh
index 754d52b..787e43b 100644
--- a/test/fixtures/subdir/custom1.zsh
+++ b/test/fixtures/subdir/custom1.zsh
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
 set -e
 
 if [[ -z "$1" ]]; then
diff --git a/test/fixtures/test1.sh b/test/fixtures/test1.sh
index 8577e14..d62ac25 100755
--- a/test/fixtures/test1.sh
+++ b/test/fixtures/test1.sh
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
 set -e
 
 #source lcov.sh
diff --git a/test/fixtures/test2.sh b/test/fixtures/test2.sh
index 145cc73..c46e908 100755
--- a/test/fixtures/test2.sh
+++ b/test/fixtures/test2.sh
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
 set -e
 
 #source lcov.sh
diff --git a/test/lcov_done-test.sh b/test/lcov_done.test.sh
similarity index 72%
rename from test/lcov_done-test.sh
rename to test/lcov_done.test.sh
index 82f8e0b..67f0c82 100644
--- a/test/lcov_done-test.sh
+++ b/test/lcov_done.test.sh
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
 set -e
 
 source lcov.sh lcov.sh
diff --git a/test/run.test.sh b/test/run.test.sh
new file mode 100644
index 0000000..f1935d8
--- /dev/null
+++ b/test/run.test.sh
@@ -0,0 +1,8 @@
+#!/usr/bin/env bash
+set -e
+
+#source ./deps/pipetest/pipetest.sh
+source ./lcov.sh -o test/coverage
+#set +x
+run exit 1
+echo "${output}"
\ No newline at end of file
diff --git a/test/run_test.sh b/test/run_test.sh
deleted file mode 100644
index 82f8e0b..0000000
--- a/test/run_test.sh
+++ /dev/null
@@ -1,8 +0,0 @@
-#!/bin/bash
-set -e
-
-source lcov.sh lcov.sh
-
-lcov_init a
-
-exit 1

From ecd4c5371dca509442c2ed82647dd03855175305 Mon Sep 17 00:00:00 2001
From: francesco <info.francescobianco@gmail.com>
Date: Thu, 2 Jul 2020 00:35:04 +0200
Subject: [PATCH 02/32] wip

---
 a.sh             | 10 ++++++++++
 a.txt            |  3 +++
 lcov.sh          | 11 ++++++-----
 stderr.log       |  3 +++
 stdout.log       |  7 +++++++
 test/run.test.sh |  8 ++++----
 6 files changed, 33 insertions(+), 9 deletions(-)
 create mode 100644 a.sh
 create mode 100644 a.txt
 create mode 100644 stderr.log
 create mode 100644 stdout.log

diff --git a/a.sh b/a.sh
new file mode 100644
index 0000000..745f4bd
--- /dev/null
+++ b/a.sh
@@ -0,0 +1,10 @@
+#!/bin/bash
+
+(
+    set -x
+    echo "AA"
+    set +x
+) > a.txt 2>&1
+
+
+echo "BB"
diff --git a/a.txt b/a.txt
new file mode 100644
index 0000000..b967628
--- /dev/null
+++ b/a.txt
@@ -0,0 +1,3 @@
++ echo AA
+AA
++ set +x
diff --git a/lcov.sh b/lcov.sh
index 0cb098f..8810f9f 100755
--- a/lcov.sh
+++ b/lcov.sh
@@ -304,11 +304,12 @@ run() {
     set +eET
     local origIFS="$IFS"
     [[ "${flags}" =~ x ]] || set -x
-    # 'output', 'status', 'lines' are global variables available to tests.
-    # shellcheck disable=SC2034
-    output="$("$@" 2>&1)"
-    # shellcheck disable=SC2034
-    status="$?"
+    (
+        # shellcheck disable=SC2034
+        output="$("$@" 2>&1)"
+        # shellcheck disable=SC2034
+        status="$?"
+    )
     [[ "${flags}" =~ x ]] || set +x
     set +x
     # shellcheck disable=SC2034,SC2206
diff --git a/stderr.log b/stderr.log
new file mode 100644
index 0000000..67c75d6
--- /dev/null
+++ b/stderr.log
@@ -0,0 +1,3 @@
++::0:: echo
++::0:: echo
++::0:: echo
diff --git a/stdout.log b/stdout.log
new file mode 100644
index 0000000..f119ff2
--- /dev/null
+++ b/stdout.log
@@ -0,0 +1,7 @@
+Hello World!
+
++::0:: echo
+
++::0:: echo
+
++::0:: echo
diff --git a/test/run.test.sh b/test/run.test.sh
index f1935d8..6ba2aa8 100644
--- a/test/run.test.sh
+++ b/test/run.test.sh
@@ -1,8 +1,8 @@
 #!/usr/bin/env bash
 set -e
 
-#source ./deps/pipetest/pipetest.sh
+source ./deps/pipetest/pipetest.sh
 source ./lcov.sh -o test/coverage
-#set +x
-run exit 1
-echo "${output}"
\ No newline at end of file
+
+run echo "Hello World!"
+echo ">>> ${output}"

From 3d5f20e01e8aea62fd2fcb4d4dec72cbfd7cbb0f Mon Sep 17 00:00:00 2001
From: francescobianco <info.francescobianco@gmail.com>
Date: Thu, 2 Jul 2020 03:58:16 +0200
Subject: [PATCH 03/32] test uuid fix #4

---
 a.sh                             |  10 ---
 a.txt                            |   3 -
 lcov.sh                          | 122 +++++++++++++++++--------------
 test/bats/test1.bats             |  12 +++
 test/bats/test1.sh               |  12 +++
 test/fixtures/custom.zsh         |   0
 test/fixtures/subdir/custom1.zsh |   0
 test/lcov_done.test.sh           |   0
 test/lcov_scan.test.sh           |   0
 test/run.test.sh                 |   0
 10 files changed, 91 insertions(+), 68 deletions(-)
 delete mode 100644 a.sh
 delete mode 100644 a.txt
 create mode 100644 test/bats/test1.bats
 create mode 100644 test/bats/test1.sh
 mode change 100644 => 100755 test/fixtures/custom.zsh
 mode change 100644 => 100755 test/fixtures/subdir/custom1.zsh
 mode change 100644 => 100755 test/lcov_done.test.sh
 mode change 100644 => 100755 test/lcov_scan.test.sh
 mode change 100644 => 100755 test/run.test.sh

diff --git a/a.sh b/a.sh
deleted file mode 100644
index 745f4bd..0000000
--- a/a.sh
+++ /dev/null
@@ -1,10 +0,0 @@
-#!/bin/bash
-
-(
-    set -x
-    echo "AA"
-    set +x
-) > a.txt 2>&1
-
-
-echo "BB"
diff --git a/a.txt b/a.txt
deleted file mode 100644
index b967628..0000000
--- a/a.txt
+++ /dev/null
@@ -1,3 +0,0 @@
-+ echo AA
-AA
-+ set +x
diff --git a/lcov.sh b/lcov.sh
index 8810f9f..07bf3f1 100755
--- a/lcov.sh
+++ b/lcov.sh
@@ -28,6 +28,8 @@
 
 [[ -z "${LCOV_DEBUG}" ]] || set -x
 
+echo LCOV_DEBUG ${LCOV_DEBUG} >> a.txt
+
 set -ef
 
 VERSION="0.1.0"
@@ -50,7 +52,6 @@ usage () {
 
 trap '$(jobs -p) || kill $(jobs -p)' EXIT
 
-export LCOV_DEBUG=1
 export PS4='+:${BASH_SOURCE}:${LINENO}:${FUNCNAME[0]}: '
 
 case "$(uname -s)" in
@@ -66,7 +67,7 @@ esac
 
 coverage=()
 extension=sh
-output=coverage
+lcov_output=coverage
 skip_flag="${escape}[37m(skip)${escape}[0m"
 done_flag="${escape}[1m${escape}[32m(done)${escape}[0m"
 fail_flag="${escape}[1m${escape}[31m(fail)${escape}[0m"
@@ -114,7 +115,7 @@ get_uuid ()  {
 ##
 get_files () {
     include="-name *.${extension}"
-    exclude="-not -wholename ${output} -not -path .git"
+    exclude="-not -wholename ${lcov_output} -not -path .git"
 
     for arg in "$@"; do
         #echo "ARG: ${arg}"
@@ -142,15 +143,15 @@ lcov_init () {
     echo "LCOV.SH by Francesco Bianco <bianco@javanile.org>"
     echo ""
 
-    mkdir -p "${output}"
-    rm -f "${output}/lcov.info" "${output}/test.stat" "${output}/test.lock"
+    mkdir -p "${lcov_output}"
+    rm -f "${lcov_output}/lcov.info" "${lcov_output}/test.stat" "${lcov_output}/test.lock"
 
     get_files "$@" | while IFS= read -r file; do
         #echo "coverage: ${file}"
-        lcov_scan "${file}" > "${output}/init.info"
-        [[ -f "${output}/lcov.info" ]] || lcov -q -a "${output}/init.info" -o "${output}/lcov.info" && true
-        lcov -q -a "${output}/init.info" -a "${output}/lcov.info" -o "${output}/lcov.info" >/dev/null 2>&1 && true
-        rm -f "${output}/init.info"
+        lcov_scan "${file}" > "${lcov_output}/init.info"
+        [[ -f "${lcov_output}/lcov.info" ]] || lcov -q -a "${lcov_output}/init.info" -o "${lcov_output}/lcov.info" && true
+        lcov -q -a "${lcov_output}/init.info" -a "${lcov_output}/lcov.info" -o "${lcov_output}/lcov.info" >/dev/null 2>&1 && true
+        rm -f "${lcov_output}/init.info"
     done
 
     return 0
@@ -203,7 +204,7 @@ lcov_scan () {
 lcov_done () {
     echo ""
     stat="0 0 0 0"
-    [[ -f "${output}/test.stat" ]] && stat="$(cat ${output}/test.stat && true)"
+    [[ -f "${lcov_output}/test.stat" ]] && stat="$(cat ${lcov_output}/test.stat && true)"
     test="$(echo ${stat} | cut -s -d' ' -f1)"
     done="$(echo ${stat} | cut -s -d' ' -f2)"
     fail="$(echo ${stat} | cut -s -d' ' -f3)"
@@ -215,8 +216,8 @@ lcov_done () {
         exit_info="${done_flag}"
         exit_code=0
     fi
-    genhtml -q -o "${output}" "${output}/lcov.info"
-    lcov --summary "${output}/lcov.info"
+    genhtml -q -o "${lcov_output}" "${lcov_output}/lcov.info"
+    lcov --summary "${lcov_output}/lcov.info"
     echo -e "  tests......: ${test} (${done} done, ${fail} fail, ${skip} skip)"
     echo -e "  exit.......: ${exit_code} ${exit_info}"
     exit ${exit_code}
@@ -225,9 +226,9 @@ lcov_done () {
 ##
 #
 ##
-lcov_run_wait() {
-    while [[ -f ${output}/test.lock ]]; do sleep 2; done;
-    touch ${output}/test.lock
+lcov_test_wait() {
+    while [[ -f ${lcov_output}/test.lock ]]; do sleep 2; done;
+    touch ${lcov_output}/test.lock
     return 0
 }
 
@@ -235,7 +236,7 @@ lcov_run_wait() {
 #
 ##
 lcov_run_step () {
-    rm -f ${output}/test.lock
+    rm -f ${lcov_output}/test.lock
     return 0
 }
 
@@ -244,53 +245,62 @@ lcov_run_step () {
 ##
 lcov_run_stat () {
     stat="0 "
-    [[ -f "${output}/test.stat" ]] && stat+="$(cat "${output}/test.stat")"
+    [[ -f "${lcov_output}/test.stat" ]] && stat+="$(cat "${lcov_output}/test.stat")"
     test=$(expr $(echo ${stat} | cut -d' ' -f2) + $1 || true)
     done=$(expr $(echo ${stat} | cut -d' ' -f3) + $2 || true)
     fail=$(expr $(echo ${stat} | cut -d' ' -f4) + $3 || true)
     skip=$(expr $(echo ${stat} | cut -d' ' -f5) + $4 || true)
-    echo "${test} ${done} ${fail} ${skip}" > "${output}/test.stat"
+    echo "${test} ${done} ${fail} ${skip}" > "${lcov_output}/test.stat"
     return 0
 }
 
+##
+#
+##
+lcov_test_parse_log() {
+    local exit_code=$1
+    if [[ ${exit_code} -eq 0 ]]; then
+        lcov_stop=$(get_uuid)
+        echo "${lcov_stop}" >> ${lcov_output}/test.log
+        while IFS= read line || [[ -n "${line}" ]]; do
+            if [[ "${line::1}" = "+" ]]; then
+                file=$(echo ${line} | cut -s -d':' -f2)
+                lineno=$(echo ${line} | cut -s -d':' -f3)
+                echo -e "TN:\nSF:${file}\nDA:${lineno},1\nend_of_record" >> ${lcov_output}/test.info
+            elif [[ "${line}" = "${lcov_stop}" ]]; then
+                info=$(grep . ${lcov_output}/test.out | tail -1)
+                echo -e "${done_flag} $1: '${info}' (ok)";
+                lcov -q -a ${lcov_output}/test.info -a ${lcov_output}/lcov.info -o ${lcov_output}/lcov.info && true
+                shift; lcov_run_stat 1 1 0 0; lcov_run_step; lcov_test "$@"
+            fi
+        done < "${lcov_output}/test.log"
+    else
+        info="$(grep "." "${lcov_output}/test.out" | tail -1)"
+        [[ -z "${info}" ]] && info="$(grep "." "${lcov_output}/test.log" | tail -1)"
+        echo -e "${fail_flag} $1: '${info}' (exit ${exit_code})"
+        shift; lcov_run_stat 1 0 1 0; lcov_run_step; lcov_test "$@"
+    fi
+}
+
 ##
 # Execute testcase and process LCOV info.
 ##
-lcov_run_test () {
-    if [[ ! -z $1 ]]; then
-        lcov_run_wait
+lcov_test() {
+    if [[ -n $1 ]]; then
+        lcov_test_wait
         echo -n "  > "
         if [[ -d $1 ]]; then
             echo -e "${skip_flag} $1/: is directory.";
-            shift; lcov_run_stat 1 0 0 1; lcov_run_step; lcov_run_test "$@"
+            shift; lcov_test_stat 1 0 0 1; lcov_test_step; lcov_test "$@"
         elif [[ -f $1 ]]; then
-            rm -f ${output}/test.info
-            bash -x $1 >${output}/test.out 2>${output}/test.log && true
-            exit_code=$?
-            if [[ ${exit_code} -eq 0 ]]; then
-                lcov_stop=$(get_uuid)
-                echo "${lcov_stop}" >> ${output}/test.log
-                while IFS= read line || [[ -n "${line}" ]]; do
-                    if [[ "${line::1}" = "+" ]]; then
-                        file=$(echo ${line} | cut -s -d':' -f2)
-                        lineno=$(echo ${line} | cut -s -d':' -f3)
-                        echo -e "TN:\nSF:${file}\nDA:${lineno},1\nend_of_record" >> ${output}/test.info
-                    elif [[ "${line}" = "${lcov_stop}" ]]; then
-                        info=$(grep . ${output}/test.out | tail -1)
-                        echo -e "${done_flag} $1: '${info}' (ok)";
-                        lcov -q -a ${output}/test.info -a ${output}/lcov.info -o ${output}/lcov.info && true
-                        shift; lcov_run_stat 1 1 0 0; lcov_run_step; lcov_run_test "$@"
-                    fi
-                done < "${output}/test.log"
-            else
-                info="$(grep "." "${output}/test.out" | tail -1)"
-                [[ -z "${info}" ]] && info="$(grep "." "${output}/test.log" | tail -1)"
-                echo -e "${fail_flag} $1: '${info}' (exit ${exit_code})"
-                shift; lcov_run_stat 1 0 1 0; lcov_run_step; lcov_run_test "$@"
-            fi
+            rm -f ${lcov_output}/test.info
+            export LCOV_DEBUG=1
+            bash -x $1 >${lcov_output}/test.out 2>${lcov_output}/test.log && true
+            export LCOV_DEBUG=
+            lcov_test_parse_log $?
         else
             echo -e "${skip_flag} $1: file not found.";
-            shift; lcov_run_stat 1 0 0 1; lcov_run_step; lcov_run_test "$@"
+            shift; lcov_test_stat 1 0 0 1; lcov_test_step; lcov_test "$@"
         fi
     fi
     return 0
@@ -303,15 +313,14 @@ run() {
     local flags="$-"
     set +eET
     local origIFS="$IFS"
+    export LCOV_DEBUG=1
     [[ "${flags}" =~ x ]] || set -x
-    (
-        # shellcheck disable=SC2034
+
         output="$("$@" 2>&1)"
-        # shellcheck disable=SC2034
+     #   echo ${output} > b.txt
         status="$?"
-    )
-    [[ "${flags}" =~ x ]] || set +x
-    set +x
+    #[[ "${flags}" =~ x ]] || set +x
+    #export LCOV_DEBUG=
     # shellcheck disable=SC2034,SC2206
     IFS=$'\n' lines=($output)
     IFS="$origIFS"
@@ -335,13 +344,16 @@ main() {
     lcov_init "${coverage[@]}"
 
     for test in "$@"; do
-        lcov_run_test "$test"
+        lcov_test "$test"
     done
 
     lcov_done
 }
 
 ## Bypass entry-point if file was sourced
-if [[ "${BASH_SOURCE[0]}" = "${0}" ]]; then
+if [[ "${BASH_SOURCE[0]}" != "${0}" ]]; then
+    export -f run
+else
     main "$@"
+    exit "$?"
 fi
diff --git a/test/bats/test1.bats b/test/bats/test1.bats
new file mode 100644
index 0000000..759ec88
--- /dev/null
+++ b/test/bats/test1.bats
@@ -0,0 +1,12 @@
+
+load test1.sh
+load ../../lcov.sh
+
+#lcov_init
+
+@test "test1 func1" {
+    run test1_func1
+    echo "${output}" > a.txt
+    [ "${output}" = "TEST1_FUNC1" ]
+
+}
diff --git a/test/bats/test1.sh b/test/bats/test1.sh
new file mode 100644
index 0000000..e4c528b
--- /dev/null
+++ b/test/bats/test1.sh
@@ -0,0 +1,12 @@
+#!/usr/bin/env bash
+
+[[ -z "${LCOV_DEBUG}" ]] || set -x
+
+test1_func1() {
+  >&2 echo "TEST1_FUNC1"
+  #echo -n "TEST1_FUNC1"
+}
+
+test1_func2() {
+  echo -n "TEST1_FUNC2"
+}
diff --git a/test/fixtures/custom.zsh b/test/fixtures/custom.zsh
old mode 100644
new mode 100755
diff --git a/test/fixtures/subdir/custom1.zsh b/test/fixtures/subdir/custom1.zsh
old mode 100644
new mode 100755
diff --git a/test/lcov_done.test.sh b/test/lcov_done.test.sh
old mode 100644
new mode 100755
diff --git a/test/lcov_scan.test.sh b/test/lcov_scan.test.sh
old mode 100644
new mode 100755
diff --git a/test/run.test.sh b/test/run.test.sh
old mode 100644
new mode 100755

From eb7e1240ec5512cd70cf7fe3aae9555743804fd9 Mon Sep 17 00:00:00 2001
From: francesco <info.francescobianco@gmail.com>
Date: Thu, 2 Jul 2020 14:46:26 +0200
Subject: [PATCH 04/32] wip

---
 lcov.sh              | 27 ++++++++++++++++++---------
 test/bats/test1.bats |  1 +
 test/bats/test1.sh   |  4 ++--
 3 files changed, 21 insertions(+), 11 deletions(-)

diff --git a/lcov.sh b/lcov.sh
index 07bf3f1..5f60d25 100755
--- a/lcov.sh
+++ b/lcov.sh
@@ -52,8 +52,6 @@ usage () {
 
 trap '$(jobs -p) || kill $(jobs -p)' EXIT
 
-export PS4='+:${BASH_SOURCE}:${LINENO}:${FUNCNAME[0]}: '
-
 case "$(uname -s)" in
     Darwin*)
         getopt=/usr/local/opt/gnu-getopt/bin/getopt
@@ -295,6 +293,7 @@ lcov_test() {
         elif [[ -f $1 ]]; then
             rm -f ${lcov_output}/test.info
             export LCOV_DEBUG=1
+            export PS4='+:LCOV_DEBUG:${BASH_SOURCE}:${LINENO}:${FUNCNAME[0]}: '
             bash -x $1 >${lcov_output}/test.out 2>${lcov_output}/test.log && true
             export LCOV_DEBUG=
             lcov_test_parse_log $?
@@ -314,19 +313,29 @@ run() {
     set +eET
     local origIFS="$IFS"
     export LCOV_DEBUG=1
-    [[ "${flags}" =~ x ]] || set -x
-
-        output="$("$@" 2>&1)"
-     #   echo ${output} > b.txt
-        status="$?"
-    #[[ "${flags}" =~ x ]] || set +x
-    #export LCOV_DEBUG=
+    #[[ "${flags}" =~ x ]] ||
+    set -x
+    #(
+    echo "aa" > >(lcov_redirect_log)
+    output="$("$@" 2> >(lcov_redirect_log))"
+    #output="$("$@")"
+    status="$?"
+    #)  >${lcov_output}/test.out 2>${lcov_output}/test.log
+    set +x
+    export LCOV_DEBUG=
     # shellcheck disable=SC2034,SC2206
     IFS=$'\n' lines=($output)
     IFS="$origIFS"
     set "-$flags"
 }
 
+lcov_redirect_log() {
+    while read log; do
+        echo "---  $log"
+        echo ">>>  $log" >> log.log
+    done
+}
+
 ##
 # Entry-point
 ##
diff --git a/test/bats/test1.bats b/test/bats/test1.bats
index 759ec88..f1725cb 100644
--- a/test/bats/test1.bats
+++ b/test/bats/test1.bats
@@ -7,6 +7,7 @@ load ../../lcov.sh
 @test "test1 func1" {
     run test1_func1
     echo "${output}" > a.txt
+
     [ "${output}" = "TEST1_FUNC1" ]
 
 }
diff --git a/test/bats/test1.sh b/test/bats/test1.sh
index e4c528b..7db2dba 100644
--- a/test/bats/test1.sh
+++ b/test/bats/test1.sh
@@ -3,8 +3,8 @@
 [[ -z "${LCOV_DEBUG}" ]] || set -x
 
 test1_func1() {
-  >&2 echo "TEST1_FUNC1"
-  #echo -n "TEST1_FUNC1"
+  #>&2 echo "TEST1_FUNC1"
+  echo -n "TEST1_FUNC1"
 }
 
 test1_func2() {

From 7c195657c428af4ab72785d1ec534e8c0fb33aac Mon Sep 17 00:00:00 2001
From: francescobianco <info.francescobianco@gmail.com>
Date: Mon, 12 Oct 2020 00:22:01 +0200
Subject: [PATCH 05/32] Merge remote-tracking branch 'origin/bats-integration'
 into bats-1-support

# Conflicts:
#	lcov.sh
---
 package.json | 37 ++++++++++++++++++++++++++++++-------
 1 file changed, 30 insertions(+), 7 deletions(-)

diff --git a/package.json b/package.json
index 6e3378a..e72c157 100644
--- a/package.json
+++ b/package.json
@@ -1,11 +1,34 @@
 {
   "name": "lcov.sh",
-  "version": "0.0.1",
-  "license": "MIT",
+  "version": "0.1.0",
   "description": "The best LCOV framework around a BASH project",
-  "global": true,
-  "install": "make install",
-  "dependencies": {
-    "javanile/pipetest": "master"
-  }
+  "homepage": "https://github.com/javanile/lcov.sh#readme",
+  "license": "MIT",
+  "author": "Francesco Bianco <bianco@javanile> (https://git.io/francesco)",
+  "repository": "github:javanile/lcov.sh",
+  "bugs": "https://github.com/javanile/lcov.sh/issues",
+  "files": [
+    "bin",
+    "libexec",
+    "lib",
+    "man"
+  ],
+  "directories": {
+    "bin": "bin",
+    "doc": "docs",
+    "man": "man",
+    "test": "test"
+  },
+  "scripts": {
+    "test": "bin/bats test"
+  },
+  "keywords": [
+    "bats",
+    "bash",
+    "shell",
+    "coverage",
+    "lcov",
+    "test",
+    "unit"
+  ]
 }

From dab1ed354d5f6c8c681da60e6ef421a3bd5dfec1 Mon Sep 17 00:00:00 2001
From: Francesco Bianco <info.francescobianco@gmail.com>
Date: Mon, 12 Oct 2020 16:13:03 +0200
Subject: [PATCH 06/32] fix missing lcov command

---
 .tmp/run.log         | 122 ++++++++++++++++++++++++++++++++++++++++
 Makefile             |   6 ++
 io.txt               |  14 +++++
 lcov.sh              | 130 ++++++++++++++++++++++++++++---------------
 test/bats/test1.bats |  10 ++--
 test/bats/test1.sh   |   3 +-
 6 files changed, 234 insertions(+), 51 deletions(-)
 create mode 100644 .tmp/run.log
 create mode 100644 io.txt

diff --git a/.tmp/run.log b/.tmp/run.log
new file mode 100644
index 0000000..93f6dcd
--- /dev/null
+++ b/.tmp/run.log
@@ -0,0 +1,122 @@
+++:LCOV_DEBUG:/home/francesco/Develop/Javanile/lcov.sh/test/bats/../../lcov.sh:356:lcov_bats_run: bats_debug_trap /home/francesco/Develop/Javanile/lcov.sh/test/bats/../../lcov.sh
+++:LCOV_DEBUG:/usr/local/lib/bats-core/tracing.bash:122:bats_debug_trap: [[ /home/francesco/Develop/Javanile/lcov.sh/test/bats/../../lcov.sh != /usr/local/lib/* ]]
+++:LCOV_DEBUG:/usr/local/lib/bats-core/tracing.bash:122:bats_debug_trap: [[ /home/francesco/Develop/Javanile/lcov.sh/test/bats/../../lcov.sh != /usr/local/libexec/* ]]
+++:LCOV_DEBUG:/usr/local/lib/bats-core/tracing.bash:128:bats_debug_trap: BATS_CURRENT_STACK_TRACE=("${BATS_STACK_TRACE[@]+"${BATS_STACK_TRACE[@]}"}")
+++:LCOV_DEBUG:/usr/local/lib/bats-core/tracing.bash:129:bats_debug_trap: bats_capture_stack_trace
+++:LCOV_DEBUG:/usr/local/lib/bats-core/tracing.bash:4:bats_capture_stack_trace: local test_file
+++:LCOV_DEBUG:/usr/local/lib/bats-core/tracing.bash:5:bats_capture_stack_trace: local funcname
+++:LCOV_DEBUG:/usr/local/lib/bats-core/tracing.bash:6:bats_capture_stack_trace: local i
+++:LCOV_DEBUG:/usr/local/lib/bats-core/tracing.bash:8:bats_capture_stack_trace: BATS_STACK_TRACE=()
+++:LCOV_DEBUG:/usr/local/lib/bats-core/tracing.bash:10:bats_capture_stack_trace: (( i = 2 ))
+++:LCOV_DEBUG:/usr/local/lib/bats-core/tracing.bash:10:bats_capture_stack_trace: (( i != 7 ))
+++:LCOV_DEBUG:/usr/local/lib/bats-core/tracing.bash:13:bats_capture_stack_trace: test_file=/home/francesco/Develop/Javanile/lcov.sh/test/bats/../../lcov.sh
+++:LCOV_DEBUG:/usr/local/lib/bats-core/tracing.bash:14:bats_capture_stack_trace: funcname=lcov_bats_run
+++:LCOV_DEBUG:/usr/local/lib/bats-core/tracing.bash:15:bats_capture_stack_trace: BATS_STACK_TRACE+=("${BASH_LINENO[$((i - 1))]} $funcname $test_file")
+++:LCOV_DEBUG:/usr/local/lib/bats-core/tracing.bash:16:bats_capture_stack_trace: [[ /home/francesco/Develop/Javanile/lcov.sh/test/bats/../../lcov.sh == \/\t\m\p\/\b\a\t\s\-\r\u\n\-\2\6\2\2\4\/\b\a\t\s\.\2\6\2\6\9\.\s\r\c ]]
+++:LCOV_DEBUG:/usr/local/lib/bats-core/tracing.bash:10:bats_capture_stack_trace: (( ++i ))
+++:LCOV_DEBUG:/usr/local/lib/bats-core/tracing.bash:10:bats_capture_stack_trace: (( i != 7 ))
+++:LCOV_DEBUG:/usr/local/lib/bats-core/tracing.bash:13:bats_capture_stack_trace: test_file=/home/francesco/Develop/Javanile/lcov.sh/test/bats/../../lcov.sh
+++:LCOV_DEBUG:/usr/local/lib/bats-core/tracing.bash:14:bats_capture_stack_trace: funcname=run
+++:LCOV_DEBUG:/usr/local/lib/bats-core/tracing.bash:15:bats_capture_stack_trace: BATS_STACK_TRACE+=("${BASH_LINENO[$((i - 1))]} $funcname $test_file")
+++:LCOV_DEBUG:/usr/local/lib/bats-core/tracing.bash:16:bats_capture_stack_trace: [[ /home/francesco/Develop/Javanile/lcov.sh/test/bats/../../lcov.sh == \/\t\m\p\/\b\a\t\s\-\r\u\n\-\2\6\2\2\4\/\b\a\t\s\.\2\6\2\6\9\.\s\r\c ]]
+++:LCOV_DEBUG:/usr/local/lib/bats-core/tracing.bash:10:bats_capture_stack_trace: (( ++i ))
+++:LCOV_DEBUG:/usr/local/lib/bats-core/tracing.bash:10:bats_capture_stack_trace: (( i != 7 ))
+++:LCOV_DEBUG:/usr/local/lib/bats-core/tracing.bash:13:bats_capture_stack_trace: test_file=/tmp/bats-run-26224/bats.26269.src
+++:LCOV_DEBUG:/usr/local/lib/bats-core/tracing.bash:14:bats_capture_stack_trace: funcname=test_testing-3a_test1-5ffunc2-28-29
+++:LCOV_DEBUG:/usr/local/lib/bats-core/tracing.bash:15:bats_capture_stack_trace: BATS_STACK_TRACE+=("${BASH_LINENO[$((i - 1))]} $funcname $test_file")
+++:LCOV_DEBUG:/usr/local/lib/bats-core/tracing.bash:16:bats_capture_stack_trace: [[ /tmp/bats-run-26224/bats.26269.src == \/\t\m\p\/\b\a\t\s\-\r\u\n\-\2\6\2\2\4\/\b\a\t\s\.\2\6\2\6\9\.\s\r\c ]]
+++:LCOV_DEBUG:/usr/local/lib/bats-core/tracing.bash:17:bats_capture_stack_trace: case "$funcname" in
+++:LCOV_DEBUG:/usr/local/lib/bats-core/tracing.bash:19:bats_capture_stack_trace: break
+++:LCOV_DEBUG:/home/francesco/Develop/Javanile/lcov.sh/test/bats/../../lcov.sh:356:lcov_bats_run: test1_func1
+++:LCOV_DEBUG:/home/francesco/Develop/Javanile/lcov.sh/test/bats/test1.sh:6:test1_func1: echo -n TEST1_FUNC1
++:LCOV_DEBUG:/home/francesco/Develop/Javanile/lcov.sh/test/bats/../../lcov.sh:356:lcov_bats_run: output=TEST1_FUNC1
+++:LCOV_DEBUG:/home/francesco/Develop/Javanile/lcov.sh/test/bats/../../lcov.sh:357:lcov_bats_run: bats_debug_trap /home/francesco/Develop/Javanile/lcov.sh/test/bats/../../lcov.sh
+++:LCOV_DEBUG:/usr/local/lib/bats-core/tracing.bash:122:bats_debug_trap: [[ /home/francesco/Develop/Javanile/lcov.sh/test/bats/../../lcov.sh != /usr/local/lib/* ]]
+++:LCOV_DEBUG:/usr/local/lib/bats-core/tracing.bash:122:bats_debug_trap: [[ /home/francesco/Develop/Javanile/lcov.sh/test/bats/../../lcov.sh != /usr/local/libexec/* ]]
+++:LCOV_DEBUG:/usr/local/lib/bats-core/tracing.bash:128:bats_debug_trap: BATS_CURRENT_STACK_TRACE=("${BATS_STACK_TRACE[@]+"${BATS_STACK_TRACE[@]}"}")
+++:LCOV_DEBUG:/usr/local/lib/bats-core/tracing.bash:129:bats_debug_trap: bats_capture_stack_trace
+++:LCOV_DEBUG:/usr/local/lib/bats-core/tracing.bash:4:bats_capture_stack_trace: local test_file
+++:LCOV_DEBUG:/usr/local/lib/bats-core/tracing.bash:5:bats_capture_stack_trace: local funcname
+++:LCOV_DEBUG:/usr/local/lib/bats-core/tracing.bash:6:bats_capture_stack_trace: local i
+++:LCOV_DEBUG:/usr/local/lib/bats-core/tracing.bash:8:bats_capture_stack_trace: BATS_STACK_TRACE=()
+++:LCOV_DEBUG:/usr/local/lib/bats-core/tracing.bash:10:bats_capture_stack_trace: (( i = 2 ))
+++:LCOV_DEBUG:/usr/local/lib/bats-core/tracing.bash:10:bats_capture_stack_trace: (( i != 7 ))
+++:LCOV_DEBUG:/usr/local/lib/bats-core/tracing.bash:13:bats_capture_stack_trace: test_file=/home/francesco/Develop/Javanile/lcov.sh/test/bats/../../lcov.sh
+++:LCOV_DEBUG:/usr/local/lib/bats-core/tracing.bash:14:bats_capture_stack_trace: funcname=lcov_bats_run
+++:LCOV_DEBUG:/usr/local/lib/bats-core/tracing.bash:15:bats_capture_stack_trace: BATS_STACK_TRACE+=("${BASH_LINENO[$((i - 1))]} $funcname $test_file")
+++:LCOV_DEBUG:/usr/local/lib/bats-core/tracing.bash:16:bats_capture_stack_trace: [[ /home/francesco/Develop/Javanile/lcov.sh/test/bats/../../lcov.sh == \/\t\m\p\/\b\a\t\s\-\r\u\n\-\2\6\2\2\4\/\b\a\t\s\.\2\6\2\6\9\.\s\r\c ]]
+++:LCOV_DEBUG:/usr/local/lib/bats-core/tracing.bash:10:bats_capture_stack_trace: (( ++i ))
+++:LCOV_DEBUG:/usr/local/lib/bats-core/tracing.bash:10:bats_capture_stack_trace: (( i != 7 ))
+++:LCOV_DEBUG:/usr/local/lib/bats-core/tracing.bash:13:bats_capture_stack_trace: test_file=/home/francesco/Develop/Javanile/lcov.sh/test/bats/../../lcov.sh
+++:LCOV_DEBUG:/usr/local/lib/bats-core/tracing.bash:14:bats_capture_stack_trace: funcname=run
+++:LCOV_DEBUG:/usr/local/lib/bats-core/tracing.bash:15:bats_capture_stack_trace: BATS_STACK_TRACE+=("${BASH_LINENO[$((i - 1))]} $funcname $test_file")
+++:LCOV_DEBUG:/usr/local/lib/bats-core/tracing.bash:16:bats_capture_stack_trace: [[ /home/francesco/Develop/Javanile/lcov.sh/test/bats/../../lcov.sh == \/\t\m\p\/\b\a\t\s\-\r\u\n\-\2\6\2\2\4\/\b\a\t\s\.\2\6\2\6\9\.\s\r\c ]]
+++:LCOV_DEBUG:/usr/local/lib/bats-core/tracing.bash:10:bats_capture_stack_trace: (( ++i ))
+++:LCOV_DEBUG:/usr/local/lib/bats-core/tracing.bash:10:bats_capture_stack_trace: (( i != 7 ))
+++:LCOV_DEBUG:/usr/local/lib/bats-core/tracing.bash:13:bats_capture_stack_trace: test_file=/tmp/bats-run-26224/bats.26269.src
+++:LCOV_DEBUG:/usr/local/lib/bats-core/tracing.bash:14:bats_capture_stack_trace: funcname=test_testing-3a_test1-5ffunc2-28-29
+++:LCOV_DEBUG:/usr/local/lib/bats-core/tracing.bash:15:bats_capture_stack_trace: BATS_STACK_TRACE+=("${BASH_LINENO[$((i - 1))]} $funcname $test_file")
+++:LCOV_DEBUG:/usr/local/lib/bats-core/tracing.bash:16:bats_capture_stack_trace: [[ /tmp/bats-run-26224/bats.26269.src == \/\t\m\p\/\b\a\t\s\-\r\u\n\-\2\6\2\2\4\/\b\a\t\s\.\2\6\2\6\9\.\s\r\c ]]
+++:LCOV_DEBUG:/usr/local/lib/bats-core/tracing.bash:17:bats_capture_stack_trace: case "$funcname" in
+++:LCOV_DEBUG:/usr/local/lib/bats-core/tracing.bash:19:bats_capture_stack_trace: break
++:LCOV_DEBUG:/home/francesco/Develop/Javanile/lcov.sh/test/bats/../../lcov.sh:357:lcov_bats_run: status=0
+++:LCOV_DEBUG:/home/francesco/Develop/Javanile/lcov.sh/test/bats/../../lcov.sh:358:lcov_bats_run: bats_debug_trap /home/francesco/Develop/Javanile/lcov.sh/test/bats/../../lcov.sh
+++:LCOV_DEBUG:/usr/local/lib/bats-core/tracing.bash:122:bats_debug_trap: [[ /home/francesco/Develop/Javanile/lcov.sh/test/bats/../../lcov.sh != /usr/local/lib/* ]]
+++:LCOV_DEBUG:/usr/local/lib/bats-core/tracing.bash:122:bats_debug_trap: [[ /home/francesco/Develop/Javanile/lcov.sh/test/bats/../../lcov.sh != /usr/local/libexec/* ]]
+++:LCOV_DEBUG:/usr/local/lib/bats-core/tracing.bash:128:bats_debug_trap: BATS_CURRENT_STACK_TRACE=("${BATS_STACK_TRACE[@]+"${BATS_STACK_TRACE[@]}"}")
+++:LCOV_DEBUG:/usr/local/lib/bats-core/tracing.bash:129:bats_debug_trap: bats_capture_stack_trace
+++:LCOV_DEBUG:/usr/local/lib/bats-core/tracing.bash:4:bats_capture_stack_trace: local test_file
+++:LCOV_DEBUG:/usr/local/lib/bats-core/tracing.bash:5:bats_capture_stack_trace: local funcname
+++:LCOV_DEBUG:/usr/local/lib/bats-core/tracing.bash:6:bats_capture_stack_trace: local i
+++:LCOV_DEBUG:/usr/local/lib/bats-core/tracing.bash:8:bats_capture_stack_trace: BATS_STACK_TRACE=()
+++:LCOV_DEBUG:/usr/local/lib/bats-core/tracing.bash:10:bats_capture_stack_trace: (( i = 2 ))
+++:LCOV_DEBUG:/usr/local/lib/bats-core/tracing.bash:10:bats_capture_stack_trace: (( i != 7 ))
+++:LCOV_DEBUG:/usr/local/lib/bats-core/tracing.bash:13:bats_capture_stack_trace: test_file=/home/francesco/Develop/Javanile/lcov.sh/test/bats/../../lcov.sh
+++:LCOV_DEBUG:/usr/local/lib/bats-core/tracing.bash:14:bats_capture_stack_trace: funcname=lcov_bats_run
+++:LCOV_DEBUG:/usr/local/lib/bats-core/tracing.bash:15:bats_capture_stack_trace: BATS_STACK_TRACE+=("${BASH_LINENO[$((i - 1))]} $funcname $test_file")
+++:LCOV_DEBUG:/usr/local/lib/bats-core/tracing.bash:16:bats_capture_stack_trace: [[ /home/francesco/Develop/Javanile/lcov.sh/test/bats/../../lcov.sh == \/\t\m\p\/\b\a\t\s\-\r\u\n\-\2\6\2\2\4\/\b\a\t\s\.\2\6\2\6\9\.\s\r\c ]]
+++:LCOV_DEBUG:/usr/local/lib/bats-core/tracing.bash:10:bats_capture_stack_trace: (( ++i ))
+++:LCOV_DEBUG:/usr/local/lib/bats-core/tracing.bash:10:bats_capture_stack_trace: (( i != 7 ))
+++:LCOV_DEBUG:/usr/local/lib/bats-core/tracing.bash:13:bats_capture_stack_trace: test_file=/home/francesco/Develop/Javanile/lcov.sh/test/bats/../../lcov.sh
+++:LCOV_DEBUG:/usr/local/lib/bats-core/tracing.bash:14:bats_capture_stack_trace: funcname=run
+++:LCOV_DEBUG:/usr/local/lib/bats-core/tracing.bash:15:bats_capture_stack_trace: BATS_STACK_TRACE+=("${BASH_LINENO[$((i - 1))]} $funcname $test_file")
+++:LCOV_DEBUG:/usr/local/lib/bats-core/tracing.bash:16:bats_capture_stack_trace: [[ /home/francesco/Develop/Javanile/lcov.sh/test/bats/../../lcov.sh == \/\t\m\p\/\b\a\t\s\-\r\u\n\-\2\6\2\2\4\/\b\a\t\s\.\2\6\2\6\9\.\s\r\c ]]
+++:LCOV_DEBUG:/usr/local/lib/bats-core/tracing.bash:10:bats_capture_stack_trace: (( ++i ))
+++:LCOV_DEBUG:/usr/local/lib/bats-core/tracing.bash:10:bats_capture_stack_trace: (( i != 7 ))
+++:LCOV_DEBUG:/usr/local/lib/bats-core/tracing.bash:13:bats_capture_stack_trace: test_file=/tmp/bats-run-26224/bats.26269.src
+++:LCOV_DEBUG:/usr/local/lib/bats-core/tracing.bash:14:bats_capture_stack_trace: funcname=test_testing-3a_test1-5ffunc2-28-29
+++:LCOV_DEBUG:/usr/local/lib/bats-core/tracing.bash:15:bats_capture_stack_trace: BATS_STACK_TRACE+=("${BASH_LINENO[$((i - 1))]} $funcname $test_file")
+++:LCOV_DEBUG:/usr/local/lib/bats-core/tracing.bash:16:bats_capture_stack_trace: [[ /tmp/bats-run-26224/bats.26269.src == \/\t\m\p\/\b\a\t\s\-\r\u\n\-\2\6\2\2\4\/\b\a\t\s\.\2\6\2\6\9\.\s\r\c ]]
+++:LCOV_DEBUG:/usr/local/lib/bats-core/tracing.bash:17:bats_capture_stack_trace: case "$funcname" in
+++:LCOV_DEBUG:/usr/local/lib/bats-core/tracing.bash:19:bats_capture_stack_trace: break
++:LCOV_DEBUG:/home/francesco/Develop/Javanile/lcov.sh/test/bats/../../lcov.sh:358:lcov_bats_run: [[ efhBET =~ x ]]
+++:LCOV_DEBUG:/home/francesco/Develop/Javanile/lcov.sh/test/bats/../../lcov.sh:358:lcov_bats_run: bats_debug_trap /home/francesco/Develop/Javanile/lcov.sh/test/bats/../../lcov.sh
+++:LCOV_DEBUG:/usr/local/lib/bats-core/tracing.bash:122:bats_debug_trap: [[ /home/francesco/Develop/Javanile/lcov.sh/test/bats/../../lcov.sh != /usr/local/lib/* ]]
+++:LCOV_DEBUG:/usr/local/lib/bats-core/tracing.bash:122:bats_debug_trap: [[ /home/francesco/Develop/Javanile/lcov.sh/test/bats/../../lcov.sh != /usr/local/libexec/* ]]
+++:LCOV_DEBUG:/usr/local/lib/bats-core/tracing.bash:128:bats_debug_trap: BATS_CURRENT_STACK_TRACE=("${BATS_STACK_TRACE[@]+"${BATS_STACK_TRACE[@]}"}")
+++:LCOV_DEBUG:/usr/local/lib/bats-core/tracing.bash:129:bats_debug_trap: bats_capture_stack_trace
+++:LCOV_DEBUG:/usr/local/lib/bats-core/tracing.bash:4:bats_capture_stack_trace: local test_file
+++:LCOV_DEBUG:/usr/local/lib/bats-core/tracing.bash:5:bats_capture_stack_trace: local funcname
+++:LCOV_DEBUG:/usr/local/lib/bats-core/tracing.bash:6:bats_capture_stack_trace: local i
+++:LCOV_DEBUG:/usr/local/lib/bats-core/tracing.bash:8:bats_capture_stack_trace: BATS_STACK_TRACE=()
+++:LCOV_DEBUG:/usr/local/lib/bats-core/tracing.bash:10:bats_capture_stack_trace: (( i = 2 ))
+++:LCOV_DEBUG:/usr/local/lib/bats-core/tracing.bash:10:bats_capture_stack_trace: (( i != 7 ))
+++:LCOV_DEBUG:/usr/local/lib/bats-core/tracing.bash:13:bats_capture_stack_trace: test_file=/home/francesco/Develop/Javanile/lcov.sh/test/bats/../../lcov.sh
+++:LCOV_DEBUG:/usr/local/lib/bats-core/tracing.bash:14:bats_capture_stack_trace: funcname=lcov_bats_run
+++:LCOV_DEBUG:/usr/local/lib/bats-core/tracing.bash:15:bats_capture_stack_trace: BATS_STACK_TRACE+=("${BASH_LINENO[$((i - 1))]} $funcname $test_file")
+++:LCOV_DEBUG:/usr/local/lib/bats-core/tracing.bash:16:bats_capture_stack_trace: [[ /home/francesco/Develop/Javanile/lcov.sh/test/bats/../../lcov.sh == \/\t\m\p\/\b\a\t\s\-\r\u\n\-\2\6\2\2\4\/\b\a\t\s\.\2\6\2\6\9\.\s\r\c ]]
+++:LCOV_DEBUG:/usr/local/lib/bats-core/tracing.bash:10:bats_capture_stack_trace: (( ++i ))
+++:LCOV_DEBUG:/usr/local/lib/bats-core/tracing.bash:10:bats_capture_stack_trace: (( i != 7 ))
+++:LCOV_DEBUG:/usr/local/lib/bats-core/tracing.bash:13:bats_capture_stack_trace: test_file=/home/francesco/Develop/Javanile/lcov.sh/test/bats/../../lcov.sh
+++:LCOV_DEBUG:/usr/local/lib/bats-core/tracing.bash:14:bats_capture_stack_trace: funcname=run
+++:LCOV_DEBUG:/usr/local/lib/bats-core/tracing.bash:15:bats_capture_stack_trace: BATS_STACK_TRACE+=("${BASH_LINENO[$((i - 1))]} $funcname $test_file")
+++:LCOV_DEBUG:/usr/local/lib/bats-core/tracing.bash:16:bats_capture_stack_trace: [[ /home/francesco/Develop/Javanile/lcov.sh/test/bats/../../lcov.sh == \/\t\m\p\/\b\a\t\s\-\r\u\n\-\2\6\2\2\4\/\b\a\t\s\.\2\6\2\6\9\.\s\r\c ]]
+++:LCOV_DEBUG:/usr/local/lib/bats-core/tracing.bash:10:bats_capture_stack_trace: (( ++i ))
+++:LCOV_DEBUG:/usr/local/lib/bats-core/tracing.bash:10:bats_capture_stack_trace: (( i != 7 ))
+++:LCOV_DEBUG:/usr/local/lib/bats-core/tracing.bash:13:bats_capture_stack_trace: test_file=/tmp/bats-run-26224/bats.26269.src
+++:LCOV_DEBUG:/usr/local/lib/bats-core/tracing.bash:14:bats_capture_stack_trace: funcname=test_testing-3a_test1-5ffunc2-28-29
+++:LCOV_DEBUG:/usr/local/lib/bats-core/tracing.bash:15:bats_capture_stack_trace: BATS_STACK_TRACE+=("${BASH_LINENO[$((i - 1))]} $funcname $test_file")
+++:LCOV_DEBUG:/usr/local/lib/bats-core/tracing.bash:16:bats_capture_stack_trace: [[ /tmp/bats-run-26224/bats.26269.src == \/\t\m\p\/\b\a\t\s\-\r\u\n\-\2\6\2\2\4\/\b\a\t\s\.\2\6\2\6\9\.\s\r\c ]]
+++:LCOV_DEBUG:/usr/local/lib/bats-core/tracing.bash:17:bats_capture_stack_trace: case "$funcname" in
+++:LCOV_DEBUG:/usr/local/lib/bats-core/tracing.bash:19:bats_capture_stack_trace: break
++:LCOV_DEBUG:/home/francesco/Develop/Javanile/lcov.sh/test/bats/../../lcov.sh:358:lcov_bats_run: set +x
diff --git a/Makefile b/Makefile
index aec762f..bb929e5 100644
--- a/Makefile
+++ b/Makefile
@@ -40,3 +40,9 @@ qa:
 
 build-examples:
 	bash examples/build.sh
+
+## -------
+## Testing
+## -------
+test-bats:
+	bats test/bats
diff --git a/io.txt b/io.txt
new file mode 100644
index 0000000..23d866e
--- /dev/null
+++ b/io.txt
@@ -0,0 +1,14 @@
+----
+EXI: 1
+----
+EXI: 
+----
+EXI: 1
+----
+EXI: 
+----
+EXI: 1
+----
+EXI: 
+----
+EXI: 
diff --git a/lcov.sh b/lcov.sh
index 0637573..fff9093 100755
--- a/lcov.sh
+++ b/lcov.sh
@@ -65,6 +65,7 @@ esac
 lcov_coverage=()
 lcov_extension=sh
 lcov_output=coverage
+lcov_tmp=.tmp
 if [[ -z "LCOV_DEBUG_NO_COLOR" ]]; then
   skip_flag="${escape}[37m(skip)${escape}[0m"
   done_flag="${escape}[1m${escape}[32m(done)${escape}[0m"
@@ -261,50 +262,66 @@ lcov_run_stat () {
 #
 ##
 lcov_test_parse_log() {
-    local exit_code=$1
-    if [[ ${exit_code} -eq 0 ]]; then
-        lcov_stop=$(get_uuid)
-        echo "${lcov_stop}" >> ${lcov_output}/test.log
-        while IFS= read line || [[ -n "${line}" ]]; do
-            if [[ "${line::1}" = "+" ]]; then
-                file=$(echo ${line} | cut -s -d':' -f2)
-                lineno=$(echo ${line} | cut -s -d':' -f3)
-                echo -e "TN:\nSF:${file}\nDA:${lineno},1\nend_of_record" >> ${lcov_output}/test.info
-            elif [[ "${line}" = "${lcov_stop}" ]]; then
-                info=$(grep . ${lcov_output}/test.out | tail -1)
-                echo -e "${done_flag} $1: '${info}' (ok)";
-                lcov -q -a ${lcov_output}/test.info -a ${lcov_output}/lcov.info -o ${lcov_output}/lcov.info && true
-                shift; lcov_run_stat 1 1 0 0; lcov_run_step; lcov_test "$@"
-            fi
-        done < "${lcov_output}/test.log"
-    else
-        info="$(grep "." "${lcov_output}/test.out" | tail -1)"
-        [[ -z "${info}" ]] && info="$(grep "." "${lcov_output}/test.log" | tail -1)"
-        echo -e "${fail_flag} $1: '${info}' (exit ${exit_code})"
-        shift; lcov_run_stat 1 0 1 0; lcov_run_step; lcov_test "$@"
+  local exit_code=$1
+  if [[ ${exit_code} -eq 0 ]]; then
+    lcov_process_log "${lcov_output}/test.log" "${lcov_output}/test.info" "${lcov_output}/test.out"
+  else
+    info="$(grep "." "${lcov_output}/test.out" | tail -1)"
+    [[ -z "${info}" ]] && info="$(grep "." "${lcov_output}/test.log" | tail -1)"
+    echo -e "${fail_flag} $1: '${info}' (exit ${exit_code})"
+    shift; lcov_run_stat 1 0 1 0; lcov_run_step; lcov_test "$@"
+  fi
+}
+
+##
+# $1 - Log file
+# $2 - Info file
+# $3 - Output file
+##
+lcov_process_log() {
+  local file_stop=$(get_uuid)
+  echo "${file_stop}" >> $1
+  while IFS= read line || [[ -n "${line}" ]]; do
+    if [[ "${line::1}" = "+" ]]; then
+      file=$(echo ${line} | cut -s -d':' -f2)
+      lineno=$(echo ${line} | cut -s -d':' -f3)
+      echo -e "TN:\nSF:${file}\nDA:${lineno},1\nend_of_record" >> $2
+    elif [[ "${line}" = "${file_stop}" ]]; then
+      info=$(grep . $3 | tail -1)
+      echo -e "${done_flag} $1: '${info}' (ok)";
+      lcov -q -a ${lcov_output}/test.info -a ${lcov_output}/lcov.info -o ${lcov_output}/lcov.info && true
+      shift; lcov_run_stat 1 1 0 0; lcov_run_step; lcov_test "$@"
     fi
+  done < "${lcov_output}/test.log"
 }
 
+
 ##
 # Execute testcase and process LCOV info.
 ##
 lcov_test() {
-    if [[ -n $1 ]]; then
-        lcov_test_wait
-        echo -n "  > "
-        if [[ -d $1 ]]; then
-            echo -e "${skip_flag} $1/: is directory.";
-            shift; lcov_test_stat 1 0 0 1; lcov_test_step; lcov_test "$@"
-        elif [[ -f $1 ]]; then
-            rm -f ${lcov_output}/test.info
-            lcov_bash_debug $1
-            lcov_test_parse_log $?
-        else
-            echo -e "${skip_flag} $1: file not found.";
-            shift; lcov_test_stat 1 0 0 1; lcov_test_step; lcov_test "$@"
-        fi
+  if [[ -n "$1" ]]; then
+    lcov_test_wait
+    echo -n "  > "
+    if [[ -d "$1" ]]; then
+      echo -e "${skip_flag} $1/: is directory.";
+      shift
+      lcov_test_stat 1 0 0 1
+      lcov_test_step
+      lcov_test "$@"
+    elif [[ -f "$1" ]]; then
+      rm -f ${lcov_output}/test.info
+      lcov_bash_debug $1
+      lcov_test_parse_log $?
+    else
+      echo -e "${skip_flag} $1: file not found.";
+      shift
+      lcov_test_stat 1 0 0 1
+      lcov_test_step
+      lcov_test "$@"
     fi
-    return 0
+  fi
+  return 0
 }
 
 ##
@@ -318,7 +335,34 @@ lcov_bash_debug () {
 }
 
 ##
-# Execute testcase and process LCOV info.
+# Run function used by BATS test case.
+#
+##
+run () {
+  local orig_ps4="${PS4}"
+  local orig_lcov_debug="${LCOV_DEBUG}"
+  local log_file=${lcov_tmp}/run.log
+  rm -f "${log_file}"
+  export LCOV_DEBUG=1
+  export PS4="${LCOV_PS4}"
+  lcov_bats_run "${@}" 2> ${log_file}
+  export LCOV_DEBUG="${orig_lcov_debug}"
+  export PS4="${orig_ps4}"
+}
+
+##
+# Run function used by BATS test case.
+#
+##
+teardown() {
+  local log_file=${lcov_tmp}/run.log
+  if [[ "${BATS_TEST_COMPLETED}" = 1 ]]; then
+    lcov_process_log ${log_file}
+  fi
+}
+
+##
+# Execute testcase and prepare BATS global vars.
 ##
 lcov_bats_run() {
   local flags="$-"
@@ -334,14 +378,10 @@ lcov_bats_run() {
   set "-$flags"
 }
 
-run () {
-  local orig_lcov_debug="${LCOV_DEBUG}"
-  local orig_ps4="${LCOV_DEBUG}"
-  export LCOV_DEBUG=1
-  export PS4="${LCOV_PS4}"
-  debug_run "${@}" 2> /home/francesco/Develop/Javanile/git-auto-commit-action/o2.log
-}
-
+##
+#
+#
+##
 lcov_redirect_log() {
     while read log; do
         echo "---  $log"
diff --git a/test/bats/test1.bats b/test/bats/test1.bats
index f1725cb..4887ffc 100644
--- a/test/bats/test1.bats
+++ b/test/bats/test1.bats
@@ -2,12 +2,14 @@
 load test1.sh
 load ../../lcov.sh
 
-#lcov_init
-
-@test "test1 func1" {
+@test "testing: test1_func1()" {
     run test1_func1
-    echo "${output}" > a.txt
 
     [ "${output}" = "TEST1_FUNC1" ]
+}
+
+@test "testing: test1_func2()" {
+    run test1_func1
 
+    [ "${output}" = "wrong" ]
 }
diff --git a/test/bats/test1.sh b/test/bats/test1.sh
index 7db2dba..af0bae3 100644
--- a/test/bats/test1.sh
+++ b/test/bats/test1.sh
@@ -1,9 +1,8 @@
 #!/usr/bin/env bash
 
-[[ -z "${LCOV_DEBUG}" ]] || set -x
+[[ -n "${LCOV_DEBUG}" ]] && set -x
 
 test1_func1() {
-  #>&2 echo "TEST1_FUNC1"
   echo -n "TEST1_FUNC1"
 }
 

From 4c088c37dafdf056bfa0a5e54ed457cb203ac3d7 Mon Sep 17 00:00:00 2001
From: Francesco Bianco <info.francescobianco@gmail.com>
Date: Mon, 12 Oct 2020 16:19:04 +0200
Subject: [PATCH 07/32] fix missing lcov command

---
 lcov.sh | 106 +++++++++++++++++++++++++++++---------------------------
 1 file changed, 54 insertions(+), 52 deletions(-)

diff --git a/lcov.sh b/lcov.sh
index fff9093..2706627 100755
--- a/lcov.sh
+++ b/lcov.sh
@@ -34,32 +34,32 @@ VERSION="0.1.0"
 LCOV_PS4='+:LCOV_DEBUG:${BASH_SOURCE}:${LINENO}:${FUNCNAME[0]}: '
 
 usage () {
-    echo "Usage: ./lcov.sh [OPTION]... FILE..."
-    echo ""
-    echo "Executes FILE as a test case also collect each LCOV info and generate HTML report"
-    echo ""
-    echo "List of available options"
-    echo "  -e, --extension EXT     Coverage of every *.EXT file (default: sh)"
-    echo "  -i, --include PATH      Include files matching PATH"
-    echo "  -x, --exclude PATH      Exclude files matching PATH"
-    echo "  -o, --output OUTDIR     Write HTML output to OUTDIR"
-    echo "  -h, --help              Display this help and exit"
-    echo "  -v, --version           Display current version"
-    echo ""
-    echo "Documentation can be found at https://github.com/javanile/lcov.sh"
+  echo "Usage: ./lcov.sh [OPTION]... FILE..."
+  echo ""
+  echo "Executes FILE as a test case also collect each LCOV info and generate HTML report"
+  echo ""
+  echo "List of available options"
+  echo "  -e, --extension EXT     Coverage of every *.EXT file (default: sh)"
+  echo "  -i, --include PATH      Include files matching PATH"
+  echo "  -x, --exclude PATH      Exclude files matching PATH"
+  echo "  -o, --output OUTDIR     Write HTML output to OUTDIR"
+  echo "  -h, --help              Display this help and exit"
+  echo "  -v, --version           Display current version"
+  echo ""
+  echo "Documentation can be found at https://github.com/javanile/lcov.sh"
 }
 
 trap '$(jobs -p) || kill $(jobs -p)' EXIT
 
 case "$(uname -s)" in
-    Darwin*)
-        getopt=/usr/local/opt/gnu-getopt/bin/getopt
-        escape='\x1B'
-        ;;
-    Linux|*)
-        [ -x /bin/getopt ] && getopt=/bin/getopt || getopt=/usr/bin/getopt
-        escape='\e'
-        ;;
+  Darwin*)
+    getopt=/usr/local/opt/gnu-getopt/bin/getopt
+    escape='\x1B'
+    ;;
+  Linux|*)
+    [ -x /bin/getopt ] && getopt=/bin/getopt || getopt=/usr/bin/getopt
+    escape='\e'
+    ;;
 esac
 
 lcov_coverage=()
@@ -80,18 +80,20 @@ options=$(${getopt} -n lcov.sh -o i:e:x:o:vh -l extension:,include:,exclude:,out
 eval set -- "${options}"
 
 while true; do
-    case "$1" in
-        -o|--output) shift; lcov_output=$1 ;;
-        -i|--include) shift; lcov_coverage+=("$1") ;;
-        -x|--exclude) shift; lcov_coverage+=("!$1") ;;
-        -e|--extension) shift; lcov_extension=$1 ;;
-        -v|--version) echo "LCOV.SH version ${VERSION}"; exit ;;
-        -h|--help) usage; exit ;;
-        --) shift; break ;;
-    esac
-    shift
+  case "$1" in
+    -o|--output) shift; lcov_output=$1 ;;
+    -i|--include) shift; lcov_coverage+=("$1") ;;
+    -x|--exclude) shift; lcov_coverage+=("!$1") ;;
+    -e|--extension) shift; lcov_extension=$1 ;;
+    -v|--version) echo "LCOV.SH version ${VERSION}"; exit ;;
+    -h|--help) usage; exit ;;
+    --) shift; break ;;
+  esac
+  shift
 done
 
+lcov_test_lock=
+
 ##
 # Generate UUID.
 #
@@ -101,12 +103,12 @@ done
 #  - UUID random code
 ##
 get_uuid ()  {
-    if [[ -f /proc/sys/kernel/random/uuid ]]; then
-        cat /proc/sys/kernel/random/uuid
-    else
-        /usr/bin/uuidgen
-    fi
-    return 0
+  if [[ -f /proc/sys/kernel/random/uuid ]]; then
+    cat /proc/sys/kernel/random/uuid
+  else
+    /usr/bin/uuidgen
+  fi
+  return 0
 }
 
 ##
@@ -144,21 +146,21 @@ get_files () {
 #  - Create output directory with scanned trace file lcov.info file.
 ##
 lcov_init () {
-    echo "LCOV.SH by Francesco Bianco <bianco@javanile.org>"
-    echo ""
+  echo "LCOV.SH by Francesco Bianco <bianco@javanile.org>"
+  echo ""
 
-    mkdir -p "${lcov_output}"
-    rm -f "${lcov_output}/lcov.info" "${lcov_output}/test.stat" "${lcov_output}/test.lock"
+  mkdir -p "${lcov_output}"
+  rm -f "${lcov_output}/lcov.info" "${lcov_output}/test.stat" "${lcov_output}/test.lock"
 
-    get_files "$@" | while IFS= read -r file; do
-        #echo "coverage: ${file}"
-        lcov_scan "${file}" > "${lcov_output}/init.info"
-        [[ -f "${lcov_output}/lcov.info" ]] || lcov -q -a "${lcov_output}/init.info" -o "${lcov_output}/lcov.info" && true
-        lcov -q -a "${lcov_output}/init.info" -a "${lcov_output}/lcov.info" -o "${lcov_output}/lcov.info" >/dev/null 2>&1 && true
-        rm -f "${lcov_output}/init.info"
-    done
+  get_files "$@" | while IFS= read -r file; do
+    #echo "coverage: ${file}"
+    lcov_scan "${file}" > "${lcov_output}/init.info"
+    [[ -f "${lcov_output}/lcov.info" ]] || lcov -q -a "${lcov_output}/init.info" -o "${lcov_output}/lcov.info" && true
+    lcov -q -a "${lcov_output}/init.info" -a "${lcov_output}/lcov.info" -o "${lcov_output}/lcov.info" >/dev/null 2>&1 && true
+    rm -f "${lcov_output}/init.info"
+  done
 
-    return 0
+  return 0
 }
 
 ##
@@ -231,9 +233,9 @@ lcov_done () {
 #
 ##
 lcov_test_wait() {
-    while [[ -f ${lcov_output}/test.lock ]]; do sleep 2; done;
-    touch ${lcov_output}/test.lock
-    return 0
+  while [[ -f ${lcov_output}/test.lock ]]; do sleep 2; done;
+  touch ${lcov_output}/test.lock
+  return 0
 }
 
 ##

From bd8f4975ffd98d0ee073bf4dcd3124f0d56563e9 Mon Sep 17 00:00:00 2001
From: Francesco Bianco <info.francescobianco@gmail.com>
Date: Mon, 12 Oct 2020 17:14:09 +0200
Subject: [PATCH 08/32] fix missing lcov command

---
 .tmp/run.log         |  50 +++++-----
 Makefile             |   7 +-
 lcov.sh              | 212 ++++++++++++++++++++++---------------------
 test/bats/test1.bats |   1 +
 4 files changed, 140 insertions(+), 130 deletions(-)

diff --git a/.tmp/run.log b/.tmp/run.log
index 93f6dcd..fd67436 100644
--- a/.tmp/run.log
+++ b/.tmp/run.log
@@ -1,4 +1,4 @@
-++:LCOV_DEBUG:/home/francesco/Develop/Javanile/lcov.sh/test/bats/../../lcov.sh:356:lcov_bats_run: bats_debug_trap /home/francesco/Develop/Javanile/lcov.sh/test/bats/../../lcov.sh
+++:LCOV_DEBUG:/home/francesco/Develop/Javanile/lcov.sh/test/bats/../../lcov.sh:377:lcov_bats_run: bats_debug_trap /home/francesco/Develop/Javanile/lcov.sh/test/bats/../../lcov.sh
 ++:LCOV_DEBUG:/usr/local/lib/bats-core/tracing.bash:122:bats_debug_trap: [[ /home/francesco/Develop/Javanile/lcov.sh/test/bats/../../lcov.sh != /usr/local/lib/* ]]
 ++:LCOV_DEBUG:/usr/local/lib/bats-core/tracing.bash:122:bats_debug_trap: [[ /home/francesco/Develop/Javanile/lcov.sh/test/bats/../../lcov.sh != /usr/local/libexec/* ]]
 ++:LCOV_DEBUG:/usr/local/lib/bats-core/tracing.bash:128:bats_debug_trap: BATS_CURRENT_STACK_TRACE=("${BATS_STACK_TRACE[@]+"${BATS_STACK_TRACE[@]}"}")
@@ -12,25 +12,25 @@
 ++:LCOV_DEBUG:/usr/local/lib/bats-core/tracing.bash:13:bats_capture_stack_trace: test_file=/home/francesco/Develop/Javanile/lcov.sh/test/bats/../../lcov.sh
 ++:LCOV_DEBUG:/usr/local/lib/bats-core/tracing.bash:14:bats_capture_stack_trace: funcname=lcov_bats_run
 ++:LCOV_DEBUG:/usr/local/lib/bats-core/tracing.bash:15:bats_capture_stack_trace: BATS_STACK_TRACE+=("${BASH_LINENO[$((i - 1))]} $funcname $test_file")
-++:LCOV_DEBUG:/usr/local/lib/bats-core/tracing.bash:16:bats_capture_stack_trace: [[ /home/francesco/Develop/Javanile/lcov.sh/test/bats/../../lcov.sh == \/\t\m\p\/\b\a\t\s\-\r\u\n\-\2\6\2\2\4\/\b\a\t\s\.\2\6\2\6\9\.\s\r\c ]]
+++:LCOV_DEBUG:/usr/local/lib/bats-core/tracing.bash:16:bats_capture_stack_trace: [[ /home/francesco/Develop/Javanile/lcov.sh/test/bats/../../lcov.sh == \/\t\m\p\/\b\a\t\s\-\r\u\n\-\2\7\8\1\4\/\b\a\t\s\.\2\7\8\6\1\.\s\r\c ]]
 ++:LCOV_DEBUG:/usr/local/lib/bats-core/tracing.bash:10:bats_capture_stack_trace: (( ++i ))
 ++:LCOV_DEBUG:/usr/local/lib/bats-core/tracing.bash:10:bats_capture_stack_trace: (( i != 7 ))
 ++:LCOV_DEBUG:/usr/local/lib/bats-core/tracing.bash:13:bats_capture_stack_trace: test_file=/home/francesco/Develop/Javanile/lcov.sh/test/bats/../../lcov.sh
 ++:LCOV_DEBUG:/usr/local/lib/bats-core/tracing.bash:14:bats_capture_stack_trace: funcname=run
 ++:LCOV_DEBUG:/usr/local/lib/bats-core/tracing.bash:15:bats_capture_stack_trace: BATS_STACK_TRACE+=("${BASH_LINENO[$((i - 1))]} $funcname $test_file")
-++:LCOV_DEBUG:/usr/local/lib/bats-core/tracing.bash:16:bats_capture_stack_trace: [[ /home/francesco/Develop/Javanile/lcov.sh/test/bats/../../lcov.sh == \/\t\m\p\/\b\a\t\s\-\r\u\n\-\2\6\2\2\4\/\b\a\t\s\.\2\6\2\6\9\.\s\r\c ]]
+++:LCOV_DEBUG:/usr/local/lib/bats-core/tracing.bash:16:bats_capture_stack_trace: [[ /home/francesco/Develop/Javanile/lcov.sh/test/bats/../../lcov.sh == \/\t\m\p\/\b\a\t\s\-\r\u\n\-\2\7\8\1\4\/\b\a\t\s\.\2\7\8\6\1\.\s\r\c ]]
 ++:LCOV_DEBUG:/usr/local/lib/bats-core/tracing.bash:10:bats_capture_stack_trace: (( ++i ))
 ++:LCOV_DEBUG:/usr/local/lib/bats-core/tracing.bash:10:bats_capture_stack_trace: (( i != 7 ))
-++:LCOV_DEBUG:/usr/local/lib/bats-core/tracing.bash:13:bats_capture_stack_trace: test_file=/tmp/bats-run-26224/bats.26269.src
+++:LCOV_DEBUG:/usr/local/lib/bats-core/tracing.bash:13:bats_capture_stack_trace: test_file=/tmp/bats-run-27814/bats.27861.src
 ++:LCOV_DEBUG:/usr/local/lib/bats-core/tracing.bash:14:bats_capture_stack_trace: funcname=test_testing-3a_test1-5ffunc2-28-29
 ++:LCOV_DEBUG:/usr/local/lib/bats-core/tracing.bash:15:bats_capture_stack_trace: BATS_STACK_TRACE+=("${BASH_LINENO[$((i - 1))]} $funcname $test_file")
-++:LCOV_DEBUG:/usr/local/lib/bats-core/tracing.bash:16:bats_capture_stack_trace: [[ /tmp/bats-run-26224/bats.26269.src == \/\t\m\p\/\b\a\t\s\-\r\u\n\-\2\6\2\2\4\/\b\a\t\s\.\2\6\2\6\9\.\s\r\c ]]
+++:LCOV_DEBUG:/usr/local/lib/bats-core/tracing.bash:16:bats_capture_stack_trace: [[ /tmp/bats-run-27814/bats.27861.src == \/\t\m\p\/\b\a\t\s\-\r\u\n\-\2\7\8\1\4\/\b\a\t\s\.\2\7\8\6\1\.\s\r\c ]]
 ++:LCOV_DEBUG:/usr/local/lib/bats-core/tracing.bash:17:bats_capture_stack_trace: case "$funcname" in
 ++:LCOV_DEBUG:/usr/local/lib/bats-core/tracing.bash:19:bats_capture_stack_trace: break
-++:LCOV_DEBUG:/home/francesco/Develop/Javanile/lcov.sh/test/bats/../../lcov.sh:356:lcov_bats_run: test1_func1
+++:LCOV_DEBUG:/home/francesco/Develop/Javanile/lcov.sh/test/bats/../../lcov.sh:377:lcov_bats_run: test1_func1
 ++:LCOV_DEBUG:/home/francesco/Develop/Javanile/lcov.sh/test/bats/test1.sh:6:test1_func1: echo -n TEST1_FUNC1
-+:LCOV_DEBUG:/home/francesco/Develop/Javanile/lcov.sh/test/bats/../../lcov.sh:356:lcov_bats_run: output=TEST1_FUNC1
-++:LCOV_DEBUG:/home/francesco/Develop/Javanile/lcov.sh/test/bats/../../lcov.sh:357:lcov_bats_run: bats_debug_trap /home/francesco/Develop/Javanile/lcov.sh/test/bats/../../lcov.sh
++:LCOV_DEBUG:/home/francesco/Develop/Javanile/lcov.sh/test/bats/../../lcov.sh:377:lcov_bats_run: output=TEST1_FUNC1
+++:LCOV_DEBUG:/home/francesco/Develop/Javanile/lcov.sh/test/bats/../../lcov.sh:378:lcov_bats_run: bats_debug_trap /home/francesco/Develop/Javanile/lcov.sh/test/bats/../../lcov.sh
 ++:LCOV_DEBUG:/usr/local/lib/bats-core/tracing.bash:122:bats_debug_trap: [[ /home/francesco/Develop/Javanile/lcov.sh/test/bats/../../lcov.sh != /usr/local/lib/* ]]
 ++:LCOV_DEBUG:/usr/local/lib/bats-core/tracing.bash:122:bats_debug_trap: [[ /home/francesco/Develop/Javanile/lcov.sh/test/bats/../../lcov.sh != /usr/local/libexec/* ]]
 ++:LCOV_DEBUG:/usr/local/lib/bats-core/tracing.bash:128:bats_debug_trap: BATS_CURRENT_STACK_TRACE=("${BATS_STACK_TRACE[@]+"${BATS_STACK_TRACE[@]}"}")
@@ -44,23 +44,23 @@
 ++:LCOV_DEBUG:/usr/local/lib/bats-core/tracing.bash:13:bats_capture_stack_trace: test_file=/home/francesco/Develop/Javanile/lcov.sh/test/bats/../../lcov.sh
 ++:LCOV_DEBUG:/usr/local/lib/bats-core/tracing.bash:14:bats_capture_stack_trace: funcname=lcov_bats_run
 ++:LCOV_DEBUG:/usr/local/lib/bats-core/tracing.bash:15:bats_capture_stack_trace: BATS_STACK_TRACE+=("${BASH_LINENO[$((i - 1))]} $funcname $test_file")
-++:LCOV_DEBUG:/usr/local/lib/bats-core/tracing.bash:16:bats_capture_stack_trace: [[ /home/francesco/Develop/Javanile/lcov.sh/test/bats/../../lcov.sh == \/\t\m\p\/\b\a\t\s\-\r\u\n\-\2\6\2\2\4\/\b\a\t\s\.\2\6\2\6\9\.\s\r\c ]]
+++:LCOV_DEBUG:/usr/local/lib/bats-core/tracing.bash:16:bats_capture_stack_trace: [[ /home/francesco/Develop/Javanile/lcov.sh/test/bats/../../lcov.sh == \/\t\m\p\/\b\a\t\s\-\r\u\n\-\2\7\8\1\4\/\b\a\t\s\.\2\7\8\6\1\.\s\r\c ]]
 ++:LCOV_DEBUG:/usr/local/lib/bats-core/tracing.bash:10:bats_capture_stack_trace: (( ++i ))
 ++:LCOV_DEBUG:/usr/local/lib/bats-core/tracing.bash:10:bats_capture_stack_trace: (( i != 7 ))
 ++:LCOV_DEBUG:/usr/local/lib/bats-core/tracing.bash:13:bats_capture_stack_trace: test_file=/home/francesco/Develop/Javanile/lcov.sh/test/bats/../../lcov.sh
 ++:LCOV_DEBUG:/usr/local/lib/bats-core/tracing.bash:14:bats_capture_stack_trace: funcname=run
 ++:LCOV_DEBUG:/usr/local/lib/bats-core/tracing.bash:15:bats_capture_stack_trace: BATS_STACK_TRACE+=("${BASH_LINENO[$((i - 1))]} $funcname $test_file")
-++:LCOV_DEBUG:/usr/local/lib/bats-core/tracing.bash:16:bats_capture_stack_trace: [[ /home/francesco/Develop/Javanile/lcov.sh/test/bats/../../lcov.sh == \/\t\m\p\/\b\a\t\s\-\r\u\n\-\2\6\2\2\4\/\b\a\t\s\.\2\6\2\6\9\.\s\r\c ]]
+++:LCOV_DEBUG:/usr/local/lib/bats-core/tracing.bash:16:bats_capture_stack_trace: [[ /home/francesco/Develop/Javanile/lcov.sh/test/bats/../../lcov.sh == \/\t\m\p\/\b\a\t\s\-\r\u\n\-\2\7\8\1\4\/\b\a\t\s\.\2\7\8\6\1\.\s\r\c ]]
 ++:LCOV_DEBUG:/usr/local/lib/bats-core/tracing.bash:10:bats_capture_stack_trace: (( ++i ))
 ++:LCOV_DEBUG:/usr/local/lib/bats-core/tracing.bash:10:bats_capture_stack_trace: (( i != 7 ))
-++:LCOV_DEBUG:/usr/local/lib/bats-core/tracing.bash:13:bats_capture_stack_trace: test_file=/tmp/bats-run-26224/bats.26269.src
+++:LCOV_DEBUG:/usr/local/lib/bats-core/tracing.bash:13:bats_capture_stack_trace: test_file=/tmp/bats-run-27814/bats.27861.src
 ++:LCOV_DEBUG:/usr/local/lib/bats-core/tracing.bash:14:bats_capture_stack_trace: funcname=test_testing-3a_test1-5ffunc2-28-29
 ++:LCOV_DEBUG:/usr/local/lib/bats-core/tracing.bash:15:bats_capture_stack_trace: BATS_STACK_TRACE+=("${BASH_LINENO[$((i - 1))]} $funcname $test_file")
-++:LCOV_DEBUG:/usr/local/lib/bats-core/tracing.bash:16:bats_capture_stack_trace: [[ /tmp/bats-run-26224/bats.26269.src == \/\t\m\p\/\b\a\t\s\-\r\u\n\-\2\6\2\2\4\/\b\a\t\s\.\2\6\2\6\9\.\s\r\c ]]
+++:LCOV_DEBUG:/usr/local/lib/bats-core/tracing.bash:16:bats_capture_stack_trace: [[ /tmp/bats-run-27814/bats.27861.src == \/\t\m\p\/\b\a\t\s\-\r\u\n\-\2\7\8\1\4\/\b\a\t\s\.\2\7\8\6\1\.\s\r\c ]]
 ++:LCOV_DEBUG:/usr/local/lib/bats-core/tracing.bash:17:bats_capture_stack_trace: case "$funcname" in
 ++:LCOV_DEBUG:/usr/local/lib/bats-core/tracing.bash:19:bats_capture_stack_trace: break
-+:LCOV_DEBUG:/home/francesco/Develop/Javanile/lcov.sh/test/bats/../../lcov.sh:357:lcov_bats_run: status=0
-++:LCOV_DEBUG:/home/francesco/Develop/Javanile/lcov.sh/test/bats/../../lcov.sh:358:lcov_bats_run: bats_debug_trap /home/francesco/Develop/Javanile/lcov.sh/test/bats/../../lcov.sh
++:LCOV_DEBUG:/home/francesco/Develop/Javanile/lcov.sh/test/bats/../../lcov.sh:378:lcov_bats_run: status=0
+++:LCOV_DEBUG:/home/francesco/Develop/Javanile/lcov.sh/test/bats/../../lcov.sh:379:lcov_bats_run: bats_debug_trap /home/francesco/Develop/Javanile/lcov.sh/test/bats/../../lcov.sh
 ++:LCOV_DEBUG:/usr/local/lib/bats-core/tracing.bash:122:bats_debug_trap: [[ /home/francesco/Develop/Javanile/lcov.sh/test/bats/../../lcov.sh != /usr/local/lib/* ]]
 ++:LCOV_DEBUG:/usr/local/lib/bats-core/tracing.bash:122:bats_debug_trap: [[ /home/francesco/Develop/Javanile/lcov.sh/test/bats/../../lcov.sh != /usr/local/libexec/* ]]
 ++:LCOV_DEBUG:/usr/local/lib/bats-core/tracing.bash:128:bats_debug_trap: BATS_CURRENT_STACK_TRACE=("${BATS_STACK_TRACE[@]+"${BATS_STACK_TRACE[@]}"}")
@@ -74,23 +74,23 @@
 ++:LCOV_DEBUG:/usr/local/lib/bats-core/tracing.bash:13:bats_capture_stack_trace: test_file=/home/francesco/Develop/Javanile/lcov.sh/test/bats/../../lcov.sh
 ++:LCOV_DEBUG:/usr/local/lib/bats-core/tracing.bash:14:bats_capture_stack_trace: funcname=lcov_bats_run
 ++:LCOV_DEBUG:/usr/local/lib/bats-core/tracing.bash:15:bats_capture_stack_trace: BATS_STACK_TRACE+=("${BASH_LINENO[$((i - 1))]} $funcname $test_file")
-++:LCOV_DEBUG:/usr/local/lib/bats-core/tracing.bash:16:bats_capture_stack_trace: [[ /home/francesco/Develop/Javanile/lcov.sh/test/bats/../../lcov.sh == \/\t\m\p\/\b\a\t\s\-\r\u\n\-\2\6\2\2\4\/\b\a\t\s\.\2\6\2\6\9\.\s\r\c ]]
+++:LCOV_DEBUG:/usr/local/lib/bats-core/tracing.bash:16:bats_capture_stack_trace: [[ /home/francesco/Develop/Javanile/lcov.sh/test/bats/../../lcov.sh == \/\t\m\p\/\b\a\t\s\-\r\u\n\-\2\7\8\1\4\/\b\a\t\s\.\2\7\8\6\1\.\s\r\c ]]
 ++:LCOV_DEBUG:/usr/local/lib/bats-core/tracing.bash:10:bats_capture_stack_trace: (( ++i ))
 ++:LCOV_DEBUG:/usr/local/lib/bats-core/tracing.bash:10:bats_capture_stack_trace: (( i != 7 ))
 ++:LCOV_DEBUG:/usr/local/lib/bats-core/tracing.bash:13:bats_capture_stack_trace: test_file=/home/francesco/Develop/Javanile/lcov.sh/test/bats/../../lcov.sh
 ++:LCOV_DEBUG:/usr/local/lib/bats-core/tracing.bash:14:bats_capture_stack_trace: funcname=run
 ++:LCOV_DEBUG:/usr/local/lib/bats-core/tracing.bash:15:bats_capture_stack_trace: BATS_STACK_TRACE+=("${BASH_LINENO[$((i - 1))]} $funcname $test_file")
-++:LCOV_DEBUG:/usr/local/lib/bats-core/tracing.bash:16:bats_capture_stack_trace: [[ /home/francesco/Develop/Javanile/lcov.sh/test/bats/../../lcov.sh == \/\t\m\p\/\b\a\t\s\-\r\u\n\-\2\6\2\2\4\/\b\a\t\s\.\2\6\2\6\9\.\s\r\c ]]
+++:LCOV_DEBUG:/usr/local/lib/bats-core/tracing.bash:16:bats_capture_stack_trace: [[ /home/francesco/Develop/Javanile/lcov.sh/test/bats/../../lcov.sh == \/\t\m\p\/\b\a\t\s\-\r\u\n\-\2\7\8\1\4\/\b\a\t\s\.\2\7\8\6\1\.\s\r\c ]]
 ++:LCOV_DEBUG:/usr/local/lib/bats-core/tracing.bash:10:bats_capture_stack_trace: (( ++i ))
 ++:LCOV_DEBUG:/usr/local/lib/bats-core/tracing.bash:10:bats_capture_stack_trace: (( i != 7 ))
-++:LCOV_DEBUG:/usr/local/lib/bats-core/tracing.bash:13:bats_capture_stack_trace: test_file=/tmp/bats-run-26224/bats.26269.src
+++:LCOV_DEBUG:/usr/local/lib/bats-core/tracing.bash:13:bats_capture_stack_trace: test_file=/tmp/bats-run-27814/bats.27861.src
 ++:LCOV_DEBUG:/usr/local/lib/bats-core/tracing.bash:14:bats_capture_stack_trace: funcname=test_testing-3a_test1-5ffunc2-28-29
 ++:LCOV_DEBUG:/usr/local/lib/bats-core/tracing.bash:15:bats_capture_stack_trace: BATS_STACK_TRACE+=("${BASH_LINENO[$((i - 1))]} $funcname $test_file")
-++:LCOV_DEBUG:/usr/local/lib/bats-core/tracing.bash:16:bats_capture_stack_trace: [[ /tmp/bats-run-26224/bats.26269.src == \/\t\m\p\/\b\a\t\s\-\r\u\n\-\2\6\2\2\4\/\b\a\t\s\.\2\6\2\6\9\.\s\r\c ]]
+++:LCOV_DEBUG:/usr/local/lib/bats-core/tracing.bash:16:bats_capture_stack_trace: [[ /tmp/bats-run-27814/bats.27861.src == \/\t\m\p\/\b\a\t\s\-\r\u\n\-\2\7\8\1\4\/\b\a\t\s\.\2\7\8\6\1\.\s\r\c ]]
 ++:LCOV_DEBUG:/usr/local/lib/bats-core/tracing.bash:17:bats_capture_stack_trace: case "$funcname" in
 ++:LCOV_DEBUG:/usr/local/lib/bats-core/tracing.bash:19:bats_capture_stack_trace: break
-+:LCOV_DEBUG:/home/francesco/Develop/Javanile/lcov.sh/test/bats/../../lcov.sh:358:lcov_bats_run: [[ efhBET =~ x ]]
-++:LCOV_DEBUG:/home/francesco/Develop/Javanile/lcov.sh/test/bats/../../lcov.sh:358:lcov_bats_run: bats_debug_trap /home/francesco/Develop/Javanile/lcov.sh/test/bats/../../lcov.sh
++:LCOV_DEBUG:/home/francesco/Develop/Javanile/lcov.sh/test/bats/../../lcov.sh:379:lcov_bats_run: [[ efhBET =~ x ]]
+++:LCOV_DEBUG:/home/francesco/Develop/Javanile/lcov.sh/test/bats/../../lcov.sh:379:lcov_bats_run: bats_debug_trap /home/francesco/Develop/Javanile/lcov.sh/test/bats/../../lcov.sh
 ++:LCOV_DEBUG:/usr/local/lib/bats-core/tracing.bash:122:bats_debug_trap: [[ /home/francesco/Develop/Javanile/lcov.sh/test/bats/../../lcov.sh != /usr/local/lib/* ]]
 ++:LCOV_DEBUG:/usr/local/lib/bats-core/tracing.bash:122:bats_debug_trap: [[ /home/francesco/Develop/Javanile/lcov.sh/test/bats/../../lcov.sh != /usr/local/libexec/* ]]
 ++:LCOV_DEBUG:/usr/local/lib/bats-core/tracing.bash:128:bats_debug_trap: BATS_CURRENT_STACK_TRACE=("${BATS_STACK_TRACE[@]+"${BATS_STACK_TRACE[@]}"}")
@@ -104,19 +104,19 @@
 ++:LCOV_DEBUG:/usr/local/lib/bats-core/tracing.bash:13:bats_capture_stack_trace: test_file=/home/francesco/Develop/Javanile/lcov.sh/test/bats/../../lcov.sh
 ++:LCOV_DEBUG:/usr/local/lib/bats-core/tracing.bash:14:bats_capture_stack_trace: funcname=lcov_bats_run
 ++:LCOV_DEBUG:/usr/local/lib/bats-core/tracing.bash:15:bats_capture_stack_trace: BATS_STACK_TRACE+=("${BASH_LINENO[$((i - 1))]} $funcname $test_file")
-++:LCOV_DEBUG:/usr/local/lib/bats-core/tracing.bash:16:bats_capture_stack_trace: [[ /home/francesco/Develop/Javanile/lcov.sh/test/bats/../../lcov.sh == \/\t\m\p\/\b\a\t\s\-\r\u\n\-\2\6\2\2\4\/\b\a\t\s\.\2\6\2\6\9\.\s\r\c ]]
+++:LCOV_DEBUG:/usr/local/lib/bats-core/tracing.bash:16:bats_capture_stack_trace: [[ /home/francesco/Develop/Javanile/lcov.sh/test/bats/../../lcov.sh == \/\t\m\p\/\b\a\t\s\-\r\u\n\-\2\7\8\1\4\/\b\a\t\s\.\2\7\8\6\1\.\s\r\c ]]
 ++:LCOV_DEBUG:/usr/local/lib/bats-core/tracing.bash:10:bats_capture_stack_trace: (( ++i ))
 ++:LCOV_DEBUG:/usr/local/lib/bats-core/tracing.bash:10:bats_capture_stack_trace: (( i != 7 ))
 ++:LCOV_DEBUG:/usr/local/lib/bats-core/tracing.bash:13:bats_capture_stack_trace: test_file=/home/francesco/Develop/Javanile/lcov.sh/test/bats/../../lcov.sh
 ++:LCOV_DEBUG:/usr/local/lib/bats-core/tracing.bash:14:bats_capture_stack_trace: funcname=run
 ++:LCOV_DEBUG:/usr/local/lib/bats-core/tracing.bash:15:bats_capture_stack_trace: BATS_STACK_TRACE+=("${BASH_LINENO[$((i - 1))]} $funcname $test_file")
-++:LCOV_DEBUG:/usr/local/lib/bats-core/tracing.bash:16:bats_capture_stack_trace: [[ /home/francesco/Develop/Javanile/lcov.sh/test/bats/../../lcov.sh == \/\t\m\p\/\b\a\t\s\-\r\u\n\-\2\6\2\2\4\/\b\a\t\s\.\2\6\2\6\9\.\s\r\c ]]
+++:LCOV_DEBUG:/usr/local/lib/bats-core/tracing.bash:16:bats_capture_stack_trace: [[ /home/francesco/Develop/Javanile/lcov.sh/test/bats/../../lcov.sh == \/\t\m\p\/\b\a\t\s\-\r\u\n\-\2\7\8\1\4\/\b\a\t\s\.\2\7\8\6\1\.\s\r\c ]]
 ++:LCOV_DEBUG:/usr/local/lib/bats-core/tracing.bash:10:bats_capture_stack_trace: (( ++i ))
 ++:LCOV_DEBUG:/usr/local/lib/bats-core/tracing.bash:10:bats_capture_stack_trace: (( i != 7 ))
-++:LCOV_DEBUG:/usr/local/lib/bats-core/tracing.bash:13:bats_capture_stack_trace: test_file=/tmp/bats-run-26224/bats.26269.src
+++:LCOV_DEBUG:/usr/local/lib/bats-core/tracing.bash:13:bats_capture_stack_trace: test_file=/tmp/bats-run-27814/bats.27861.src
 ++:LCOV_DEBUG:/usr/local/lib/bats-core/tracing.bash:14:bats_capture_stack_trace: funcname=test_testing-3a_test1-5ffunc2-28-29
 ++:LCOV_DEBUG:/usr/local/lib/bats-core/tracing.bash:15:bats_capture_stack_trace: BATS_STACK_TRACE+=("${BASH_LINENO[$((i - 1))]} $funcname $test_file")
-++:LCOV_DEBUG:/usr/local/lib/bats-core/tracing.bash:16:bats_capture_stack_trace: [[ /tmp/bats-run-26224/bats.26269.src == \/\t\m\p\/\b\a\t\s\-\r\u\n\-\2\6\2\2\4\/\b\a\t\s\.\2\6\2\6\9\.\s\r\c ]]
+++:LCOV_DEBUG:/usr/local/lib/bats-core/tracing.bash:16:bats_capture_stack_trace: [[ /tmp/bats-run-27814/bats.27861.src == \/\t\m\p\/\b\a\t\s\-\r\u\n\-\2\7\8\1\4\/\b\a\t\s\.\2\7\8\6\1\.\s\r\c ]]
 ++:LCOV_DEBUG:/usr/local/lib/bats-core/tracing.bash:17:bats_capture_stack_trace: case "$funcname" in
 ++:LCOV_DEBUG:/usr/local/lib/bats-core/tracing.bash:19:bats_capture_stack_trace: break
-+:LCOV_DEBUG:/home/francesco/Develop/Javanile/lcov.sh/test/bats/../../lcov.sh:358:lcov_bats_run: set +x
++:LCOV_DEBUG:/home/francesco/Develop/Javanile/lcov.sh/test/bats/../../lcov.sh:379:lcov_bats_run: set +x
diff --git a/Makefile b/Makefile
index bb929e5..42867dd 100644
--- a/Makefile
+++ b/Makefile
@@ -45,4 +45,9 @@ build-examples:
 ## Testing
 ## -------
 test-bats:
-	bats test/bats
+	@rm -fr coverage
+	@bats test/bats
+
+test-get-uuid-function:
+	@rm -fr coverage test/coverage
+	@bash lcov.sh test/get_uuid.test.sh
diff --git a/lcov.sh b/lcov.sh
index 2706627..dd5eb04 100755
--- a/lcov.sh
+++ b/lcov.sh
@@ -92,7 +92,10 @@ while true; do
   shift
 done
 
-lcov_test_lock=
+lcov_info="${lcov_output}/lcov.info"
+lcov_test_log="${lcov_output}/test.log"
+lcov_test_lock="${lcov_output}/test.lock"
+lcov_test_info="${lcov_output}/test.info"
 
 ##
 # Generate UUID.
@@ -120,21 +123,21 @@ get_uuid ()  {
 #  - Create output directory with scanned tracefile lcov.info file.
 ##
 get_files () {
-    include="-name *.${extension}"
-    exclude="-not -wholename ${lcov_output} -not -path .git"
+  local include="-name *.${extension}"
+  local exclude="-not -wholename ${lcov_output} -not -path .git"
 
-    for arg in "$@"; do
-        #echo "ARG: ${arg}"
-        if [[ "${arg::1}" != "!" ]]; then
-            include+=" -or -wholename ${arg}"
-        else
-            exclude+=" -not -wholename ${arg:1} -not -path *${arg:1}*"
-        fi
-    done
+  for arg in "$@"; do
+    #echo "ARG: ${arg}"
+    if [[ "${arg::1}" != "!" ]]; then
+      include+=" -or -wholename ${arg}"
+    else
+      exclude+=" -not -wholename ${arg:1} -not -path *${arg:1}*"
+    fi
+  done
 
-    find . -type f \( ${include[0]} \) \( ${exclude[0]} \)
+  find . -type f \( ${include[0]} \) \( ${exclude[0]} \)
 
-    return 0
+  return 0
 }
 
 ##
@@ -145,19 +148,21 @@ get_files () {
 # Outputs
 #  - Create output directory with scanned trace file lcov.info file.
 ##
-lcov_init () {
+lcov_init() {
   echo "LCOV.SH by Francesco Bianco <bianco@javanile.org>"
   echo ""
 
   mkdir -p "${lcov_output}"
-  rm -f "${lcov_output}/lcov.info" "${lcov_output}/test.stat" "${lcov_output}/test.lock"
+  rm -f "${lcov_info}" "${lcov_test_stat}" "${lcov_test_lock}"
+
+  local init_info="${lcov_output}/init.info"
 
   get_files "$@" | while IFS= read -r file; do
     #echo "coverage: ${file}"
-    lcov_scan "${file}" > "${lcov_output}/init.info"
-    [[ -f "${lcov_output}/lcov.info" ]] || lcov -q -a "${lcov_output}/init.info" -o "${lcov_output}/lcov.info" && true
-    lcov -q -a "${lcov_output}/init.info" -a "${lcov_output}/lcov.info" -o "${lcov_output}/lcov.info" >/dev/null 2>&1 && true
-    rm -f "${lcov_output}/init.info"
+    lcov_scan "${file}" > "${init_info}"
+    [[ -f "${lcov_info}" ]] || lcov -q -a "${init_info}" -o "${lcov_info}" && true
+    lcov -q -a "${init_info}" -a "${lcov_info}" -o "${lcov_info}" >/dev/null 2>&1 && true
+    rm -f "${init_info}"
   done
 
   return 0
@@ -169,34 +174,38 @@ lcov_init () {
 # Arguments
 #  - $1: file to scan.
 # Outputs
-#  -
-##
-lcov_scan () {
-    lineno=0
-    skip_eof=
-    echo "TN:"
-    echo "SF:$1"
-    while IFS= read line || [[ -n "${line}" ]]; do
-        #line=${line%%*( )}
-        line="${line#"${line%%[![:space:]]*}"}"
-        line="${line%"${line##*[![:space:]]}"}"
-        lineno=$((lineno + 1))
-        [[ -z "${line}" ]] && continue
-        [[ "${line}" == "else" ]] && continue
-        [[ "${line}" == "fi" ]] && continue
-        [[ "${line}" == ";;" ]] && continue
-        [[ "${line}" == "esac" ]] && continue
-        [[ "${line}" == "done" ]] && continue
-        [[ "${line::1}" == "#" ]] && continue
-        [[ "${line::1}" == "}" ]] && continue
-        [[ "${line}" == *"{" ]] && continue
-        [[ "${line}" == "EOF" ]] && skip_eof= && continue
-        [[ "${skip_eof}" == "EOF" ]] && continue
-        [[ "${line}" == *"<<EOF" ]] && skip_eof=EOF
-        echo "DA:${lineno},0"
-    done < "$1"
-    echo "end_of_record"
-    return 0
+#  - LCOV rules from file.
+##
+lcov_scan() {
+  local lineno=0
+  local skip_eof=
+
+  echo "TN:"
+  echo "SF:$1"
+
+  while IFS= read line || [[ -n "${line}" ]]; do
+    #line=${line%%*( )}
+    line="${line#"${line%%[![:space:]]*}"}"
+    line="${line%"${line##*[![:space:]]}"}"
+    lineno=$((lineno + 1))
+    [[ -z "${line}" ]] && continue
+    [[ "${line}" == "else" ]] && continue
+    [[ "${line}" == "fi" ]] && continue
+    [[ "${line}" == ";;" ]] && continue
+    [[ "${line}" == "esac" ]] && continue
+    [[ "${line}" == "done" ]] && continue
+    [[ "${line::1}" == "#" ]] && continue
+    [[ "${line::1}" == "}" ]] && continue
+    [[ "${line}" == *"{" ]] && continue
+    [[ "${line}" == "EOF" ]] && skip_eof= && continue
+    [[ "${skip_eof}" == "EOF" ]] && continue
+    [[ "${line}" == *"<<EOF" ]] && skip_eof=EOF
+    echo "DA:${lineno},0"
+  done < "$1"
+
+  echo "end_of_record"
+
+  return 0
 }
 
 ##
@@ -207,26 +216,28 @@ lcov_scan () {
 # Outputs:
 #  - Show LCOV summary with tests information
 ##
-lcov_done () {
-    echo ""
-    stat="0 0 0 0"
-    [[ -f "${lcov_output}/test.stat" ]] && stat="$(cat ${lcov_output}/test.stat && true)"
-    test="$(echo ${stat} | cut -s -d' ' -f1)"
-    done="$(echo ${stat} | cut -s -d' ' -f2)"
-    fail="$(echo ${stat} | cut -s -d' ' -f3)"
-    skip="$(echo ${stat} | cut -s -d' ' -f4)"
-    if [[ ${fail} -gt 0 || ${done} -eq 0 ]]; then
-        exit_info="${fail_flag}"
-        exit_code=1
-    else
-        exit_info="${done_flag}"
-        exit_code=0
-    fi
-    genhtml -q -o "${output}" "${output}/lcov.info"
-    lcov --summary "${output}/lcov.info"
-    echo -e "  tests......: TOTAL ${test}, DONE ${done}, FAIL ${fail}, SKIP ${skip}"
-    echo -e "  exit.......: CODE ${exit_code}, ${exit_info}"
-    exit ${exit_code}
+lcov_done() {
+  local stat="0 0 0 0"
+  [[ -f "${lcov_test_stat}" ]] && stat="$(cat ${lcov_test_stat} && true)"
+  test="$(echo ${stat} | cut -s -d' ' -f1)"
+  done="$(echo ${stat} | cut -s -d' ' -f2)"
+  fail="$(echo ${stat} | cut -s -d' ' -f3)"
+  skip="$(echo ${stat} | cut -s -d' ' -f4)"
+
+  if [[ ${fail} -gt 0 || ${done} -eq 0 ]]; then
+      exit_info="${fail_flag}"
+      exit_code=1
+  else
+      exit_info="${done_flag}"
+      exit_code=0
+  fi
+
+  echo ""
+  genhtml -q -o "${lcov_output}" "${lcov_info}"
+  lcov --summary "${lcov_info}"
+  echo -e "  tests......: TOTAL ${test}, DONE ${done}, FAIL ${fail}, SKIP ${skip}"
+  echo -e "  exit.......: CODE ${exit_code}, ${exit_info}"
+  exit ${exit_code}
 }
 
 ##
@@ -242,22 +253,25 @@ lcov_test_wait() {
 #
 ##
 lcov_run_step () {
-    rm -f ${lcov_output}/test.lock
-    return 0
+  rm -f ${lcov_output}/test.lock
+  return 0
 }
 
 ##
 # Store running tests stat.
 ##
 lcov_run_stat () {
-    stat="0 "
-    [[ -f "${lcov_output}/test.stat" ]] && stat+="$(cat "${lcov_output}/test.stat")"
-    test=$(expr $(echo ${stat} | cut -d' ' -f2) + $1 || true)
-    done=$(expr $(echo ${stat} | cut -d' ' -f3) + $2 || true)
-    fail=$(expr $(echo ${stat} | cut -d' ' -f4) + $3 || true)
-    skip=$(expr $(echo ${stat} | cut -d' ' -f5) + $4 || true)
-    echo "${test} ${done} ${fail} ${skip}" > "${lcov_output}/test.stat"
-    return 0
+  stat="0 "
+  [[ -f "${lcov_test_stat}" ]] && stat+="$(cat "${lcov_test_stat}")"
+
+  test=$(expr $(echo ${stat} | cut -d' ' -f2) + $1 || true)
+  done=$(expr $(echo ${stat} | cut -d' ' -f3) + $2 || true)
+  fail=$(expr $(echo ${stat} | cut -d' ' -f4) + $3 || true)
+  skip=$(expr $(echo ${stat} | cut -d' ' -f5) + $4 || true)
+
+  echo "${test} ${done} ${fail} ${skip}" > "${lcov_test_stat}"
+
+  return 0
 }
 
 ##
@@ -380,44 +394,34 @@ lcov_bats_run() {
   set "-$flags"
 }
 
-##
-#
-#
-##
-lcov_redirect_log() {
-    while read log; do
-        echo "---  $log"
-        echo ">>>  $log" >> log.log
-    done
-}
-
 ##
 # Entry-point
 ##
 main() {
-    if [[ -z "$(command -v lcov)" ]]; then
-        echo "lcov.sh: missing 'lcov' command on your system. (try: sudo apt install lcov)" >&2
-        exit 1
-    fi
+  if [[ -z "$(command -v lcov)" ]]; then
+    echo "lcov.sh: missing 'lcov' command on your system. (try: sudo apt install lcov)" >&2
+    exit 1
+  fi
 
-    if [[ -z "$1" ]]; then
-        echo "lcov.sh: missing file to test as test case. (try: lcov.sh test/*-test.sh)" >&2
-        exit 1
-    fi
+  if [[ -z "$1" ]]; then
+    echo "lcov.sh: missing file to test as test case. (try: lcov.sh test/*-test.sh)" >&2
+    exit 1
+  fi
 
-    lcov_init "${coverage[@]}"
+  lcov_init "${lcov_coverage[@]}"
 
-    for test in "$@"; do
-        lcov_test "$test"
-    done
+  for test in "$@"; do
+    lcov_test "${test}"
+  done
 
-    lcov_done
+  lcov_done
 }
 
 ## Bypass entry-point if file was sourced
+## than expose LCOV.SH and BATS functions
 if [[ "${BASH_SOURCE[0]}" != "${0}" ]]; then
-    export -f run
+  export -f run
 else
-    main "$@"
-    exit "$?"
+  main "$@"
+  exit "$?"
 fi
diff --git a/test/bats/test1.bats b/test/bats/test1.bats
index 4887ffc..994df8d 100644
--- a/test/bats/test1.bats
+++ b/test/bats/test1.bats
@@ -1,6 +1,7 @@
 
 load test1.sh
 load ../../lcov.sh
+#load node_modules/.bin/lcov.sh
 
 @test "testing: test1_func1()" {
     run test1_func1

From c2fa0023e74fa09a29992ccc89e7ddf4775a23f1 Mon Sep 17 00:00:00 2001
From: Francesco Bianco <info.francescobianco@gmail.com>
Date: Mon, 12 Oct 2020 18:08:50 +0200
Subject: [PATCH 09/32] fix missing lcov command

---
 demo.sh |   9 ++++
 lcov.sh | 146 ++++++++++++++++++++++++++++++++------------------------
 2 files changed, 92 insertions(+), 63 deletions(-)
 create mode 100644 demo.sh

diff --git a/demo.sh b/demo.sh
new file mode 100644
index 0000000..d9aa5cf
--- /dev/null
+++ b/demo.sh
@@ -0,0 +1,9 @@
+#!/usr/bin/env bash
+
+if [[ -f deps ]]; then
+  echo "A"
+elif [[ -d deps ]]; then
+  echo "B"
+else
+  echo "C"
+fi
diff --git a/lcov.sh b/lcov.sh
index dd5eb04..9d021de 100755
--- a/lcov.sh
+++ b/lcov.sh
@@ -65,7 +65,7 @@ esac
 lcov_coverage=()
 lcov_extension=sh
 lcov_output=coverage
-lcov_tmp=.tmp
+lcov_temp_dir=$(mktemp -d -t lcov-sh-XXXXXXXXXXXX)
 if [[ -z "LCOV_DEBUG_NO_COLOR" ]]; then
   skip_flag="${escape}[37m(skip)${escape}[0m"
   done_flag="${escape}[1m${escape}[32m(done)${escape}[0m"
@@ -244,15 +244,15 @@ lcov_done() {
 #
 ##
 lcov_test_wait() {
-  while [[ -f ${lcov_output}/test.lock ]]; do sleep 2; done;
-  touch ${lcov_output}/test.lock
+  while [[ -f "${lcov_test_lock}" ]]; do sleep 2; done
+  touch "${lcov_test_lock}"
   return 0
 }
 
 ##
 #
 ##
-lcov_run_step () {
+lcov_test_next() {
   rm -f ${lcov_output}/test.lock
   return 0
 }
@@ -260,94 +260,110 @@ lcov_run_step () {
 ##
 # Store running tests stat.
 ##
-lcov_run_stat () {
-  stat="0 "
+lcov_test_stat () {
+  local stat="0 "
   [[ -f "${lcov_test_stat}" ]] && stat+="$(cat "${lcov_test_stat}")"
 
-  test=$(expr $(echo ${stat} | cut -d' ' -f2) + $1 || true)
-  done=$(expr $(echo ${stat} | cut -d' ' -f3) + $2 || true)
-  fail=$(expr $(echo ${stat} | cut -d' ' -f4) + $3 || true)
-  skip=$(expr $(echo ${stat} | cut -d' ' -f5) + $4 || true)
+  local test=$(expr $(echo ${stat} | cut -d' ' -f2) + $1 || true)
+  local done=$(expr $(echo ${stat} | cut -d' ' -f3) + $2 || true)
+  local fail=$(expr $(echo ${stat} | cut -d' ' -f4) + $3 || true)
+  local skip=$(expr $(echo ${stat} | cut -d' ' -f5) + $4 || true)
 
   echo "${test} ${done} ${fail} ${skip}" > "${lcov_test_stat}"
 
   return 0
 }
 
+##
+# Execute testcase and process LCOV info.
+##
+lcov_test() {
+  if [[ -n "$1" ]]; then
+    lcov_test_wait
+    echo -n "  > "
+    if [[ -f "$1" ]]; then
+      lcov_test_debug "$1" "${lcov_output}/test.log" "${lcov_output}/test.out"
+      lcov_test_check "$?"
+    else
+      if [[ -d "$1" ]]; then
+        echo -e "${skip_flag} $1/: is directory.";
+      else
+        echo -e "${skip_flag} $1: file not found.";
+      fi
+      shift
+      lcov_test_next
+      lcov_test_stat 1 0 0 1
+      lcov_test "$@"
+    fi
+  fi
+  return 0
+}
+
+##
+# $1 - Test file
+# $2 - Log file
+# $3 - Output file
+##
+lcov_test_debug () {
+  local orig_ps4="${PS4}"
+  local orig_lcov_debug="${LCOV_DEBUG}"
+  local log_file=${lcov_tmp}/run.log
+
+  export LCOV_DEBUG=1
+  export PS4="${LCOV_PS4}"
+
+  ## Execute test as bash script and capture output and logs
+  bash -x "$1" > "$3" 2> "$2" && true
+
+  export LCOV_DEBUG="${orig_lcov_debug}"
+  export PS4="${orig_ps4}"
+}
+
 ##
 #
 ##
-lcov_test_parse_log() {
-  local exit_code=$1
+lcov_test_check() {
+  local exit_code="$1"
+
   if [[ ${exit_code} -eq 0 ]]; then
-    lcov_process_log "${lcov_output}/test.log" "${lcov_output}/test.info" "${lcov_output}/test.out"
+    lcov_append_info "${lcov_output}/test.log" "${lcov_output}/test.out"
   else
-    info="$(grep "." "${lcov_output}/test.out" | tail -1)"
+    local info="$(grep "." "${lcov_output}/test.out" | tail -1)"
     [[ -z "${info}" ]] && info="$(grep "." "${lcov_output}/test.log" | tail -1)"
     echo -e "${fail_flag} $1: '${info}' (exit ${exit_code})"
-    shift; lcov_run_stat 1 0 1 0; lcov_run_step; lcov_test "$@"
+    shift
+    lcov_test_stat 1 0 1 0
+    lcov_test_next
+    lcov_test "$@"
   fi
 }
 
 ##
 # $1 - Log file
-# $2 - Info file
-# $3 - Output file
+# $2 - Output file
 ##
-lcov_process_log() {
-  local file_stop=$(get_uuid)
-  echo "${file_stop}" >> $1
+lcov_append_info() {
+  local line_stop=$(get_uuid)
+
+  rm -f ${lcov_output}/test.info
+  echo "${line_stop}" >> "$1"
   while IFS= read line || [[ -n "${line}" ]]; do
     if [[ "${line::1}" = "+" ]]; then
       file=$(echo ${line} | cut -s -d':' -f2)
       lineno=$(echo ${line} | cut -s -d':' -f3)
-      echo -e "TN:\nSF:${file}\nDA:${lineno},1\nend_of_record" >> $2
-    elif [[ "${line}" = "${file_stop}" ]]; then
-      info=$(grep . $3 | tail -1)
-      echo -e "${done_flag} $1: '${info}' (ok)";
+      echo -e "TN:\nSF:${file}\nDA:${lineno},1\nend_of_record" >> ${lcov_output}/test.info
+    elif [[ "${line}" = "${line_stop}" ]]; then
+      if [[ -n "$2" ]]; then
+        local info=$(grep . $2 | tail -1)
+        echo -e "${done_flag} $1: '${info}' (ok)";
+      fi
       lcov -q -a ${lcov_output}/test.info -a ${lcov_output}/lcov.info -o ${lcov_output}/lcov.info && true
-      shift; lcov_run_stat 1 1 0 0; lcov_run_step; lcov_test "$@"
-    fi
-  done < "${lcov_output}/test.log"
-}
-
-
-##
-# Execute testcase and process LCOV info.
-##
-lcov_test() {
-  if [[ -n "$1" ]]; then
-    lcov_test_wait
-    echo -n "  > "
-    if [[ -d "$1" ]]; then
-      echo -e "${skip_flag} $1/: is directory.";
-      shift
-      lcov_test_stat 1 0 0 1
-      lcov_test_step
-      lcov_test "$@"
-    elif [[ -f "$1" ]]; then
-      rm -f ${lcov_output}/test.info
-      lcov_bash_debug $1
-      lcov_test_parse_log $?
-    else
-      echo -e "${skip_flag} $1: file not found.";
       shift
-      lcov_test_stat 1 0 0 1
-      lcov_test_step
+      lcov_test_stat 1 1 0 0
+      lcov_test_next
       lcov_test "$@"
     fi
-  fi
-  return 0
-}
-
-##
-#
-##
-lcov_bash_debug () {
-  export LCOV_DEBUG=1
-  export PS4="${LCOV_PS4}"
-  bash -x $1 >${lcov_output}/test.out 2>${lcov_output}/test.log && true
-  export LCOV_DEBUG=
+  done < "$1"
 }
 
 ##
@@ -358,10 +374,14 @@ run () {
   local orig_ps4="${PS4}"
   local orig_lcov_debug="${LCOV_DEBUG}"
   local log_file=${lcov_tmp}/run.log
+
   rm -f "${log_file}"
+
   export LCOV_DEBUG=1
   export PS4="${LCOV_PS4}"
+
   lcov_bats_run "${@}" 2> ${log_file}
+
   export LCOV_DEBUG="${orig_lcov_debug}"
   export PS4="${orig_ps4}"
 }

From 695879c2d9830555dcd2a75037ee92e6dac7f3f0 Mon Sep 17 00:00:00 2001
From: Francesco Bianco <info.francescobianco@gmail.com>
Date: Mon, 12 Oct 2020 18:57:17 +0200
Subject: [PATCH 10/32] fix missing lcov command

---
 .gitignore   |    1 +
 .tmp/run.log |  122 -----
 a.txt        | 1472 +++++++++++++++++++++++++++++++++++++++++++++++++-
 a1.txt       |    1 +
 lcov.sh      |   51 +-
 5 files changed, 1508 insertions(+), 139 deletions(-)
 delete mode 100644 .tmp/run.log
 create mode 100644 a1.txt

diff --git a/.gitignore b/.gitignore
index 38a0763..8b135b0 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,5 +1,6 @@
 .idea/
 .vscode/
+.tmp/
 coverage/
 !examples/*/coverage/
 deps/
diff --git a/.tmp/run.log b/.tmp/run.log
deleted file mode 100644
index fd67436..0000000
--- a/.tmp/run.log
+++ /dev/null
@@ -1,122 +0,0 @@
-++:LCOV_DEBUG:/home/francesco/Develop/Javanile/lcov.sh/test/bats/../../lcov.sh:377:lcov_bats_run: bats_debug_trap /home/francesco/Develop/Javanile/lcov.sh/test/bats/../../lcov.sh
-++:LCOV_DEBUG:/usr/local/lib/bats-core/tracing.bash:122:bats_debug_trap: [[ /home/francesco/Develop/Javanile/lcov.sh/test/bats/../../lcov.sh != /usr/local/lib/* ]]
-++:LCOV_DEBUG:/usr/local/lib/bats-core/tracing.bash:122:bats_debug_trap: [[ /home/francesco/Develop/Javanile/lcov.sh/test/bats/../../lcov.sh != /usr/local/libexec/* ]]
-++:LCOV_DEBUG:/usr/local/lib/bats-core/tracing.bash:128:bats_debug_trap: BATS_CURRENT_STACK_TRACE=("${BATS_STACK_TRACE[@]+"${BATS_STACK_TRACE[@]}"}")
-++:LCOV_DEBUG:/usr/local/lib/bats-core/tracing.bash:129:bats_debug_trap: bats_capture_stack_trace
-++:LCOV_DEBUG:/usr/local/lib/bats-core/tracing.bash:4:bats_capture_stack_trace: local test_file
-++:LCOV_DEBUG:/usr/local/lib/bats-core/tracing.bash:5:bats_capture_stack_trace: local funcname
-++:LCOV_DEBUG:/usr/local/lib/bats-core/tracing.bash:6:bats_capture_stack_trace: local i
-++:LCOV_DEBUG:/usr/local/lib/bats-core/tracing.bash:8:bats_capture_stack_trace: BATS_STACK_TRACE=()
-++:LCOV_DEBUG:/usr/local/lib/bats-core/tracing.bash:10:bats_capture_stack_trace: (( i = 2 ))
-++:LCOV_DEBUG:/usr/local/lib/bats-core/tracing.bash:10:bats_capture_stack_trace: (( i != 7 ))
-++:LCOV_DEBUG:/usr/local/lib/bats-core/tracing.bash:13:bats_capture_stack_trace: test_file=/home/francesco/Develop/Javanile/lcov.sh/test/bats/../../lcov.sh
-++:LCOV_DEBUG:/usr/local/lib/bats-core/tracing.bash:14:bats_capture_stack_trace: funcname=lcov_bats_run
-++:LCOV_DEBUG:/usr/local/lib/bats-core/tracing.bash:15:bats_capture_stack_trace: BATS_STACK_TRACE+=("${BASH_LINENO[$((i - 1))]} $funcname $test_file")
-++:LCOV_DEBUG:/usr/local/lib/bats-core/tracing.bash:16:bats_capture_stack_trace: [[ /home/francesco/Develop/Javanile/lcov.sh/test/bats/../../lcov.sh == \/\t\m\p\/\b\a\t\s\-\r\u\n\-\2\7\8\1\4\/\b\a\t\s\.\2\7\8\6\1\.\s\r\c ]]
-++:LCOV_DEBUG:/usr/local/lib/bats-core/tracing.bash:10:bats_capture_stack_trace: (( ++i ))
-++:LCOV_DEBUG:/usr/local/lib/bats-core/tracing.bash:10:bats_capture_stack_trace: (( i != 7 ))
-++:LCOV_DEBUG:/usr/local/lib/bats-core/tracing.bash:13:bats_capture_stack_trace: test_file=/home/francesco/Develop/Javanile/lcov.sh/test/bats/../../lcov.sh
-++:LCOV_DEBUG:/usr/local/lib/bats-core/tracing.bash:14:bats_capture_stack_trace: funcname=run
-++:LCOV_DEBUG:/usr/local/lib/bats-core/tracing.bash:15:bats_capture_stack_trace: BATS_STACK_TRACE+=("${BASH_LINENO[$((i - 1))]} $funcname $test_file")
-++:LCOV_DEBUG:/usr/local/lib/bats-core/tracing.bash:16:bats_capture_stack_trace: [[ /home/francesco/Develop/Javanile/lcov.sh/test/bats/../../lcov.sh == \/\t\m\p\/\b\a\t\s\-\r\u\n\-\2\7\8\1\4\/\b\a\t\s\.\2\7\8\6\1\.\s\r\c ]]
-++:LCOV_DEBUG:/usr/local/lib/bats-core/tracing.bash:10:bats_capture_stack_trace: (( ++i ))
-++:LCOV_DEBUG:/usr/local/lib/bats-core/tracing.bash:10:bats_capture_stack_trace: (( i != 7 ))
-++:LCOV_DEBUG:/usr/local/lib/bats-core/tracing.bash:13:bats_capture_stack_trace: test_file=/tmp/bats-run-27814/bats.27861.src
-++:LCOV_DEBUG:/usr/local/lib/bats-core/tracing.bash:14:bats_capture_stack_trace: funcname=test_testing-3a_test1-5ffunc2-28-29
-++:LCOV_DEBUG:/usr/local/lib/bats-core/tracing.bash:15:bats_capture_stack_trace: BATS_STACK_TRACE+=("${BASH_LINENO[$((i - 1))]} $funcname $test_file")
-++:LCOV_DEBUG:/usr/local/lib/bats-core/tracing.bash:16:bats_capture_stack_trace: [[ /tmp/bats-run-27814/bats.27861.src == \/\t\m\p\/\b\a\t\s\-\r\u\n\-\2\7\8\1\4\/\b\a\t\s\.\2\7\8\6\1\.\s\r\c ]]
-++:LCOV_DEBUG:/usr/local/lib/bats-core/tracing.bash:17:bats_capture_stack_trace: case "$funcname" in
-++:LCOV_DEBUG:/usr/local/lib/bats-core/tracing.bash:19:bats_capture_stack_trace: break
-++:LCOV_DEBUG:/home/francesco/Develop/Javanile/lcov.sh/test/bats/../../lcov.sh:377:lcov_bats_run: test1_func1
-++:LCOV_DEBUG:/home/francesco/Develop/Javanile/lcov.sh/test/bats/test1.sh:6:test1_func1: echo -n TEST1_FUNC1
-+:LCOV_DEBUG:/home/francesco/Develop/Javanile/lcov.sh/test/bats/../../lcov.sh:377:lcov_bats_run: output=TEST1_FUNC1
-++:LCOV_DEBUG:/home/francesco/Develop/Javanile/lcov.sh/test/bats/../../lcov.sh:378:lcov_bats_run: bats_debug_trap /home/francesco/Develop/Javanile/lcov.sh/test/bats/../../lcov.sh
-++:LCOV_DEBUG:/usr/local/lib/bats-core/tracing.bash:122:bats_debug_trap: [[ /home/francesco/Develop/Javanile/lcov.sh/test/bats/../../lcov.sh != /usr/local/lib/* ]]
-++:LCOV_DEBUG:/usr/local/lib/bats-core/tracing.bash:122:bats_debug_trap: [[ /home/francesco/Develop/Javanile/lcov.sh/test/bats/../../lcov.sh != /usr/local/libexec/* ]]
-++:LCOV_DEBUG:/usr/local/lib/bats-core/tracing.bash:128:bats_debug_trap: BATS_CURRENT_STACK_TRACE=("${BATS_STACK_TRACE[@]+"${BATS_STACK_TRACE[@]}"}")
-++:LCOV_DEBUG:/usr/local/lib/bats-core/tracing.bash:129:bats_debug_trap: bats_capture_stack_trace
-++:LCOV_DEBUG:/usr/local/lib/bats-core/tracing.bash:4:bats_capture_stack_trace: local test_file
-++:LCOV_DEBUG:/usr/local/lib/bats-core/tracing.bash:5:bats_capture_stack_trace: local funcname
-++:LCOV_DEBUG:/usr/local/lib/bats-core/tracing.bash:6:bats_capture_stack_trace: local i
-++:LCOV_DEBUG:/usr/local/lib/bats-core/tracing.bash:8:bats_capture_stack_trace: BATS_STACK_TRACE=()
-++:LCOV_DEBUG:/usr/local/lib/bats-core/tracing.bash:10:bats_capture_stack_trace: (( i = 2 ))
-++:LCOV_DEBUG:/usr/local/lib/bats-core/tracing.bash:10:bats_capture_stack_trace: (( i != 7 ))
-++:LCOV_DEBUG:/usr/local/lib/bats-core/tracing.bash:13:bats_capture_stack_trace: test_file=/home/francesco/Develop/Javanile/lcov.sh/test/bats/../../lcov.sh
-++:LCOV_DEBUG:/usr/local/lib/bats-core/tracing.bash:14:bats_capture_stack_trace: funcname=lcov_bats_run
-++:LCOV_DEBUG:/usr/local/lib/bats-core/tracing.bash:15:bats_capture_stack_trace: BATS_STACK_TRACE+=("${BASH_LINENO[$((i - 1))]} $funcname $test_file")
-++:LCOV_DEBUG:/usr/local/lib/bats-core/tracing.bash:16:bats_capture_stack_trace: [[ /home/francesco/Develop/Javanile/lcov.sh/test/bats/../../lcov.sh == \/\t\m\p\/\b\a\t\s\-\r\u\n\-\2\7\8\1\4\/\b\a\t\s\.\2\7\8\6\1\.\s\r\c ]]
-++:LCOV_DEBUG:/usr/local/lib/bats-core/tracing.bash:10:bats_capture_stack_trace: (( ++i ))
-++:LCOV_DEBUG:/usr/local/lib/bats-core/tracing.bash:10:bats_capture_stack_trace: (( i != 7 ))
-++:LCOV_DEBUG:/usr/local/lib/bats-core/tracing.bash:13:bats_capture_stack_trace: test_file=/home/francesco/Develop/Javanile/lcov.sh/test/bats/../../lcov.sh
-++:LCOV_DEBUG:/usr/local/lib/bats-core/tracing.bash:14:bats_capture_stack_trace: funcname=run
-++:LCOV_DEBUG:/usr/local/lib/bats-core/tracing.bash:15:bats_capture_stack_trace: BATS_STACK_TRACE+=("${BASH_LINENO[$((i - 1))]} $funcname $test_file")
-++:LCOV_DEBUG:/usr/local/lib/bats-core/tracing.bash:16:bats_capture_stack_trace: [[ /home/francesco/Develop/Javanile/lcov.sh/test/bats/../../lcov.sh == \/\t\m\p\/\b\a\t\s\-\r\u\n\-\2\7\8\1\4\/\b\a\t\s\.\2\7\8\6\1\.\s\r\c ]]
-++:LCOV_DEBUG:/usr/local/lib/bats-core/tracing.bash:10:bats_capture_stack_trace: (( ++i ))
-++:LCOV_DEBUG:/usr/local/lib/bats-core/tracing.bash:10:bats_capture_stack_trace: (( i != 7 ))
-++:LCOV_DEBUG:/usr/local/lib/bats-core/tracing.bash:13:bats_capture_stack_trace: test_file=/tmp/bats-run-27814/bats.27861.src
-++:LCOV_DEBUG:/usr/local/lib/bats-core/tracing.bash:14:bats_capture_stack_trace: funcname=test_testing-3a_test1-5ffunc2-28-29
-++:LCOV_DEBUG:/usr/local/lib/bats-core/tracing.bash:15:bats_capture_stack_trace: BATS_STACK_TRACE+=("${BASH_LINENO[$((i - 1))]} $funcname $test_file")
-++:LCOV_DEBUG:/usr/local/lib/bats-core/tracing.bash:16:bats_capture_stack_trace: [[ /tmp/bats-run-27814/bats.27861.src == \/\t\m\p\/\b\a\t\s\-\r\u\n\-\2\7\8\1\4\/\b\a\t\s\.\2\7\8\6\1\.\s\r\c ]]
-++:LCOV_DEBUG:/usr/local/lib/bats-core/tracing.bash:17:bats_capture_stack_trace: case "$funcname" in
-++:LCOV_DEBUG:/usr/local/lib/bats-core/tracing.bash:19:bats_capture_stack_trace: break
-+:LCOV_DEBUG:/home/francesco/Develop/Javanile/lcov.sh/test/bats/../../lcov.sh:378:lcov_bats_run: status=0
-++:LCOV_DEBUG:/home/francesco/Develop/Javanile/lcov.sh/test/bats/../../lcov.sh:379:lcov_bats_run: bats_debug_trap /home/francesco/Develop/Javanile/lcov.sh/test/bats/../../lcov.sh
-++:LCOV_DEBUG:/usr/local/lib/bats-core/tracing.bash:122:bats_debug_trap: [[ /home/francesco/Develop/Javanile/lcov.sh/test/bats/../../lcov.sh != /usr/local/lib/* ]]
-++:LCOV_DEBUG:/usr/local/lib/bats-core/tracing.bash:122:bats_debug_trap: [[ /home/francesco/Develop/Javanile/lcov.sh/test/bats/../../lcov.sh != /usr/local/libexec/* ]]
-++:LCOV_DEBUG:/usr/local/lib/bats-core/tracing.bash:128:bats_debug_trap: BATS_CURRENT_STACK_TRACE=("${BATS_STACK_TRACE[@]+"${BATS_STACK_TRACE[@]}"}")
-++:LCOV_DEBUG:/usr/local/lib/bats-core/tracing.bash:129:bats_debug_trap: bats_capture_stack_trace
-++:LCOV_DEBUG:/usr/local/lib/bats-core/tracing.bash:4:bats_capture_stack_trace: local test_file
-++:LCOV_DEBUG:/usr/local/lib/bats-core/tracing.bash:5:bats_capture_stack_trace: local funcname
-++:LCOV_DEBUG:/usr/local/lib/bats-core/tracing.bash:6:bats_capture_stack_trace: local i
-++:LCOV_DEBUG:/usr/local/lib/bats-core/tracing.bash:8:bats_capture_stack_trace: BATS_STACK_TRACE=()
-++:LCOV_DEBUG:/usr/local/lib/bats-core/tracing.bash:10:bats_capture_stack_trace: (( i = 2 ))
-++:LCOV_DEBUG:/usr/local/lib/bats-core/tracing.bash:10:bats_capture_stack_trace: (( i != 7 ))
-++:LCOV_DEBUG:/usr/local/lib/bats-core/tracing.bash:13:bats_capture_stack_trace: test_file=/home/francesco/Develop/Javanile/lcov.sh/test/bats/../../lcov.sh
-++:LCOV_DEBUG:/usr/local/lib/bats-core/tracing.bash:14:bats_capture_stack_trace: funcname=lcov_bats_run
-++:LCOV_DEBUG:/usr/local/lib/bats-core/tracing.bash:15:bats_capture_stack_trace: BATS_STACK_TRACE+=("${BASH_LINENO[$((i - 1))]} $funcname $test_file")
-++:LCOV_DEBUG:/usr/local/lib/bats-core/tracing.bash:16:bats_capture_stack_trace: [[ /home/francesco/Develop/Javanile/lcov.sh/test/bats/../../lcov.sh == \/\t\m\p\/\b\a\t\s\-\r\u\n\-\2\7\8\1\4\/\b\a\t\s\.\2\7\8\6\1\.\s\r\c ]]
-++:LCOV_DEBUG:/usr/local/lib/bats-core/tracing.bash:10:bats_capture_stack_trace: (( ++i ))
-++:LCOV_DEBUG:/usr/local/lib/bats-core/tracing.bash:10:bats_capture_stack_trace: (( i != 7 ))
-++:LCOV_DEBUG:/usr/local/lib/bats-core/tracing.bash:13:bats_capture_stack_trace: test_file=/home/francesco/Develop/Javanile/lcov.sh/test/bats/../../lcov.sh
-++:LCOV_DEBUG:/usr/local/lib/bats-core/tracing.bash:14:bats_capture_stack_trace: funcname=run
-++:LCOV_DEBUG:/usr/local/lib/bats-core/tracing.bash:15:bats_capture_stack_trace: BATS_STACK_TRACE+=("${BASH_LINENO[$((i - 1))]} $funcname $test_file")
-++:LCOV_DEBUG:/usr/local/lib/bats-core/tracing.bash:16:bats_capture_stack_trace: [[ /home/francesco/Develop/Javanile/lcov.sh/test/bats/../../lcov.sh == \/\t\m\p\/\b\a\t\s\-\r\u\n\-\2\7\8\1\4\/\b\a\t\s\.\2\7\8\6\1\.\s\r\c ]]
-++:LCOV_DEBUG:/usr/local/lib/bats-core/tracing.bash:10:bats_capture_stack_trace: (( ++i ))
-++:LCOV_DEBUG:/usr/local/lib/bats-core/tracing.bash:10:bats_capture_stack_trace: (( i != 7 ))
-++:LCOV_DEBUG:/usr/local/lib/bats-core/tracing.bash:13:bats_capture_stack_trace: test_file=/tmp/bats-run-27814/bats.27861.src
-++:LCOV_DEBUG:/usr/local/lib/bats-core/tracing.bash:14:bats_capture_stack_trace: funcname=test_testing-3a_test1-5ffunc2-28-29
-++:LCOV_DEBUG:/usr/local/lib/bats-core/tracing.bash:15:bats_capture_stack_trace: BATS_STACK_TRACE+=("${BASH_LINENO[$((i - 1))]} $funcname $test_file")
-++:LCOV_DEBUG:/usr/local/lib/bats-core/tracing.bash:16:bats_capture_stack_trace: [[ /tmp/bats-run-27814/bats.27861.src == \/\t\m\p\/\b\a\t\s\-\r\u\n\-\2\7\8\1\4\/\b\a\t\s\.\2\7\8\6\1\.\s\r\c ]]
-++:LCOV_DEBUG:/usr/local/lib/bats-core/tracing.bash:17:bats_capture_stack_trace: case "$funcname" in
-++:LCOV_DEBUG:/usr/local/lib/bats-core/tracing.bash:19:bats_capture_stack_trace: break
-+:LCOV_DEBUG:/home/francesco/Develop/Javanile/lcov.sh/test/bats/../../lcov.sh:379:lcov_bats_run: [[ efhBET =~ x ]]
-++:LCOV_DEBUG:/home/francesco/Develop/Javanile/lcov.sh/test/bats/../../lcov.sh:379:lcov_bats_run: bats_debug_trap /home/francesco/Develop/Javanile/lcov.sh/test/bats/../../lcov.sh
-++:LCOV_DEBUG:/usr/local/lib/bats-core/tracing.bash:122:bats_debug_trap: [[ /home/francesco/Develop/Javanile/lcov.sh/test/bats/../../lcov.sh != /usr/local/lib/* ]]
-++:LCOV_DEBUG:/usr/local/lib/bats-core/tracing.bash:122:bats_debug_trap: [[ /home/francesco/Develop/Javanile/lcov.sh/test/bats/../../lcov.sh != /usr/local/libexec/* ]]
-++:LCOV_DEBUG:/usr/local/lib/bats-core/tracing.bash:128:bats_debug_trap: BATS_CURRENT_STACK_TRACE=("${BATS_STACK_TRACE[@]+"${BATS_STACK_TRACE[@]}"}")
-++:LCOV_DEBUG:/usr/local/lib/bats-core/tracing.bash:129:bats_debug_trap: bats_capture_stack_trace
-++:LCOV_DEBUG:/usr/local/lib/bats-core/tracing.bash:4:bats_capture_stack_trace: local test_file
-++:LCOV_DEBUG:/usr/local/lib/bats-core/tracing.bash:5:bats_capture_stack_trace: local funcname
-++:LCOV_DEBUG:/usr/local/lib/bats-core/tracing.bash:6:bats_capture_stack_trace: local i
-++:LCOV_DEBUG:/usr/local/lib/bats-core/tracing.bash:8:bats_capture_stack_trace: BATS_STACK_TRACE=()
-++:LCOV_DEBUG:/usr/local/lib/bats-core/tracing.bash:10:bats_capture_stack_trace: (( i = 2 ))
-++:LCOV_DEBUG:/usr/local/lib/bats-core/tracing.bash:10:bats_capture_stack_trace: (( i != 7 ))
-++:LCOV_DEBUG:/usr/local/lib/bats-core/tracing.bash:13:bats_capture_stack_trace: test_file=/home/francesco/Develop/Javanile/lcov.sh/test/bats/../../lcov.sh
-++:LCOV_DEBUG:/usr/local/lib/bats-core/tracing.bash:14:bats_capture_stack_trace: funcname=lcov_bats_run
-++:LCOV_DEBUG:/usr/local/lib/bats-core/tracing.bash:15:bats_capture_stack_trace: BATS_STACK_TRACE+=("${BASH_LINENO[$((i - 1))]} $funcname $test_file")
-++:LCOV_DEBUG:/usr/local/lib/bats-core/tracing.bash:16:bats_capture_stack_trace: [[ /home/francesco/Develop/Javanile/lcov.sh/test/bats/../../lcov.sh == \/\t\m\p\/\b\a\t\s\-\r\u\n\-\2\7\8\1\4\/\b\a\t\s\.\2\7\8\6\1\.\s\r\c ]]
-++:LCOV_DEBUG:/usr/local/lib/bats-core/tracing.bash:10:bats_capture_stack_trace: (( ++i ))
-++:LCOV_DEBUG:/usr/local/lib/bats-core/tracing.bash:10:bats_capture_stack_trace: (( i != 7 ))
-++:LCOV_DEBUG:/usr/local/lib/bats-core/tracing.bash:13:bats_capture_stack_trace: test_file=/home/francesco/Develop/Javanile/lcov.sh/test/bats/../../lcov.sh
-++:LCOV_DEBUG:/usr/local/lib/bats-core/tracing.bash:14:bats_capture_stack_trace: funcname=run
-++:LCOV_DEBUG:/usr/local/lib/bats-core/tracing.bash:15:bats_capture_stack_trace: BATS_STACK_TRACE+=("${BASH_LINENO[$((i - 1))]} $funcname $test_file")
-++:LCOV_DEBUG:/usr/local/lib/bats-core/tracing.bash:16:bats_capture_stack_trace: [[ /home/francesco/Develop/Javanile/lcov.sh/test/bats/../../lcov.sh == \/\t\m\p\/\b\a\t\s\-\r\u\n\-\2\7\8\1\4\/\b\a\t\s\.\2\7\8\6\1\.\s\r\c ]]
-++:LCOV_DEBUG:/usr/local/lib/bats-core/tracing.bash:10:bats_capture_stack_trace: (( ++i ))
-++:LCOV_DEBUG:/usr/local/lib/bats-core/tracing.bash:10:bats_capture_stack_trace: (( i != 7 ))
-++:LCOV_DEBUG:/usr/local/lib/bats-core/tracing.bash:13:bats_capture_stack_trace: test_file=/tmp/bats-run-27814/bats.27861.src
-++:LCOV_DEBUG:/usr/local/lib/bats-core/tracing.bash:14:bats_capture_stack_trace: funcname=test_testing-3a_test1-5ffunc2-28-29
-++:LCOV_DEBUG:/usr/local/lib/bats-core/tracing.bash:15:bats_capture_stack_trace: BATS_STACK_TRACE+=("${BASH_LINENO[$((i - 1))]} $funcname $test_file")
-++:LCOV_DEBUG:/usr/local/lib/bats-core/tracing.bash:16:bats_capture_stack_trace: [[ /tmp/bats-run-27814/bats.27861.src == \/\t\m\p\/\b\a\t\s\-\r\u\n\-\2\7\8\1\4\/\b\a\t\s\.\2\7\8\6\1\.\s\r\c ]]
-++:LCOV_DEBUG:/usr/local/lib/bats-core/tracing.bash:17:bats_capture_stack_trace: case "$funcname" in
-++:LCOV_DEBUG:/usr/local/lib/bats-core/tracing.bash:19:bats_capture_stack_trace: break
-+:LCOV_DEBUG:/home/francesco/Develop/Javanile/lcov.sh/test/bats/../../lcov.sh:379:lcov_bats_run: set +x
diff --git a/a.txt b/a.txt
index 72107cd..c8e2e40 100644
--- a/a.txt
+++ b/a.txt
@@ -1 +1,1471 @@
-TEST1_FUNC1---  ++:/Users/francesco/Develop/Javanile/lcov.sh/test/bats/test1.sh:7:test1_func1: echo -n TEST1_FUNC1
+/home/francesco/Develop/Javanile/lcov.sh
+find . -type f ( -name *. ) ( -not -wholename coverage -not -path .git )
+find . -type f ( -name *.sh ) ( -not -wholename coverage -not -path .git )
+STOP
+STOP
+TN:
+SF:LCOV_DEBUG
+DA:/home/francesco/Develop/Javanile/lcov.sh/test/bats/../../lcov.sh,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/usr/local/lib/bats-core/tracing.bash,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/usr/local/lib/bats-core/tracing.bash,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/usr/local/lib/bats-core/tracing.bash,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/usr/local/lib/bats-core/tracing.bash,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/usr/local/lib/bats-core/tracing.bash,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/usr/local/lib/bats-core/tracing.bash,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/usr/local/lib/bats-core/tracing.bash,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/usr/local/lib/bats-core/tracing.bash,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/usr/local/lib/bats-core/tracing.bash,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/usr/local/lib/bats-core/tracing.bash,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/usr/local/lib/bats-core/tracing.bash,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/usr/local/lib/bats-core/tracing.bash,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/usr/local/lib/bats-core/tracing.bash,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/usr/local/lib/bats-core/tracing.bash,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/usr/local/lib/bats-core/tracing.bash,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/usr/local/lib/bats-core/tracing.bash,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/usr/local/lib/bats-core/tracing.bash,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/usr/local/lib/bats-core/tracing.bash,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/usr/local/lib/bats-core/tracing.bash,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/usr/local/lib/bats-core/tracing.bash,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/usr/local/lib/bats-core/tracing.bash,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/usr/local/lib/bats-core/tracing.bash,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/usr/local/lib/bats-core/tracing.bash,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/usr/local/lib/bats-core/tracing.bash,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/usr/local/lib/bats-core/tracing.bash,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/usr/local/lib/bats-core/tracing.bash,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/usr/local/lib/bats-core/tracing.bash,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/usr/local/lib/bats-core/tracing.bash,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/home/francesco/Develop/Javanile/lcov.sh/test/bats/../../lcov.sh,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/home/francesco/Develop/Javanile/lcov.sh/test/bats/test1.sh,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/home/francesco/Develop/Javanile/lcov.sh/test/bats/../../lcov.sh,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/home/francesco/Develop/Javanile/lcov.sh/test/bats/../../lcov.sh,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/usr/local/lib/bats-core/tracing.bash,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/usr/local/lib/bats-core/tracing.bash,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/usr/local/lib/bats-core/tracing.bash,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/usr/local/lib/bats-core/tracing.bash,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/usr/local/lib/bats-core/tracing.bash,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/usr/local/lib/bats-core/tracing.bash,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/usr/local/lib/bats-core/tracing.bash,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/usr/local/lib/bats-core/tracing.bash,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/usr/local/lib/bats-core/tracing.bash,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/usr/local/lib/bats-core/tracing.bash,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/usr/local/lib/bats-core/tracing.bash,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/usr/local/lib/bats-core/tracing.bash,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/usr/local/lib/bats-core/tracing.bash,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/usr/local/lib/bats-core/tracing.bash,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/usr/local/lib/bats-core/tracing.bash,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/usr/local/lib/bats-core/tracing.bash,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/usr/local/lib/bats-core/tracing.bash,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/usr/local/lib/bats-core/tracing.bash,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/usr/local/lib/bats-core/tracing.bash,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/usr/local/lib/bats-core/tracing.bash,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/usr/local/lib/bats-core/tracing.bash,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/usr/local/lib/bats-core/tracing.bash,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/usr/local/lib/bats-core/tracing.bash,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/usr/local/lib/bats-core/tracing.bash,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/usr/local/lib/bats-core/tracing.bash,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/usr/local/lib/bats-core/tracing.bash,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/usr/local/lib/bats-core/tracing.bash,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/usr/local/lib/bats-core/tracing.bash,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/home/francesco/Develop/Javanile/lcov.sh/test/bats/../../lcov.sh,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/home/francesco/Develop/Javanile/lcov.sh/test/bats/../../lcov.sh,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/usr/local/lib/bats-core/tracing.bash,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/usr/local/lib/bats-core/tracing.bash,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/usr/local/lib/bats-core/tracing.bash,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/usr/local/lib/bats-core/tracing.bash,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/usr/local/lib/bats-core/tracing.bash,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/usr/local/lib/bats-core/tracing.bash,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/usr/local/lib/bats-core/tracing.bash,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/usr/local/lib/bats-core/tracing.bash,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/usr/local/lib/bats-core/tracing.bash,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/usr/local/lib/bats-core/tracing.bash,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/usr/local/lib/bats-core/tracing.bash,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/usr/local/lib/bats-core/tracing.bash,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/usr/local/lib/bats-core/tracing.bash,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/usr/local/lib/bats-core/tracing.bash,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/usr/local/lib/bats-core/tracing.bash,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/usr/local/lib/bats-core/tracing.bash,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/usr/local/lib/bats-core/tracing.bash,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/usr/local/lib/bats-core/tracing.bash,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/usr/local/lib/bats-core/tracing.bash,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/usr/local/lib/bats-core/tracing.bash,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/usr/local/lib/bats-core/tracing.bash,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/usr/local/lib/bats-core/tracing.bash,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/usr/local/lib/bats-core/tracing.bash,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/usr/local/lib/bats-core/tracing.bash,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/usr/local/lib/bats-core/tracing.bash,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/usr/local/lib/bats-core/tracing.bash,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/usr/local/lib/bats-core/tracing.bash,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/usr/local/lib/bats-core/tracing.bash,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/home/francesco/Develop/Javanile/lcov.sh/test/bats/../../lcov.sh,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/home/francesco/Develop/Javanile/lcov.sh/test/bats/../../lcov.sh,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/usr/local/lib/bats-core/tracing.bash,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/usr/local/lib/bats-core/tracing.bash,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/usr/local/lib/bats-core/tracing.bash,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/usr/local/lib/bats-core/tracing.bash,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/usr/local/lib/bats-core/tracing.bash,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/usr/local/lib/bats-core/tracing.bash,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/usr/local/lib/bats-core/tracing.bash,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/usr/local/lib/bats-core/tracing.bash,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/usr/local/lib/bats-core/tracing.bash,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/usr/local/lib/bats-core/tracing.bash,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/usr/local/lib/bats-core/tracing.bash,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/usr/local/lib/bats-core/tracing.bash,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/usr/local/lib/bats-core/tracing.bash,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/usr/local/lib/bats-core/tracing.bash,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/usr/local/lib/bats-core/tracing.bash,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/usr/local/lib/bats-core/tracing.bash,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/usr/local/lib/bats-core/tracing.bash,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/usr/local/lib/bats-core/tracing.bash,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/usr/local/lib/bats-core/tracing.bash,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/usr/local/lib/bats-core/tracing.bash,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/usr/local/lib/bats-core/tracing.bash,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/usr/local/lib/bats-core/tracing.bash,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/usr/local/lib/bats-core/tracing.bash,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/usr/local/lib/bats-core/tracing.bash,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/usr/local/lib/bats-core/tracing.bash,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/usr/local/lib/bats-core/tracing.bash,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/usr/local/lib/bats-core/tracing.bash,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/usr/local/lib/bats-core/tracing.bash,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/home/francesco/Develop/Javanile/lcov.sh/test/bats/../../lcov.sh,1
+end_of_record
+STOP
+TN:
+SF:LCOV_DEBUG
+DA:/home/francesco/Develop/Javanile/lcov.sh/test/bats/../../lcov.sh,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/usr/local/lib/bats-core/tracing.bash,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/usr/local/lib/bats-core/tracing.bash,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/usr/local/lib/bats-core/tracing.bash,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/usr/local/lib/bats-core/tracing.bash,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/usr/local/lib/bats-core/tracing.bash,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/usr/local/lib/bats-core/tracing.bash,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/usr/local/lib/bats-core/tracing.bash,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/usr/local/lib/bats-core/tracing.bash,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/usr/local/lib/bats-core/tracing.bash,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/usr/local/lib/bats-core/tracing.bash,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/usr/local/lib/bats-core/tracing.bash,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/usr/local/lib/bats-core/tracing.bash,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/usr/local/lib/bats-core/tracing.bash,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/usr/local/lib/bats-core/tracing.bash,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/usr/local/lib/bats-core/tracing.bash,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/usr/local/lib/bats-core/tracing.bash,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/usr/local/lib/bats-core/tracing.bash,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/usr/local/lib/bats-core/tracing.bash,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/usr/local/lib/bats-core/tracing.bash,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/usr/local/lib/bats-core/tracing.bash,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/usr/local/lib/bats-core/tracing.bash,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/usr/local/lib/bats-core/tracing.bash,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/usr/local/lib/bats-core/tracing.bash,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/usr/local/lib/bats-core/tracing.bash,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/usr/local/lib/bats-core/tracing.bash,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/usr/local/lib/bats-core/tracing.bash,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/usr/local/lib/bats-core/tracing.bash,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/usr/local/lib/bats-core/tracing.bash,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/home/francesco/Develop/Javanile/lcov.sh/test/bats/../../lcov.sh,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/home/francesco/Develop/Javanile/lcov.sh/test/bats/test1.sh,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/home/francesco/Develop/Javanile/lcov.sh/test/bats/../../lcov.sh,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/home/francesco/Develop/Javanile/lcov.sh/test/bats/../../lcov.sh,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/usr/local/lib/bats-core/tracing.bash,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/usr/local/lib/bats-core/tracing.bash,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/usr/local/lib/bats-core/tracing.bash,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/usr/local/lib/bats-core/tracing.bash,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/usr/local/lib/bats-core/tracing.bash,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/usr/local/lib/bats-core/tracing.bash,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/usr/local/lib/bats-core/tracing.bash,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/usr/local/lib/bats-core/tracing.bash,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/usr/local/lib/bats-core/tracing.bash,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/usr/local/lib/bats-core/tracing.bash,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/usr/local/lib/bats-core/tracing.bash,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/usr/local/lib/bats-core/tracing.bash,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/usr/local/lib/bats-core/tracing.bash,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/usr/local/lib/bats-core/tracing.bash,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/usr/local/lib/bats-core/tracing.bash,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/usr/local/lib/bats-core/tracing.bash,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/usr/local/lib/bats-core/tracing.bash,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/usr/local/lib/bats-core/tracing.bash,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/usr/local/lib/bats-core/tracing.bash,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/usr/local/lib/bats-core/tracing.bash,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/usr/local/lib/bats-core/tracing.bash,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/usr/local/lib/bats-core/tracing.bash,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/usr/local/lib/bats-core/tracing.bash,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/usr/local/lib/bats-core/tracing.bash,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/usr/local/lib/bats-core/tracing.bash,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/usr/local/lib/bats-core/tracing.bash,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/usr/local/lib/bats-core/tracing.bash,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/usr/local/lib/bats-core/tracing.bash,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/home/francesco/Develop/Javanile/lcov.sh/test/bats/../../lcov.sh,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/home/francesco/Develop/Javanile/lcov.sh/test/bats/../../lcov.sh,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/usr/local/lib/bats-core/tracing.bash,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/usr/local/lib/bats-core/tracing.bash,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/usr/local/lib/bats-core/tracing.bash,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/usr/local/lib/bats-core/tracing.bash,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/usr/local/lib/bats-core/tracing.bash,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/usr/local/lib/bats-core/tracing.bash,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/usr/local/lib/bats-core/tracing.bash,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/usr/local/lib/bats-core/tracing.bash,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/usr/local/lib/bats-core/tracing.bash,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/usr/local/lib/bats-core/tracing.bash,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/usr/local/lib/bats-core/tracing.bash,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/usr/local/lib/bats-core/tracing.bash,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/usr/local/lib/bats-core/tracing.bash,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/usr/local/lib/bats-core/tracing.bash,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/usr/local/lib/bats-core/tracing.bash,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/usr/local/lib/bats-core/tracing.bash,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/usr/local/lib/bats-core/tracing.bash,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/usr/local/lib/bats-core/tracing.bash,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/usr/local/lib/bats-core/tracing.bash,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/usr/local/lib/bats-core/tracing.bash,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/usr/local/lib/bats-core/tracing.bash,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/usr/local/lib/bats-core/tracing.bash,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/usr/local/lib/bats-core/tracing.bash,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/usr/local/lib/bats-core/tracing.bash,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/usr/local/lib/bats-core/tracing.bash,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/usr/local/lib/bats-core/tracing.bash,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/usr/local/lib/bats-core/tracing.bash,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/usr/local/lib/bats-core/tracing.bash,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/home/francesco/Develop/Javanile/lcov.sh/test/bats/../../lcov.sh,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/home/francesco/Develop/Javanile/lcov.sh/test/bats/../../lcov.sh,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/usr/local/lib/bats-core/tracing.bash,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/usr/local/lib/bats-core/tracing.bash,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/usr/local/lib/bats-core/tracing.bash,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/usr/local/lib/bats-core/tracing.bash,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/usr/local/lib/bats-core/tracing.bash,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/usr/local/lib/bats-core/tracing.bash,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/usr/local/lib/bats-core/tracing.bash,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/usr/local/lib/bats-core/tracing.bash,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/usr/local/lib/bats-core/tracing.bash,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/usr/local/lib/bats-core/tracing.bash,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/usr/local/lib/bats-core/tracing.bash,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/usr/local/lib/bats-core/tracing.bash,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/usr/local/lib/bats-core/tracing.bash,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/usr/local/lib/bats-core/tracing.bash,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/usr/local/lib/bats-core/tracing.bash,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/usr/local/lib/bats-core/tracing.bash,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/usr/local/lib/bats-core/tracing.bash,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/usr/local/lib/bats-core/tracing.bash,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/usr/local/lib/bats-core/tracing.bash,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/usr/local/lib/bats-core/tracing.bash,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/usr/local/lib/bats-core/tracing.bash,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/usr/local/lib/bats-core/tracing.bash,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/usr/local/lib/bats-core/tracing.bash,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/usr/local/lib/bats-core/tracing.bash,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/usr/local/lib/bats-core/tracing.bash,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/usr/local/lib/bats-core/tracing.bash,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/usr/local/lib/bats-core/tracing.bash,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/usr/local/lib/bats-core/tracing.bash,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/home/francesco/Develop/Javanile/lcov.sh/test/bats/../../lcov.sh,1
+end_of_record
+STOP
+TN:
+SF:LCOV_DEBUG
+DA:/home/francesco/Develop/Javanile/lcov.sh/test/bats/../../lcov.sh,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/usr/local/lib/bats-core/tracing.bash,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/usr/local/lib/bats-core/tracing.bash,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/usr/local/lib/bats-core/tracing.bash,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/usr/local/lib/bats-core/tracing.bash,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/usr/local/lib/bats-core/tracing.bash,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/usr/local/lib/bats-core/tracing.bash,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/usr/local/lib/bats-core/tracing.bash,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/usr/local/lib/bats-core/tracing.bash,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/usr/local/lib/bats-core/tracing.bash,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/usr/local/lib/bats-core/tracing.bash,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/usr/local/lib/bats-core/tracing.bash,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/usr/local/lib/bats-core/tracing.bash,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/usr/local/lib/bats-core/tracing.bash,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/usr/local/lib/bats-core/tracing.bash,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/usr/local/lib/bats-core/tracing.bash,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/usr/local/lib/bats-core/tracing.bash,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/usr/local/lib/bats-core/tracing.bash,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/usr/local/lib/bats-core/tracing.bash,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/usr/local/lib/bats-core/tracing.bash,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/usr/local/lib/bats-core/tracing.bash,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/usr/local/lib/bats-core/tracing.bash,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/usr/local/lib/bats-core/tracing.bash,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/usr/local/lib/bats-core/tracing.bash,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/usr/local/lib/bats-core/tracing.bash,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/usr/local/lib/bats-core/tracing.bash,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/usr/local/lib/bats-core/tracing.bash,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/usr/local/lib/bats-core/tracing.bash,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/usr/local/lib/bats-core/tracing.bash,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/home/francesco/Develop/Javanile/lcov.sh/test/bats/../../lcov.sh,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/home/francesco/Develop/Javanile/lcov.sh/test/bats/test1.sh,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/home/francesco/Develop/Javanile/lcov.sh/test/bats/../../lcov.sh,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/home/francesco/Develop/Javanile/lcov.sh/test/bats/../../lcov.sh,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/usr/local/lib/bats-core/tracing.bash,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/usr/local/lib/bats-core/tracing.bash,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/usr/local/lib/bats-core/tracing.bash,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/usr/local/lib/bats-core/tracing.bash,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/usr/local/lib/bats-core/tracing.bash,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/usr/local/lib/bats-core/tracing.bash,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/usr/local/lib/bats-core/tracing.bash,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/usr/local/lib/bats-core/tracing.bash,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/usr/local/lib/bats-core/tracing.bash,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/usr/local/lib/bats-core/tracing.bash,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/usr/local/lib/bats-core/tracing.bash,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/usr/local/lib/bats-core/tracing.bash,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/usr/local/lib/bats-core/tracing.bash,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/usr/local/lib/bats-core/tracing.bash,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/usr/local/lib/bats-core/tracing.bash,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/usr/local/lib/bats-core/tracing.bash,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/usr/local/lib/bats-core/tracing.bash,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/usr/local/lib/bats-core/tracing.bash,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/usr/local/lib/bats-core/tracing.bash,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/usr/local/lib/bats-core/tracing.bash,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/usr/local/lib/bats-core/tracing.bash,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/usr/local/lib/bats-core/tracing.bash,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/usr/local/lib/bats-core/tracing.bash,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/usr/local/lib/bats-core/tracing.bash,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/usr/local/lib/bats-core/tracing.bash,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/usr/local/lib/bats-core/tracing.bash,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/usr/local/lib/bats-core/tracing.bash,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/usr/local/lib/bats-core/tracing.bash,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/home/francesco/Develop/Javanile/lcov.sh/test/bats/../../lcov.sh,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/home/francesco/Develop/Javanile/lcov.sh/test/bats/../../lcov.sh,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/usr/local/lib/bats-core/tracing.bash,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/usr/local/lib/bats-core/tracing.bash,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/usr/local/lib/bats-core/tracing.bash,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/usr/local/lib/bats-core/tracing.bash,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/usr/local/lib/bats-core/tracing.bash,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/usr/local/lib/bats-core/tracing.bash,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/usr/local/lib/bats-core/tracing.bash,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/usr/local/lib/bats-core/tracing.bash,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/usr/local/lib/bats-core/tracing.bash,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/usr/local/lib/bats-core/tracing.bash,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/usr/local/lib/bats-core/tracing.bash,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/usr/local/lib/bats-core/tracing.bash,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/usr/local/lib/bats-core/tracing.bash,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/usr/local/lib/bats-core/tracing.bash,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/usr/local/lib/bats-core/tracing.bash,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/usr/local/lib/bats-core/tracing.bash,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/usr/local/lib/bats-core/tracing.bash,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/usr/local/lib/bats-core/tracing.bash,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/usr/local/lib/bats-core/tracing.bash,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/usr/local/lib/bats-core/tracing.bash,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/usr/local/lib/bats-core/tracing.bash,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/usr/local/lib/bats-core/tracing.bash,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/usr/local/lib/bats-core/tracing.bash,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/usr/local/lib/bats-core/tracing.bash,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/usr/local/lib/bats-core/tracing.bash,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/usr/local/lib/bats-core/tracing.bash,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/usr/local/lib/bats-core/tracing.bash,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/usr/local/lib/bats-core/tracing.bash,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/home/francesco/Develop/Javanile/lcov.sh/test/bats/../../lcov.sh,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/home/francesco/Develop/Javanile/lcov.sh/test/bats/../../lcov.sh,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/usr/local/lib/bats-core/tracing.bash,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/usr/local/lib/bats-core/tracing.bash,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/usr/local/lib/bats-core/tracing.bash,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/usr/local/lib/bats-core/tracing.bash,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/usr/local/lib/bats-core/tracing.bash,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/usr/local/lib/bats-core/tracing.bash,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/usr/local/lib/bats-core/tracing.bash,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/usr/local/lib/bats-core/tracing.bash,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/usr/local/lib/bats-core/tracing.bash,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/usr/local/lib/bats-core/tracing.bash,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/usr/local/lib/bats-core/tracing.bash,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/usr/local/lib/bats-core/tracing.bash,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/usr/local/lib/bats-core/tracing.bash,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/usr/local/lib/bats-core/tracing.bash,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/usr/local/lib/bats-core/tracing.bash,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/usr/local/lib/bats-core/tracing.bash,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/usr/local/lib/bats-core/tracing.bash,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/usr/local/lib/bats-core/tracing.bash,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/usr/local/lib/bats-core/tracing.bash,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/usr/local/lib/bats-core/tracing.bash,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/usr/local/lib/bats-core/tracing.bash,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/usr/local/lib/bats-core/tracing.bash,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/usr/local/lib/bats-core/tracing.bash,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/usr/local/lib/bats-core/tracing.bash,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/usr/local/lib/bats-core/tracing.bash,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/usr/local/lib/bats-core/tracing.bash,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/usr/local/lib/bats-core/tracing.bash,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/usr/local/lib/bats-core/tracing.bash,1
+end_of_record
+TN:
+SF:LCOV_DEBUG
+DA:/home/francesco/Develop/Javanile/lcov.sh/test/bats/../../lcov.sh,1
+end_of_record
diff --git a/a1.txt b/a1.txt
new file mode 100644
index 0000000..24e1d30
--- /dev/null
+++ b/a1.txt
@@ -0,0 +1 @@
+lcov: ERROR: no valid records found in tracefile .tmp/temp.info
diff --git a/lcov.sh b/lcov.sh
index 9d021de..1712aee 100755
--- a/lcov.sh
+++ b/lcov.sh
@@ -65,7 +65,8 @@ esac
 lcov_coverage=()
 lcov_extension=sh
 lcov_output=coverage
-lcov_temp_dir=$(mktemp -d -t lcov-sh-XXXXXXXXXXXX)
+#lcov_temp_dir=$(mktemp -d -t lcov-sh-XXXXXXXXXXXX)
+lcov_temp_dir=.tmp
 if [[ -z "LCOV_DEBUG_NO_COLOR" ]]; then
   skip_flag="${escape}[37m(skip)${escape}[0m"
   done_flag="${escape}[1m${escape}[32m(done)${escape}[0m"
@@ -93,6 +94,7 @@ while true; do
 done
 
 lcov_info="${lcov_output}/lcov.info"
+lcov_files="${lcov_output}/lcov.files"
 lcov_test_log="${lcov_output}/test.log"
 lcov_test_lock="${lcov_output}/test.lock"
 lcov_test_info="${lcov_output}/test.info"
@@ -123,7 +125,7 @@ get_uuid ()  {
 #  - Create output directory with scanned tracefile lcov.info file.
 ##
 get_files () {
-  local include="-name *.${extension}"
+  local include="-name *.${lcov_extension}"
   local exclude="-not -wholename ${lcov_output} -not -path .git"
 
   for arg in "$@"; do
@@ -149,16 +151,13 @@ get_files () {
 #  - Create output directory with scanned trace file lcov.info file.
 ##
 lcov_init() {
-  echo "LCOV.SH by Francesco Bianco <bianco@javanile.org>"
-  echo ""
-
   mkdir -p "${lcov_output}"
-  rm -f "${lcov_info}" "${lcov_test_stat}" "${lcov_test_lock}"
+  rm -f "${lcov_info}" "${lcov_files}" "${lcov_test_stat}" "${lcov_test_lock}"
 
   local init_info="${lcov_output}/init.info"
 
   get_files "$@" | while IFS= read -r file; do
-    #echo "coverage: ${file}"
+    echo "${file}" >> "${lcov_files}"
     lcov_scan "${file}" > "${init_info}"
     [[ -f "${lcov_info}" ]] || lcov -q -a "${init_info}" -o "${lcov_info}" && true
     lcov -q -a "${init_info}" -a "${lcov_info}" -o "${lcov_info}" >/dev/null 2>&1 && true
@@ -343,21 +342,26 @@ lcov_test_check() {
 # $2 - Output file
 ##
 lcov_append_info() {
-  local line_stop=$(get_uuid)
+  local line_stop="$(get_uuid)"
+  local temp_info="${lcov_temp_dir}/temp.info"
 
-  rm -f ${lcov_output}/test.info
+  rm -f "${temp_info}"
   echo "${line_stop}" >> "$1"
   while IFS= read line || [[ -n "${line}" ]]; do
     if [[ "${line::1}" = "+" ]]; then
       file=$(echo ${line} | cut -s -d':' -f2)
       lineno=$(echo ${line} | cut -s -d':' -f3)
-      echo -e "TN:\nSF:${file}\nDA:${lineno},1\nend_of_record" >> ${lcov_output}/test.info
+      echo -e "TN:\nSF:${file}\nDA:${lineno},1\nend_of_record" >> "${temp_info}"
     elif [[ "${line}" = "${line_stop}" ]]; then
+      echo "STOP" >> /home/francesco/Develop/Javanile/lcov.sh/a.txt
+      cat ${temp_info} >> /home/francesco/Develop/Javanile/lcov.sh/a.txt
       if [[ -n "$2" ]]; then
         local info=$(grep . $2 | tail -1)
         echo -e "${done_flag} $1: '${info}' (ok)";
       fi
-      lcov -q -a ${lcov_output}/test.info -a ${lcov_output}/lcov.info -o ${lcov_output}/lcov.info && true
+      #lcov -q -a "${temp_info}" -a "${lcov_info}" -o "${lcov_info}" && true
+      lcov -q -a "${temp_info}" -a "${lcov_info}" -o "${lcov_info}" &>> /home/francesco/Develop/Javanile/lcov.sh/a1.txt
+      rm -f "${temp_info}"
       shift
       lcov_test_stat 1 1 0 0
       lcov_test_next
@@ -367,20 +371,20 @@ lcov_append_info() {
 }
 
 ##
-# Run function used by BATS test case.
+# Run function used inside BATS test case.
 #
 ##
 run () {
   local orig_ps4="${PS4}"
   local orig_lcov_debug="${LCOV_DEBUG}"
-  local log_file=${lcov_tmp}/run.log
+  local log_file="${lcov_temp_dir}/bats_${BATS_SUITE_TEST_NUMBER}_${BATS_TEST_NUMBER}.log"
 
   rm -f "${log_file}"
 
   export LCOV_DEBUG=1
   export PS4="${LCOV_PS4}"
 
-  lcov_bats_run "${@}" 2> ${log_file}
+  lcov_bats_run "${@}" 2>> ${log_file}
 
   export LCOV_DEBUG="${orig_lcov_debug}"
   export PS4="${orig_ps4}"
@@ -391,10 +395,18 @@ run () {
 #
 ##
 teardown() {
-  local log_file=${lcov_tmp}/run.log
+  lcov_teardown
+}
+
+##
+#
+##
+lcov_teardown() {
+  local log_file="${lcov_temp_dir}/bats_${BATS_SUITE_TEST_NUMBER}_${BATS_TEST_NUMBER}.log"
   if [[ "${BATS_TEST_COMPLETED}" = 1 ]]; then
-    lcov_process_log ${log_file}
+    lcov_append_info "${log_file}"
   fi
+  #rm "${log_file}"
 }
 
 ##
@@ -428,6 +440,9 @@ main() {
     exit 1
   fi
 
+  echo "LCOV.SH by Francesco Bianco <bianco@javanile.org>"
+  echo ""
+
   lcov_init "${lcov_coverage[@]}"
 
   for test in "$@"; do
@@ -440,6 +455,10 @@ main() {
 ## Bypass entry-point if file was sourced
 ## than expose LCOV.SH and BATS functions
 if [[ "${BASH_SOURCE[0]}" != "${0}" ]]; then
+  if [[ -z "${LCOV_INIT}" ]]; then
+    export LCOV_INIT=1
+    lcov_init "${lcov_coverage[@]}"
+  fi
   export -f run
 else
   main "$@"

From bba93b0da5cc1f37533a3f2b92ae7642f9ddbd01 Mon Sep 17 00:00:00 2001
From: Francesco Bianco <info.francescobianco@gmail.com>
Date: Mon, 12 Oct 2020 20:46:40 +0200
Subject: [PATCH 11/32] fix missing lcov command

---
 Makefile |    2 +-
 a.txt    | 1471 ------------------------------------------------------
 a1.txt   |    2 +
 lcov.sh  |   46 +-
 4 files changed, 41 insertions(+), 1480 deletions(-)
 delete mode 100644 a.txt

diff --git a/Makefile b/Makefile
index 42867dd..93e4948 100644
--- a/Makefile
+++ b/Makefile
@@ -45,7 +45,7 @@ build-examples:
 ## Testing
 ## -------
 test-bats:
-	@rm -fr coverage
+	@rm -fr coverage a.txt
 	@bats test/bats
 
 test-get-uuid-function:
diff --git a/a.txt b/a.txt
deleted file mode 100644
index c8e2e40..0000000
--- a/a.txt
+++ /dev/null
@@ -1,1471 +0,0 @@
-/home/francesco/Develop/Javanile/lcov.sh
-find . -type f ( -name *. ) ( -not -wholename coverage -not -path .git )
-find . -type f ( -name *.sh ) ( -not -wholename coverage -not -path .git )
-STOP
-STOP
-TN:
-SF:LCOV_DEBUG
-DA:/home/francesco/Develop/Javanile/lcov.sh/test/bats/../../lcov.sh,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/usr/local/lib/bats-core/tracing.bash,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/usr/local/lib/bats-core/tracing.bash,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/usr/local/lib/bats-core/tracing.bash,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/usr/local/lib/bats-core/tracing.bash,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/usr/local/lib/bats-core/tracing.bash,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/usr/local/lib/bats-core/tracing.bash,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/usr/local/lib/bats-core/tracing.bash,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/usr/local/lib/bats-core/tracing.bash,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/usr/local/lib/bats-core/tracing.bash,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/usr/local/lib/bats-core/tracing.bash,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/usr/local/lib/bats-core/tracing.bash,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/usr/local/lib/bats-core/tracing.bash,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/usr/local/lib/bats-core/tracing.bash,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/usr/local/lib/bats-core/tracing.bash,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/usr/local/lib/bats-core/tracing.bash,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/usr/local/lib/bats-core/tracing.bash,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/usr/local/lib/bats-core/tracing.bash,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/usr/local/lib/bats-core/tracing.bash,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/usr/local/lib/bats-core/tracing.bash,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/usr/local/lib/bats-core/tracing.bash,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/usr/local/lib/bats-core/tracing.bash,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/usr/local/lib/bats-core/tracing.bash,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/usr/local/lib/bats-core/tracing.bash,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/usr/local/lib/bats-core/tracing.bash,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/usr/local/lib/bats-core/tracing.bash,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/usr/local/lib/bats-core/tracing.bash,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/usr/local/lib/bats-core/tracing.bash,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/usr/local/lib/bats-core/tracing.bash,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/home/francesco/Develop/Javanile/lcov.sh/test/bats/../../lcov.sh,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/home/francesco/Develop/Javanile/lcov.sh/test/bats/test1.sh,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/home/francesco/Develop/Javanile/lcov.sh/test/bats/../../lcov.sh,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/home/francesco/Develop/Javanile/lcov.sh/test/bats/../../lcov.sh,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/usr/local/lib/bats-core/tracing.bash,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/usr/local/lib/bats-core/tracing.bash,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/usr/local/lib/bats-core/tracing.bash,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/usr/local/lib/bats-core/tracing.bash,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/usr/local/lib/bats-core/tracing.bash,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/usr/local/lib/bats-core/tracing.bash,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/usr/local/lib/bats-core/tracing.bash,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/usr/local/lib/bats-core/tracing.bash,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/usr/local/lib/bats-core/tracing.bash,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/usr/local/lib/bats-core/tracing.bash,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/usr/local/lib/bats-core/tracing.bash,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/usr/local/lib/bats-core/tracing.bash,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/usr/local/lib/bats-core/tracing.bash,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/usr/local/lib/bats-core/tracing.bash,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/usr/local/lib/bats-core/tracing.bash,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/usr/local/lib/bats-core/tracing.bash,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/usr/local/lib/bats-core/tracing.bash,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/usr/local/lib/bats-core/tracing.bash,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/usr/local/lib/bats-core/tracing.bash,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/usr/local/lib/bats-core/tracing.bash,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/usr/local/lib/bats-core/tracing.bash,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/usr/local/lib/bats-core/tracing.bash,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/usr/local/lib/bats-core/tracing.bash,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/usr/local/lib/bats-core/tracing.bash,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/usr/local/lib/bats-core/tracing.bash,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/usr/local/lib/bats-core/tracing.bash,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/usr/local/lib/bats-core/tracing.bash,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/usr/local/lib/bats-core/tracing.bash,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/home/francesco/Develop/Javanile/lcov.sh/test/bats/../../lcov.sh,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/home/francesco/Develop/Javanile/lcov.sh/test/bats/../../lcov.sh,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/usr/local/lib/bats-core/tracing.bash,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/usr/local/lib/bats-core/tracing.bash,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/usr/local/lib/bats-core/tracing.bash,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/usr/local/lib/bats-core/tracing.bash,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/usr/local/lib/bats-core/tracing.bash,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/usr/local/lib/bats-core/tracing.bash,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/usr/local/lib/bats-core/tracing.bash,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/usr/local/lib/bats-core/tracing.bash,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/usr/local/lib/bats-core/tracing.bash,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/usr/local/lib/bats-core/tracing.bash,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/usr/local/lib/bats-core/tracing.bash,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/usr/local/lib/bats-core/tracing.bash,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/usr/local/lib/bats-core/tracing.bash,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/usr/local/lib/bats-core/tracing.bash,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/usr/local/lib/bats-core/tracing.bash,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/usr/local/lib/bats-core/tracing.bash,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/usr/local/lib/bats-core/tracing.bash,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/usr/local/lib/bats-core/tracing.bash,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/usr/local/lib/bats-core/tracing.bash,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/usr/local/lib/bats-core/tracing.bash,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/usr/local/lib/bats-core/tracing.bash,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/usr/local/lib/bats-core/tracing.bash,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/usr/local/lib/bats-core/tracing.bash,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/usr/local/lib/bats-core/tracing.bash,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/usr/local/lib/bats-core/tracing.bash,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/usr/local/lib/bats-core/tracing.bash,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/usr/local/lib/bats-core/tracing.bash,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/usr/local/lib/bats-core/tracing.bash,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/home/francesco/Develop/Javanile/lcov.sh/test/bats/../../lcov.sh,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/home/francesco/Develop/Javanile/lcov.sh/test/bats/../../lcov.sh,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/usr/local/lib/bats-core/tracing.bash,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/usr/local/lib/bats-core/tracing.bash,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/usr/local/lib/bats-core/tracing.bash,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/usr/local/lib/bats-core/tracing.bash,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/usr/local/lib/bats-core/tracing.bash,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/usr/local/lib/bats-core/tracing.bash,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/usr/local/lib/bats-core/tracing.bash,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/usr/local/lib/bats-core/tracing.bash,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/usr/local/lib/bats-core/tracing.bash,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/usr/local/lib/bats-core/tracing.bash,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/usr/local/lib/bats-core/tracing.bash,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/usr/local/lib/bats-core/tracing.bash,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/usr/local/lib/bats-core/tracing.bash,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/usr/local/lib/bats-core/tracing.bash,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/usr/local/lib/bats-core/tracing.bash,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/usr/local/lib/bats-core/tracing.bash,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/usr/local/lib/bats-core/tracing.bash,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/usr/local/lib/bats-core/tracing.bash,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/usr/local/lib/bats-core/tracing.bash,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/usr/local/lib/bats-core/tracing.bash,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/usr/local/lib/bats-core/tracing.bash,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/usr/local/lib/bats-core/tracing.bash,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/usr/local/lib/bats-core/tracing.bash,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/usr/local/lib/bats-core/tracing.bash,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/usr/local/lib/bats-core/tracing.bash,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/usr/local/lib/bats-core/tracing.bash,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/usr/local/lib/bats-core/tracing.bash,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/usr/local/lib/bats-core/tracing.bash,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/home/francesco/Develop/Javanile/lcov.sh/test/bats/../../lcov.sh,1
-end_of_record
-STOP
-TN:
-SF:LCOV_DEBUG
-DA:/home/francesco/Develop/Javanile/lcov.sh/test/bats/../../lcov.sh,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/usr/local/lib/bats-core/tracing.bash,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/usr/local/lib/bats-core/tracing.bash,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/usr/local/lib/bats-core/tracing.bash,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/usr/local/lib/bats-core/tracing.bash,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/usr/local/lib/bats-core/tracing.bash,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/usr/local/lib/bats-core/tracing.bash,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/usr/local/lib/bats-core/tracing.bash,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/usr/local/lib/bats-core/tracing.bash,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/usr/local/lib/bats-core/tracing.bash,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/usr/local/lib/bats-core/tracing.bash,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/usr/local/lib/bats-core/tracing.bash,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/usr/local/lib/bats-core/tracing.bash,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/usr/local/lib/bats-core/tracing.bash,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/usr/local/lib/bats-core/tracing.bash,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/usr/local/lib/bats-core/tracing.bash,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/usr/local/lib/bats-core/tracing.bash,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/usr/local/lib/bats-core/tracing.bash,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/usr/local/lib/bats-core/tracing.bash,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/usr/local/lib/bats-core/tracing.bash,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/usr/local/lib/bats-core/tracing.bash,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/usr/local/lib/bats-core/tracing.bash,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/usr/local/lib/bats-core/tracing.bash,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/usr/local/lib/bats-core/tracing.bash,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/usr/local/lib/bats-core/tracing.bash,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/usr/local/lib/bats-core/tracing.bash,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/usr/local/lib/bats-core/tracing.bash,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/usr/local/lib/bats-core/tracing.bash,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/usr/local/lib/bats-core/tracing.bash,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/home/francesco/Develop/Javanile/lcov.sh/test/bats/../../lcov.sh,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/home/francesco/Develop/Javanile/lcov.sh/test/bats/test1.sh,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/home/francesco/Develop/Javanile/lcov.sh/test/bats/../../lcov.sh,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/home/francesco/Develop/Javanile/lcov.sh/test/bats/../../lcov.sh,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/usr/local/lib/bats-core/tracing.bash,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/usr/local/lib/bats-core/tracing.bash,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/usr/local/lib/bats-core/tracing.bash,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/usr/local/lib/bats-core/tracing.bash,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/usr/local/lib/bats-core/tracing.bash,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/usr/local/lib/bats-core/tracing.bash,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/usr/local/lib/bats-core/tracing.bash,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/usr/local/lib/bats-core/tracing.bash,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/usr/local/lib/bats-core/tracing.bash,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/usr/local/lib/bats-core/tracing.bash,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/usr/local/lib/bats-core/tracing.bash,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/usr/local/lib/bats-core/tracing.bash,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/usr/local/lib/bats-core/tracing.bash,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/usr/local/lib/bats-core/tracing.bash,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/usr/local/lib/bats-core/tracing.bash,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/usr/local/lib/bats-core/tracing.bash,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/usr/local/lib/bats-core/tracing.bash,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/usr/local/lib/bats-core/tracing.bash,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/usr/local/lib/bats-core/tracing.bash,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/usr/local/lib/bats-core/tracing.bash,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/usr/local/lib/bats-core/tracing.bash,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/usr/local/lib/bats-core/tracing.bash,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/usr/local/lib/bats-core/tracing.bash,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/usr/local/lib/bats-core/tracing.bash,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/usr/local/lib/bats-core/tracing.bash,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/usr/local/lib/bats-core/tracing.bash,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/usr/local/lib/bats-core/tracing.bash,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/usr/local/lib/bats-core/tracing.bash,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/home/francesco/Develop/Javanile/lcov.sh/test/bats/../../lcov.sh,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/home/francesco/Develop/Javanile/lcov.sh/test/bats/../../lcov.sh,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/usr/local/lib/bats-core/tracing.bash,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/usr/local/lib/bats-core/tracing.bash,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/usr/local/lib/bats-core/tracing.bash,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/usr/local/lib/bats-core/tracing.bash,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/usr/local/lib/bats-core/tracing.bash,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/usr/local/lib/bats-core/tracing.bash,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/usr/local/lib/bats-core/tracing.bash,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/usr/local/lib/bats-core/tracing.bash,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/usr/local/lib/bats-core/tracing.bash,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/usr/local/lib/bats-core/tracing.bash,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/usr/local/lib/bats-core/tracing.bash,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/usr/local/lib/bats-core/tracing.bash,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/usr/local/lib/bats-core/tracing.bash,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/usr/local/lib/bats-core/tracing.bash,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/usr/local/lib/bats-core/tracing.bash,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/usr/local/lib/bats-core/tracing.bash,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/usr/local/lib/bats-core/tracing.bash,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/usr/local/lib/bats-core/tracing.bash,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/usr/local/lib/bats-core/tracing.bash,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/usr/local/lib/bats-core/tracing.bash,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/usr/local/lib/bats-core/tracing.bash,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/usr/local/lib/bats-core/tracing.bash,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/usr/local/lib/bats-core/tracing.bash,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/usr/local/lib/bats-core/tracing.bash,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/usr/local/lib/bats-core/tracing.bash,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/usr/local/lib/bats-core/tracing.bash,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/usr/local/lib/bats-core/tracing.bash,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/usr/local/lib/bats-core/tracing.bash,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/home/francesco/Develop/Javanile/lcov.sh/test/bats/../../lcov.sh,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/home/francesco/Develop/Javanile/lcov.sh/test/bats/../../lcov.sh,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/usr/local/lib/bats-core/tracing.bash,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/usr/local/lib/bats-core/tracing.bash,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/usr/local/lib/bats-core/tracing.bash,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/usr/local/lib/bats-core/tracing.bash,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/usr/local/lib/bats-core/tracing.bash,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/usr/local/lib/bats-core/tracing.bash,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/usr/local/lib/bats-core/tracing.bash,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/usr/local/lib/bats-core/tracing.bash,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/usr/local/lib/bats-core/tracing.bash,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/usr/local/lib/bats-core/tracing.bash,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/usr/local/lib/bats-core/tracing.bash,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/usr/local/lib/bats-core/tracing.bash,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/usr/local/lib/bats-core/tracing.bash,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/usr/local/lib/bats-core/tracing.bash,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/usr/local/lib/bats-core/tracing.bash,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/usr/local/lib/bats-core/tracing.bash,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/usr/local/lib/bats-core/tracing.bash,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/usr/local/lib/bats-core/tracing.bash,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/usr/local/lib/bats-core/tracing.bash,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/usr/local/lib/bats-core/tracing.bash,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/usr/local/lib/bats-core/tracing.bash,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/usr/local/lib/bats-core/tracing.bash,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/usr/local/lib/bats-core/tracing.bash,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/usr/local/lib/bats-core/tracing.bash,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/usr/local/lib/bats-core/tracing.bash,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/usr/local/lib/bats-core/tracing.bash,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/usr/local/lib/bats-core/tracing.bash,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/usr/local/lib/bats-core/tracing.bash,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/home/francesco/Develop/Javanile/lcov.sh/test/bats/../../lcov.sh,1
-end_of_record
-STOP
-TN:
-SF:LCOV_DEBUG
-DA:/home/francesco/Develop/Javanile/lcov.sh/test/bats/../../lcov.sh,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/usr/local/lib/bats-core/tracing.bash,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/usr/local/lib/bats-core/tracing.bash,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/usr/local/lib/bats-core/tracing.bash,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/usr/local/lib/bats-core/tracing.bash,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/usr/local/lib/bats-core/tracing.bash,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/usr/local/lib/bats-core/tracing.bash,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/usr/local/lib/bats-core/tracing.bash,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/usr/local/lib/bats-core/tracing.bash,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/usr/local/lib/bats-core/tracing.bash,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/usr/local/lib/bats-core/tracing.bash,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/usr/local/lib/bats-core/tracing.bash,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/usr/local/lib/bats-core/tracing.bash,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/usr/local/lib/bats-core/tracing.bash,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/usr/local/lib/bats-core/tracing.bash,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/usr/local/lib/bats-core/tracing.bash,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/usr/local/lib/bats-core/tracing.bash,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/usr/local/lib/bats-core/tracing.bash,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/usr/local/lib/bats-core/tracing.bash,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/usr/local/lib/bats-core/tracing.bash,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/usr/local/lib/bats-core/tracing.bash,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/usr/local/lib/bats-core/tracing.bash,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/usr/local/lib/bats-core/tracing.bash,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/usr/local/lib/bats-core/tracing.bash,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/usr/local/lib/bats-core/tracing.bash,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/usr/local/lib/bats-core/tracing.bash,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/usr/local/lib/bats-core/tracing.bash,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/usr/local/lib/bats-core/tracing.bash,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/usr/local/lib/bats-core/tracing.bash,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/home/francesco/Develop/Javanile/lcov.sh/test/bats/../../lcov.sh,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/home/francesco/Develop/Javanile/lcov.sh/test/bats/test1.sh,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/home/francesco/Develop/Javanile/lcov.sh/test/bats/../../lcov.sh,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/home/francesco/Develop/Javanile/lcov.sh/test/bats/../../lcov.sh,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/usr/local/lib/bats-core/tracing.bash,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/usr/local/lib/bats-core/tracing.bash,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/usr/local/lib/bats-core/tracing.bash,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/usr/local/lib/bats-core/tracing.bash,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/usr/local/lib/bats-core/tracing.bash,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/usr/local/lib/bats-core/tracing.bash,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/usr/local/lib/bats-core/tracing.bash,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/usr/local/lib/bats-core/tracing.bash,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/usr/local/lib/bats-core/tracing.bash,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/usr/local/lib/bats-core/tracing.bash,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/usr/local/lib/bats-core/tracing.bash,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/usr/local/lib/bats-core/tracing.bash,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/usr/local/lib/bats-core/tracing.bash,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/usr/local/lib/bats-core/tracing.bash,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/usr/local/lib/bats-core/tracing.bash,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/usr/local/lib/bats-core/tracing.bash,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/usr/local/lib/bats-core/tracing.bash,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/usr/local/lib/bats-core/tracing.bash,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/usr/local/lib/bats-core/tracing.bash,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/usr/local/lib/bats-core/tracing.bash,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/usr/local/lib/bats-core/tracing.bash,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/usr/local/lib/bats-core/tracing.bash,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/usr/local/lib/bats-core/tracing.bash,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/usr/local/lib/bats-core/tracing.bash,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/usr/local/lib/bats-core/tracing.bash,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/usr/local/lib/bats-core/tracing.bash,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/usr/local/lib/bats-core/tracing.bash,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/usr/local/lib/bats-core/tracing.bash,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/home/francesco/Develop/Javanile/lcov.sh/test/bats/../../lcov.sh,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/home/francesco/Develop/Javanile/lcov.sh/test/bats/../../lcov.sh,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/usr/local/lib/bats-core/tracing.bash,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/usr/local/lib/bats-core/tracing.bash,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/usr/local/lib/bats-core/tracing.bash,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/usr/local/lib/bats-core/tracing.bash,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/usr/local/lib/bats-core/tracing.bash,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/usr/local/lib/bats-core/tracing.bash,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/usr/local/lib/bats-core/tracing.bash,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/usr/local/lib/bats-core/tracing.bash,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/usr/local/lib/bats-core/tracing.bash,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/usr/local/lib/bats-core/tracing.bash,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/usr/local/lib/bats-core/tracing.bash,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/usr/local/lib/bats-core/tracing.bash,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/usr/local/lib/bats-core/tracing.bash,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/usr/local/lib/bats-core/tracing.bash,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/usr/local/lib/bats-core/tracing.bash,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/usr/local/lib/bats-core/tracing.bash,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/usr/local/lib/bats-core/tracing.bash,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/usr/local/lib/bats-core/tracing.bash,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/usr/local/lib/bats-core/tracing.bash,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/usr/local/lib/bats-core/tracing.bash,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/usr/local/lib/bats-core/tracing.bash,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/usr/local/lib/bats-core/tracing.bash,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/usr/local/lib/bats-core/tracing.bash,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/usr/local/lib/bats-core/tracing.bash,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/usr/local/lib/bats-core/tracing.bash,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/usr/local/lib/bats-core/tracing.bash,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/usr/local/lib/bats-core/tracing.bash,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/usr/local/lib/bats-core/tracing.bash,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/home/francesco/Develop/Javanile/lcov.sh/test/bats/../../lcov.sh,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/home/francesco/Develop/Javanile/lcov.sh/test/bats/../../lcov.sh,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/usr/local/lib/bats-core/tracing.bash,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/usr/local/lib/bats-core/tracing.bash,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/usr/local/lib/bats-core/tracing.bash,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/usr/local/lib/bats-core/tracing.bash,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/usr/local/lib/bats-core/tracing.bash,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/usr/local/lib/bats-core/tracing.bash,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/usr/local/lib/bats-core/tracing.bash,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/usr/local/lib/bats-core/tracing.bash,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/usr/local/lib/bats-core/tracing.bash,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/usr/local/lib/bats-core/tracing.bash,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/usr/local/lib/bats-core/tracing.bash,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/usr/local/lib/bats-core/tracing.bash,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/usr/local/lib/bats-core/tracing.bash,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/usr/local/lib/bats-core/tracing.bash,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/usr/local/lib/bats-core/tracing.bash,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/usr/local/lib/bats-core/tracing.bash,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/usr/local/lib/bats-core/tracing.bash,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/usr/local/lib/bats-core/tracing.bash,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/usr/local/lib/bats-core/tracing.bash,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/usr/local/lib/bats-core/tracing.bash,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/usr/local/lib/bats-core/tracing.bash,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/usr/local/lib/bats-core/tracing.bash,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/usr/local/lib/bats-core/tracing.bash,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/usr/local/lib/bats-core/tracing.bash,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/usr/local/lib/bats-core/tracing.bash,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/usr/local/lib/bats-core/tracing.bash,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/usr/local/lib/bats-core/tracing.bash,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/usr/local/lib/bats-core/tracing.bash,1
-end_of_record
-TN:
-SF:LCOV_DEBUG
-DA:/home/francesco/Develop/Javanile/lcov.sh/test/bats/../../lcov.sh,1
-end_of_record
diff --git a/a1.txt b/a1.txt
index 24e1d30..9dff996 100644
--- a/a1.txt
+++ b/a1.txt
@@ -1 +1,3 @@
 lcov: ERROR: no valid records found in tracefile .tmp/temp.info
+lcov: ERROR: no valid records found in tracefile .tmp/temp.info
+lcov: ERROR: no valid records found in tracefile .tmp/temp.info
diff --git a/lcov.sh b/lcov.sh
index 1712aee..5d69f02 100755
--- a/lcov.sh
+++ b/lcov.sh
@@ -65,8 +65,7 @@ esac
 lcov_coverage=()
 lcov_extension=sh
 lcov_output=coverage
-#lcov_temp_dir=$(mktemp -d -t lcov-sh-XXXXXXXXXXXX)
-lcov_temp_dir=.tmp
+lcov_temp_dir=$(mktemp -d -t lcov-sh-XXXXXXXXXXXX)
 if [[ -z "LCOV_DEBUG_NO_COLOR" ]]; then
   skip_flag="${escape}[37m(skip)${escape}[0m"
   done_flag="${escape}[1m${escape}[32m(done)${escape}[0m"
@@ -93,6 +92,7 @@ while true; do
   shift
 done
 
+lcov_log="${lcov_output}/lcov.log"
 lcov_info="${lcov_output}/lcov.info"
 lcov_files="${lcov_output}/lcov.files"
 lcov_test_log="${lcov_output}/test.log"
@@ -142,6 +142,34 @@ get_files () {
   return 0
 }
 
+##
+#
+##
+function lcov_error () {
+   echo "--> $1"
+   local i
+   local stack_size=${#FUNCNAME[@]}
+   for (( i=1; i<$stack_size ; i++ )); do
+      local func="${FUNCNAME[$i]}"
+      [ x$func = x ] && func=MAIN
+      #local linen="${BASH_LINENO[(( i - 1 ))]}"
+      local linen="${BASH_LINENO[$i]}"
+      local src="${BASH_SOURCE[$i]}"
+      [ x"$src" = x ] && src=non_file_source
+      echo "    ${func}() at ${src}:${linen}"
+   done
+}
+
+##
+#
+##
+lcov_exec() {
+  local log=$(lcov "${@}" 2>&1 && true)
+  if [[ -n ${log} ]]; then
+    lcov_error "${log}" >> "${lcov_log}"
+  fi
+}
+
 ##
 # Initialize output directory.
 #
@@ -159,8 +187,8 @@ lcov_init() {
   get_files "$@" | while IFS= read -r file; do
     echo "${file}" >> "${lcov_files}"
     lcov_scan "${file}" > "${init_info}"
-    [[ -f "${lcov_info}" ]] || lcov -q -a "${init_info}" -o "${lcov_info}" && true
-    lcov -q -a "${init_info}" -a "${lcov_info}" -o "${lcov_info}" >/dev/null 2>&1 && true
+    [[ -f "${lcov_info}" ]] || lcov_exec -q -a "${init_info}" -o "${lcov_info}" && true
+    lcov_exec -q -a "${init_info}" -a "${lcov_info}" -o "${lcov_info}"
     rm -f "${init_info}"
   done
 
@@ -347,20 +375,22 @@ lcov_append_info() {
 
   rm -f "${temp_info}"
   echo "${line_stop}" >> "$1"
+  #echo "STOP" >> /home/francesco/Develop/Javanile/lcov.sh/a.txt
+  #cat "$1" >> /home/francesco/Develop/Javanile/lcov.sh/a.txt
   while IFS= read line || [[ -n "${line}" ]]; do
     if [[ "${line::1}" = "+" ]]; then
       file=$(echo ${line} | cut -s -d':' -f2)
       lineno=$(echo ${line} | cut -s -d':' -f3)
       echo -e "TN:\nSF:${file}\nDA:${lineno},1\nend_of_record" >> "${temp_info}"
     elif [[ "${line}" = "${line_stop}" ]]; then
-      echo "STOP" >> /home/francesco/Develop/Javanile/lcov.sh/a.txt
-      cat ${temp_info} >> /home/francesco/Develop/Javanile/lcov.sh/a.txt
       if [[ -n "$2" ]]; then
         local info=$(grep . $2 | tail -1)
         echo -e "${done_flag} $1: '${info}' (ok)";
       fi
-      #lcov -q -a "${temp_info}" -a "${lcov_info}" -o "${lcov_info}" && true
-      lcov -q -a "${temp_info}" -a "${lcov_info}" -o "${lcov_info}" &>> /home/francesco/Develop/Javanile/lcov.sh/a1.txt
+      echo "START" >> /home/francesco/Develop/Javanile/lcov.sh/a.txt
+      cat "$1" >> /home/francesco/Develop/Javanile/lcov.sh/a.txt
+      echo "STOP" >> /home/francesco/Develop/Javanile/lcov.sh/a.txt
+      lcov_exec -q -a "${temp_info}" -a "${lcov_info}" -o "${lcov_info}"
       rm -f "${temp_info}"
       shift
       lcov_test_stat 1 1 0 0

From a448e8503763a7351f2b8142a235af5dcd787220 Mon Sep 17 00:00:00 2001
From: Francesco Bianco <info.francescobianco@gmail.com>
Date: Mon, 12 Oct 2020 21:00:32 +0200
Subject: [PATCH 12/32] fix missing lcov command

---
 a.txt   | 490 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 lcov.sh |   7 +-
 2 files changed, 494 insertions(+), 3 deletions(-)
 create mode 100644 a.txt

diff --git a/a.txt b/a.txt
new file mode 100644
index 0000000..d5dcd4f
--- /dev/null
+++ b/a.txt
@@ -0,0 +1,490 @@
+START
+TN:
+SF:/home/francesco/Develop/Javanile/lcov.sh/test/bats/../../lcov.sh
+DA:451,1
+end_of_record
+TN:
+SF:/usr/local/lib/bats-core/tracing.bash
+DA:122,1
+end_of_record
+TN:
+SF:/usr/local/lib/bats-core/tracing.bash
+DA:122,1
+end_of_record
+TN:
+SF:/usr/local/lib/bats-core/tracing.bash
+DA:128,1
+end_of_record
+TN:
+SF:/usr/local/lib/bats-core/tracing.bash
+DA:129,1
+end_of_record
+TN:
+SF:/usr/local/lib/bats-core/tracing.bash
+DA:4,1
+end_of_record
+TN:
+SF:/usr/local/lib/bats-core/tracing.bash
+DA:5,1
+end_of_record
+TN:
+SF:/usr/local/lib/bats-core/tracing.bash
+DA:6,1
+end_of_record
+TN:
+SF:/usr/local/lib/bats-core/tracing.bash
+DA:8,1
+end_of_record
+TN:
+SF:/usr/local/lib/bats-core/tracing.bash
+DA:10,1
+end_of_record
+TN:
+SF:/usr/local/lib/bats-core/tracing.bash
+DA:10,1
+end_of_record
+TN:
+SF:/usr/local/lib/bats-core/tracing.bash
+DA:13,1
+end_of_record
+TN:
+SF:/usr/local/lib/bats-core/tracing.bash
+DA:14,1
+end_of_record
+TN:
+SF:/usr/local/lib/bats-core/tracing.bash
+DA:15,1
+end_of_record
+TN:
+SF:/usr/local/lib/bats-core/tracing.bash
+DA:16,1
+end_of_record
+TN:
+SF:/usr/local/lib/bats-core/tracing.bash
+DA:10,1
+end_of_record
+TN:
+SF:/usr/local/lib/bats-core/tracing.bash
+DA:10,1
+end_of_record
+TN:
+SF:/usr/local/lib/bats-core/tracing.bash
+DA:13,1
+end_of_record
+TN:
+SF:/usr/local/lib/bats-core/tracing.bash
+DA:14,1
+end_of_record
+TN:
+SF:/usr/local/lib/bats-core/tracing.bash
+DA:15,1
+end_of_record
+TN:
+SF:/usr/local/lib/bats-core/tracing.bash
+DA:16,1
+end_of_record
+TN:
+SF:/usr/local/lib/bats-core/tracing.bash
+DA:10,1
+end_of_record
+TN:
+SF:/usr/local/lib/bats-core/tracing.bash
+DA:10,1
+end_of_record
+TN:
+SF:/usr/local/lib/bats-core/tracing.bash
+DA:13,1
+end_of_record
+TN:
+SF:/usr/local/lib/bats-core/tracing.bash
+DA:14,1
+end_of_record
+TN:
+SF:/usr/local/lib/bats-core/tracing.bash
+DA:15,1
+end_of_record
+TN:
+SF:/usr/local/lib/bats-core/tracing.bash
+DA:16,1
+end_of_record
+TN:
+SF:/usr/local/lib/bats-core/tracing.bash
+DA:17,1
+end_of_record
+TN:
+SF:/usr/local/lib/bats-core/tracing.bash
+DA:19,1
+end_of_record
+TN:
+SF:/home/francesco/Develop/Javanile/lcov.sh/test/bats/../../lcov.sh
+DA:451,1
+end_of_record
+TN:
+SF:/home/francesco/Develop/Javanile/lcov.sh/test/bats/test1.sh
+DA:6,1
+end_of_record
+TN:
+SF:/home/francesco/Develop/Javanile/lcov.sh/test/bats/../../lcov.sh
+DA:451,1
+end_of_record
+TN:
+SF:/home/francesco/Develop/Javanile/lcov.sh/test/bats/../../lcov.sh
+DA:452,1
+end_of_record
+TN:
+SF:/usr/local/lib/bats-core/tracing.bash
+DA:122,1
+end_of_record
+TN:
+SF:/usr/local/lib/bats-core/tracing.bash
+DA:122,1
+end_of_record
+TN:
+SF:/usr/local/lib/bats-core/tracing.bash
+DA:128,1
+end_of_record
+TN:
+SF:/usr/local/lib/bats-core/tracing.bash
+DA:129,1
+end_of_record
+TN:
+SF:/usr/local/lib/bats-core/tracing.bash
+DA:4,1
+end_of_record
+TN:
+SF:/usr/local/lib/bats-core/tracing.bash
+DA:5,1
+end_of_record
+TN:
+SF:/usr/local/lib/bats-core/tracing.bash
+DA:6,1
+end_of_record
+TN:
+SF:/usr/local/lib/bats-core/tracing.bash
+DA:8,1
+end_of_record
+TN:
+SF:/usr/local/lib/bats-core/tracing.bash
+DA:10,1
+end_of_record
+TN:
+SF:/usr/local/lib/bats-core/tracing.bash
+DA:10,1
+end_of_record
+TN:
+SF:/usr/local/lib/bats-core/tracing.bash
+DA:13,1
+end_of_record
+TN:
+SF:/usr/local/lib/bats-core/tracing.bash
+DA:14,1
+end_of_record
+TN:
+SF:/usr/local/lib/bats-core/tracing.bash
+DA:15,1
+end_of_record
+TN:
+SF:/usr/local/lib/bats-core/tracing.bash
+DA:16,1
+end_of_record
+TN:
+SF:/usr/local/lib/bats-core/tracing.bash
+DA:10,1
+end_of_record
+TN:
+SF:/usr/local/lib/bats-core/tracing.bash
+DA:10,1
+end_of_record
+TN:
+SF:/usr/local/lib/bats-core/tracing.bash
+DA:13,1
+end_of_record
+TN:
+SF:/usr/local/lib/bats-core/tracing.bash
+DA:14,1
+end_of_record
+TN:
+SF:/usr/local/lib/bats-core/tracing.bash
+DA:15,1
+end_of_record
+TN:
+SF:/usr/local/lib/bats-core/tracing.bash
+DA:16,1
+end_of_record
+TN:
+SF:/usr/local/lib/bats-core/tracing.bash
+DA:10,1
+end_of_record
+TN:
+SF:/usr/local/lib/bats-core/tracing.bash
+DA:10,1
+end_of_record
+TN:
+SF:/usr/local/lib/bats-core/tracing.bash
+DA:13,1
+end_of_record
+TN:
+SF:/usr/local/lib/bats-core/tracing.bash
+DA:14,1
+end_of_record
+TN:
+SF:/usr/local/lib/bats-core/tracing.bash
+DA:15,1
+end_of_record
+TN:
+SF:/usr/local/lib/bats-core/tracing.bash
+DA:16,1
+end_of_record
+TN:
+SF:/usr/local/lib/bats-core/tracing.bash
+DA:17,1
+end_of_record
+TN:
+SF:/usr/local/lib/bats-core/tracing.bash
+DA:19,1
+end_of_record
+TN:
+SF:/home/francesco/Develop/Javanile/lcov.sh/test/bats/../../lcov.sh
+DA:452,1
+end_of_record
+TN:
+SF:/home/francesco/Develop/Javanile/lcov.sh/test/bats/../../lcov.sh
+DA:453,1
+end_of_record
+TN:
+SF:/usr/local/lib/bats-core/tracing.bash
+DA:122,1
+end_of_record
+TN:
+SF:/usr/local/lib/bats-core/tracing.bash
+DA:122,1
+end_of_record
+TN:
+SF:/usr/local/lib/bats-core/tracing.bash
+DA:128,1
+end_of_record
+TN:
+SF:/usr/local/lib/bats-core/tracing.bash
+DA:129,1
+end_of_record
+TN:
+SF:/usr/local/lib/bats-core/tracing.bash
+DA:4,1
+end_of_record
+TN:
+SF:/usr/local/lib/bats-core/tracing.bash
+DA:5,1
+end_of_record
+TN:
+SF:/usr/local/lib/bats-core/tracing.bash
+DA:6,1
+end_of_record
+TN:
+SF:/usr/local/lib/bats-core/tracing.bash
+DA:8,1
+end_of_record
+TN:
+SF:/usr/local/lib/bats-core/tracing.bash
+DA:10,1
+end_of_record
+TN:
+SF:/usr/local/lib/bats-core/tracing.bash
+DA:10,1
+end_of_record
+TN:
+SF:/usr/local/lib/bats-core/tracing.bash
+DA:13,1
+end_of_record
+TN:
+SF:/usr/local/lib/bats-core/tracing.bash
+DA:14,1
+end_of_record
+TN:
+SF:/usr/local/lib/bats-core/tracing.bash
+DA:15,1
+end_of_record
+TN:
+SF:/usr/local/lib/bats-core/tracing.bash
+DA:16,1
+end_of_record
+TN:
+SF:/usr/local/lib/bats-core/tracing.bash
+DA:10,1
+end_of_record
+TN:
+SF:/usr/local/lib/bats-core/tracing.bash
+DA:10,1
+end_of_record
+TN:
+SF:/usr/local/lib/bats-core/tracing.bash
+DA:13,1
+end_of_record
+TN:
+SF:/usr/local/lib/bats-core/tracing.bash
+DA:14,1
+end_of_record
+TN:
+SF:/usr/local/lib/bats-core/tracing.bash
+DA:15,1
+end_of_record
+TN:
+SF:/usr/local/lib/bats-core/tracing.bash
+DA:16,1
+end_of_record
+TN:
+SF:/usr/local/lib/bats-core/tracing.bash
+DA:10,1
+end_of_record
+TN:
+SF:/usr/local/lib/bats-core/tracing.bash
+DA:10,1
+end_of_record
+TN:
+SF:/usr/local/lib/bats-core/tracing.bash
+DA:13,1
+end_of_record
+TN:
+SF:/usr/local/lib/bats-core/tracing.bash
+DA:14,1
+end_of_record
+TN:
+SF:/usr/local/lib/bats-core/tracing.bash
+DA:15,1
+end_of_record
+TN:
+SF:/usr/local/lib/bats-core/tracing.bash
+DA:16,1
+end_of_record
+TN:
+SF:/usr/local/lib/bats-core/tracing.bash
+DA:17,1
+end_of_record
+TN:
+SF:/usr/local/lib/bats-core/tracing.bash
+DA:19,1
+end_of_record
+TN:
+SF:/home/francesco/Develop/Javanile/lcov.sh/test/bats/../../lcov.sh
+DA:453,1
+end_of_record
+TN:
+SF:/home/francesco/Develop/Javanile/lcov.sh/test/bats/../../lcov.sh
+DA:453,1
+end_of_record
+TN:
+SF:/usr/local/lib/bats-core/tracing.bash
+DA:122,1
+end_of_record
+TN:
+SF:/usr/local/lib/bats-core/tracing.bash
+DA:122,1
+end_of_record
+TN:
+SF:/usr/local/lib/bats-core/tracing.bash
+DA:128,1
+end_of_record
+TN:
+SF:/usr/local/lib/bats-core/tracing.bash
+DA:129,1
+end_of_record
+TN:
+SF:/usr/local/lib/bats-core/tracing.bash
+DA:4,1
+end_of_record
+TN:
+SF:/usr/local/lib/bats-core/tracing.bash
+DA:5,1
+end_of_record
+TN:
+SF:/usr/local/lib/bats-core/tracing.bash
+DA:6,1
+end_of_record
+TN:
+SF:/usr/local/lib/bats-core/tracing.bash
+DA:8,1
+end_of_record
+TN:
+SF:/usr/local/lib/bats-core/tracing.bash
+DA:10,1
+end_of_record
+TN:
+SF:/usr/local/lib/bats-core/tracing.bash
+DA:10,1
+end_of_record
+TN:
+SF:/usr/local/lib/bats-core/tracing.bash
+DA:13,1
+end_of_record
+TN:
+SF:/usr/local/lib/bats-core/tracing.bash
+DA:14,1
+end_of_record
+TN:
+SF:/usr/local/lib/bats-core/tracing.bash
+DA:15,1
+end_of_record
+TN:
+SF:/usr/local/lib/bats-core/tracing.bash
+DA:16,1
+end_of_record
+TN:
+SF:/usr/local/lib/bats-core/tracing.bash
+DA:10,1
+end_of_record
+TN:
+SF:/usr/local/lib/bats-core/tracing.bash
+DA:10,1
+end_of_record
+TN:
+SF:/usr/local/lib/bats-core/tracing.bash
+DA:13,1
+end_of_record
+TN:
+SF:/usr/local/lib/bats-core/tracing.bash
+DA:14,1
+end_of_record
+TN:
+SF:/usr/local/lib/bats-core/tracing.bash
+DA:15,1
+end_of_record
+TN:
+SF:/usr/local/lib/bats-core/tracing.bash
+DA:16,1
+end_of_record
+TN:
+SF:/usr/local/lib/bats-core/tracing.bash
+DA:10,1
+end_of_record
+TN:
+SF:/usr/local/lib/bats-core/tracing.bash
+DA:10,1
+end_of_record
+TN:
+SF:/usr/local/lib/bats-core/tracing.bash
+DA:13,1
+end_of_record
+TN:
+SF:/usr/local/lib/bats-core/tracing.bash
+DA:14,1
+end_of_record
+TN:
+SF:/usr/local/lib/bats-core/tracing.bash
+DA:15,1
+end_of_record
+TN:
+SF:/usr/local/lib/bats-core/tracing.bash
+DA:16,1
+end_of_record
+TN:
+SF:/usr/local/lib/bats-core/tracing.bash
+DA:17,1
+end_of_record
+TN:
+SF:/usr/local/lib/bats-core/tracing.bash
+DA:19,1
+end_of_record
+TN:
+SF:/home/francesco/Develop/Javanile/lcov.sh/test/bats/../../lcov.sh
+DA:453,1
+end_of_record
+STOP
diff --git a/lcov.sh b/lcov.sh
index 5d69f02..dda1692 100755
--- a/lcov.sh
+++ b/lcov.sh
@@ -379,8 +379,8 @@ lcov_append_info() {
   #cat "$1" >> /home/francesco/Develop/Javanile/lcov.sh/a.txt
   while IFS= read line || [[ -n "${line}" ]]; do
     if [[ "${line::1}" = "+" ]]; then
-      file=$(echo ${line} | cut -s -d':' -f2)
-      lineno=$(echo ${line} | cut -s -d':' -f3)
+      file=$(echo ${line} | cut -s -d':' -f3)
+      lineno=$(echo ${line} | cut -s -d':' -f4)
       echo -e "TN:\nSF:${file}\nDA:${lineno},1\nend_of_record" >> "${temp_info}"
     elif [[ "${line}" = "${line_stop}" ]]; then
       if [[ -n "$2" ]]; then
@@ -388,7 +388,7 @@ lcov_append_info() {
         echo -e "${done_flag} $1: '${info}' (ok)";
       fi
       echo "START" >> /home/francesco/Develop/Javanile/lcov.sh/a.txt
-      cat "$1" >> /home/francesco/Develop/Javanile/lcov.sh/a.txt
+      cat "${temp_info}" >> /home/francesco/Develop/Javanile/lcov.sh/a.txt
       echo "STOP" >> /home/francesco/Develop/Javanile/lcov.sh/a.txt
       lcov_exec -q -a "${temp_info}" -a "${lcov_info}" -o "${lcov_info}"
       rm -f "${temp_info}"
@@ -437,6 +437,7 @@ lcov_teardown() {
     lcov_append_info "${log_file}"
   fi
   #rm "${log_file}"
+  genhtml -q -o "${lcov_output}" "${lcov_info}"
 }
 
 ##

From 38e6ad4cb7420735bec297e5274d3bd801029d48 Mon Sep 17 00:00:00 2001
From: Francesco Bianco <info.francescobianco@gmail.com>
Date: Tue, 13 Oct 2020 23:25:31 +0200
Subject: [PATCH 13/32] fix missing lcov command

---
 a.txt   | 484 +++-----------------------------------------------------
 demo.sh |   7 +-
 lcov.sh |  16 +-
 3 files changed, 32 insertions(+), 475 deletions(-)

diff --git a/a.txt b/a.txt
index d5dcd4f..f7240fd 100644
--- a/a.txt
+++ b/a.txt
@@ -1,490 +1,42 @@
 START
 TN:
-SF:/home/francesco/Develop/Javanile/lcov.sh/test/bats/../../lcov.sh
-DA:451,1
+SF:/home/francesco/Develop/Javanile/lcov.sh/lcov.sh
+DA:457,1
 end_of_record
 TN:
-SF:/usr/local/lib/bats-core/tracing.bash
-DA:122,1
-end_of_record
-TN:
-SF:/usr/local/lib/bats-core/tracing.bash
-DA:122,1
-end_of_record
-TN:
-SF:/usr/local/lib/bats-core/tracing.bash
-DA:128,1
-end_of_record
-TN:
-SF:/usr/local/lib/bats-core/tracing.bash
-DA:129,1
-end_of_record
-TN:
-SF:/usr/local/lib/bats-core/tracing.bash
-DA:4,1
-end_of_record
-TN:
-SF:/usr/local/lib/bats-core/tracing.bash
-DA:5,1
-end_of_record
-TN:
-SF:/usr/local/lib/bats-core/tracing.bash
-DA:6,1
-end_of_record
-TN:
-SF:/usr/local/lib/bats-core/tracing.bash
-DA:8,1
-end_of_record
-TN:
-SF:/usr/local/lib/bats-core/tracing.bash
-DA:10,1
-end_of_record
-TN:
-SF:/usr/local/lib/bats-core/tracing.bash
-DA:10,1
-end_of_record
-TN:
-SF:/usr/local/lib/bats-core/tracing.bash
-DA:13,1
-end_of_record
-TN:
-SF:/usr/local/lib/bats-core/tracing.bash
-DA:14,1
-end_of_record
-TN:
-SF:/usr/local/lib/bats-core/tracing.bash
-DA:15,1
-end_of_record
-TN:
-SF:/usr/local/lib/bats-core/tracing.bash
-DA:16,1
-end_of_record
-TN:
-SF:/usr/local/lib/bats-core/tracing.bash
-DA:10,1
-end_of_record
-TN:
-SF:/usr/local/lib/bats-core/tracing.bash
-DA:10,1
-end_of_record
-TN:
-SF:/usr/local/lib/bats-core/tracing.bash
-DA:13,1
-end_of_record
-TN:
-SF:/usr/local/lib/bats-core/tracing.bash
-DA:14,1
-end_of_record
-TN:
-SF:/usr/local/lib/bats-core/tracing.bash
-DA:15,1
-end_of_record
-TN:
-SF:/usr/local/lib/bats-core/tracing.bash
-DA:16,1
-end_of_record
-TN:
-SF:/usr/local/lib/bats-core/tracing.bash
-DA:10,1
-end_of_record
-TN:
-SF:/usr/local/lib/bats-core/tracing.bash
-DA:10,1
-end_of_record
-TN:
-SF:/usr/local/lib/bats-core/tracing.bash
-DA:13,1
-end_of_record
-TN:
-SF:/usr/local/lib/bats-core/tracing.bash
-DA:14,1
-end_of_record
-TN:
-SF:/usr/local/lib/bats-core/tracing.bash
-DA:15,1
-end_of_record
-TN:
-SF:/usr/local/lib/bats-core/tracing.bash
-DA:16,1
-end_of_record
-TN:
-SF:/usr/local/lib/bats-core/tracing.bash
-DA:17,1
-end_of_record
-TN:
-SF:/usr/local/lib/bats-core/tracing.bash
-DA:19,1
-end_of_record
-TN:
-SF:/home/francesco/Develop/Javanile/lcov.sh/test/bats/../../lcov.sh
-DA:451,1
+SF:/home/francesco/Develop/Javanile/lcov.sh/lcov.sh
+DA:457,1
 end_of_record
 TN:
 SF:/home/francesco/Develop/Javanile/lcov.sh/test/bats/test1.sh
 DA:6,1
 end_of_record
 TN:
-SF:/home/francesco/Develop/Javanile/lcov.sh/test/bats/../../lcov.sh
-DA:451,1
-end_of_record
-TN:
-SF:/home/francesco/Develop/Javanile/lcov.sh/test/bats/../../lcov.sh
-DA:452,1
-end_of_record
-TN:
-SF:/usr/local/lib/bats-core/tracing.bash
-DA:122,1
-end_of_record
-TN:
-SF:/usr/local/lib/bats-core/tracing.bash
-DA:122,1
-end_of_record
-TN:
-SF:/usr/local/lib/bats-core/tracing.bash
-DA:128,1
-end_of_record
-TN:
-SF:/usr/local/lib/bats-core/tracing.bash
-DA:129,1
-end_of_record
-TN:
-SF:/usr/local/lib/bats-core/tracing.bash
-DA:4,1
-end_of_record
-TN:
-SF:/usr/local/lib/bats-core/tracing.bash
-DA:5,1
-end_of_record
-TN:
-SF:/usr/local/lib/bats-core/tracing.bash
-DA:6,1
-end_of_record
-TN:
-SF:/usr/local/lib/bats-core/tracing.bash
-DA:8,1
-end_of_record
-TN:
-SF:/usr/local/lib/bats-core/tracing.bash
-DA:10,1
-end_of_record
-TN:
-SF:/usr/local/lib/bats-core/tracing.bash
-DA:10,1
-end_of_record
-TN:
-SF:/usr/local/lib/bats-core/tracing.bash
-DA:13,1
-end_of_record
-TN:
-SF:/usr/local/lib/bats-core/tracing.bash
-DA:14,1
-end_of_record
-TN:
-SF:/usr/local/lib/bats-core/tracing.bash
-DA:15,1
-end_of_record
-TN:
-SF:/usr/local/lib/bats-core/tracing.bash
-DA:16,1
-end_of_record
-TN:
-SF:/usr/local/lib/bats-core/tracing.bash
-DA:10,1
-end_of_record
-TN:
-SF:/usr/local/lib/bats-core/tracing.bash
-DA:10,1
-end_of_record
-TN:
-SF:/usr/local/lib/bats-core/tracing.bash
-DA:13,1
-end_of_record
-TN:
-SF:/usr/local/lib/bats-core/tracing.bash
-DA:14,1
-end_of_record
-TN:
-SF:/usr/local/lib/bats-core/tracing.bash
-DA:15,1
-end_of_record
-TN:
-SF:/usr/local/lib/bats-core/tracing.bash
-DA:16,1
-end_of_record
-TN:
-SF:/usr/local/lib/bats-core/tracing.bash
-DA:10,1
-end_of_record
-TN:
-SF:/usr/local/lib/bats-core/tracing.bash
-DA:10,1
-end_of_record
-TN:
-SF:/usr/local/lib/bats-core/tracing.bash
-DA:13,1
-end_of_record
-TN:
-SF:/usr/local/lib/bats-core/tracing.bash
-DA:14,1
-end_of_record
-TN:
-SF:/usr/local/lib/bats-core/tracing.bash
-DA:15,1
-end_of_record
-TN:
-SF:/usr/local/lib/bats-core/tracing.bash
-DA:16,1
-end_of_record
-TN:
-SF:/usr/local/lib/bats-core/tracing.bash
-DA:17,1
-end_of_record
-TN:
-SF:/usr/local/lib/bats-core/tracing.bash
-DA:19,1
-end_of_record
-TN:
-SF:/home/francesco/Develop/Javanile/lcov.sh/test/bats/../../lcov.sh
-DA:452,1
-end_of_record
-TN:
-SF:/home/francesco/Develop/Javanile/lcov.sh/test/bats/../../lcov.sh
-DA:453,1
-end_of_record
-TN:
-SF:/usr/local/lib/bats-core/tracing.bash
-DA:122,1
-end_of_record
-TN:
-SF:/usr/local/lib/bats-core/tracing.bash
-DA:122,1
-end_of_record
-TN:
-SF:/usr/local/lib/bats-core/tracing.bash
-DA:128,1
-end_of_record
-TN:
-SF:/usr/local/lib/bats-core/tracing.bash
-DA:129,1
-end_of_record
-TN:
-SF:/usr/local/lib/bats-core/tracing.bash
-DA:4,1
-end_of_record
-TN:
-SF:/usr/local/lib/bats-core/tracing.bash
-DA:5,1
-end_of_record
-TN:
-SF:/usr/local/lib/bats-core/tracing.bash
-DA:6,1
-end_of_record
-TN:
-SF:/usr/local/lib/bats-core/tracing.bash
-DA:8,1
-end_of_record
-TN:
-SF:/usr/local/lib/bats-core/tracing.bash
-DA:10,1
-end_of_record
-TN:
-SF:/usr/local/lib/bats-core/tracing.bash
-DA:10,1
-end_of_record
-TN:
-SF:/usr/local/lib/bats-core/tracing.bash
-DA:13,1
-end_of_record
-TN:
-SF:/usr/local/lib/bats-core/tracing.bash
-DA:14,1
-end_of_record
-TN:
-SF:/usr/local/lib/bats-core/tracing.bash
-DA:15,1
-end_of_record
-TN:
-SF:/usr/local/lib/bats-core/tracing.bash
-DA:16,1
-end_of_record
-TN:
-SF:/usr/local/lib/bats-core/tracing.bash
-DA:10,1
-end_of_record
-TN:
-SF:/usr/local/lib/bats-core/tracing.bash
-DA:10,1
-end_of_record
-TN:
-SF:/usr/local/lib/bats-core/tracing.bash
-DA:13,1
-end_of_record
-TN:
-SF:/usr/local/lib/bats-core/tracing.bash
-DA:14,1
-end_of_record
-TN:
-SF:/usr/local/lib/bats-core/tracing.bash
-DA:15,1
-end_of_record
-TN:
-SF:/usr/local/lib/bats-core/tracing.bash
-DA:16,1
-end_of_record
-TN:
-SF:/usr/local/lib/bats-core/tracing.bash
-DA:10,1
-end_of_record
-TN:
-SF:/usr/local/lib/bats-core/tracing.bash
-DA:10,1
-end_of_record
-TN:
-SF:/usr/local/lib/bats-core/tracing.bash
-DA:13,1
-end_of_record
-TN:
-SF:/usr/local/lib/bats-core/tracing.bash
-DA:14,1
-end_of_record
-TN:
-SF:/usr/local/lib/bats-core/tracing.bash
-DA:15,1
-end_of_record
-TN:
-SF:/usr/local/lib/bats-core/tracing.bash
-DA:16,1
-end_of_record
-TN:
-SF:/usr/local/lib/bats-core/tracing.bash
-DA:17,1
-end_of_record
-TN:
-SF:/usr/local/lib/bats-core/tracing.bash
-DA:19,1
-end_of_record
-TN:
-SF:/home/francesco/Develop/Javanile/lcov.sh/test/bats/../../lcov.sh
-DA:453,1
-end_of_record
-TN:
-SF:/home/francesco/Develop/Javanile/lcov.sh/test/bats/../../lcov.sh
-DA:453,1
-end_of_record
-TN:
-SF:/usr/local/lib/bats-core/tracing.bash
-DA:122,1
-end_of_record
-TN:
-SF:/usr/local/lib/bats-core/tracing.bash
-DA:122,1
-end_of_record
-TN:
-SF:/usr/local/lib/bats-core/tracing.bash
-DA:128,1
-end_of_record
-TN:
-SF:/usr/local/lib/bats-core/tracing.bash
-DA:129,1
-end_of_record
-TN:
-SF:/usr/local/lib/bats-core/tracing.bash
-DA:4,1
-end_of_record
-TN:
-SF:/usr/local/lib/bats-core/tracing.bash
-DA:5,1
-end_of_record
-TN:
-SF:/usr/local/lib/bats-core/tracing.bash
-DA:6,1
-end_of_record
-TN:
-SF:/usr/local/lib/bats-core/tracing.bash
-DA:8,1
-end_of_record
-TN:
-SF:/usr/local/lib/bats-core/tracing.bash
-DA:10,1
-end_of_record
-TN:
-SF:/usr/local/lib/bats-core/tracing.bash
-DA:10,1
-end_of_record
-TN:
-SF:/usr/local/lib/bats-core/tracing.bash
-DA:13,1
-end_of_record
-TN:
-SF:/usr/local/lib/bats-core/tracing.bash
-DA:14,1
-end_of_record
-TN:
-SF:/usr/local/lib/bats-core/tracing.bash
-DA:15,1
-end_of_record
-TN:
-SF:/usr/local/lib/bats-core/tracing.bash
-DA:16,1
-end_of_record
-TN:
-SF:/usr/local/lib/bats-core/tracing.bash
-DA:10,1
-end_of_record
-TN:
-SF:/usr/local/lib/bats-core/tracing.bash
-DA:10,1
-end_of_record
-TN:
-SF:/usr/local/lib/bats-core/tracing.bash
-DA:13,1
-end_of_record
-TN:
-SF:/usr/local/lib/bats-core/tracing.bash
-DA:14,1
-end_of_record
-TN:
-SF:/usr/local/lib/bats-core/tracing.bash
-DA:15,1
-end_of_record
-TN:
-SF:/usr/local/lib/bats-core/tracing.bash
-DA:16,1
-end_of_record
-TN:
-SF:/usr/local/lib/bats-core/tracing.bash
-DA:10,1
-end_of_record
-TN:
-SF:/usr/local/lib/bats-core/tracing.bash
-DA:10,1
-end_of_record
-TN:
-SF:/usr/local/lib/bats-core/tracing.bash
-DA:13,1
+SF:/home/francesco/Develop/Javanile/lcov.sh/lcov.sh
+DA:457,1
 end_of_record
 TN:
-SF:/usr/local/lib/bats-core/tracing.bash
-DA:14,1
+SF:/home/francesco/Develop/Javanile/lcov.sh/lcov.sh
+DA:458,1
 end_of_record
 TN:
-SF:/usr/local/lib/bats-core/tracing.bash
-DA:15,1
+SF:/home/francesco/Develop/Javanile/lcov.sh/lcov.sh
+DA:458,1
 end_of_record
 TN:
-SF:/usr/local/lib/bats-core/tracing.bash
-DA:16,1
+SF:/home/francesco/Develop/Javanile/lcov.sh/lcov.sh
+DA:459,1
 end_of_record
 TN:
-SF:/usr/local/lib/bats-core/tracing.bash
-DA:17,1
+SF:/home/francesco/Develop/Javanile/lcov.sh/lcov.sh
+DA:459,1
 end_of_record
 TN:
-SF:/usr/local/lib/bats-core/tracing.bash
-DA:19,1
+SF:/home/francesco/Develop/Javanile/lcov.sh/lcov.sh
+DA:459,1
 end_of_record
 TN:
-SF:/home/francesco/Develop/Javanile/lcov.sh/test/bats/../../lcov.sh
-DA:453,1
+SF:/home/francesco/Develop/Javanile/lcov.sh/lcov.sh
+DA:459,1
 end_of_record
 STOP
diff --git a/demo.sh b/demo.sh
index d9aa5cf..a565d37 100644
--- a/demo.sh
+++ b/demo.sh
@@ -1,9 +1,8 @@
 #!/usr/bin/env bash
+set -e
 
-if [[ -f deps ]]; then
+if [[ -n "$(grep -e "^/home/francesco/Develop/Javanile/lcov.sh/examples/basic/script-test.s$" "coverage/lcov.files" && true)" ]]; then
   echo "A"
-elif [[ -d deps ]]; then
-  echo "B"
 else
-  echo "C"
+  echo "B"
 fi
diff --git a/lcov.sh b/lcov.sh
index dda1692..5b8dd6f 100755
--- a/lcov.sh
+++ b/lcov.sh
@@ -31,7 +31,7 @@
 set -ef
 
 VERSION="0.1.0"
-LCOV_PS4='+:LCOV_DEBUG:${BASH_SOURCE}:${LINENO}:${FUNCNAME[0]}: '
+LCOV_PS4='+:lcov.sh:${BASH_SOURCE}:${LINENO}:${FUNCNAME[0]}: '
 
 usage () {
   echo "Usage: ./lcov.sh [OPTION]... FILE..."
@@ -185,7 +185,7 @@ lcov_init() {
   local init_info="${lcov_output}/init.info"
 
   get_files "$@" | while IFS= read -r file; do
-    echo "${file}" >> "${lcov_files}"
+    readlink -f "${file}" >> "${lcov_files}"
     lcov_scan "${file}" > "${init_info}"
     [[ -f "${lcov_info}" ]] || lcov_exec -q -a "${init_info}" -o "${lcov_info}" && true
     lcov_exec -q -a "${init_info}" -a "${lcov_info}" -o "${lcov_info}"
@@ -379,9 +379,15 @@ lcov_append_info() {
   #cat "$1" >> /home/francesco/Develop/Javanile/lcov.sh/a.txt
   while IFS= read line || [[ -n "${line}" ]]; do
     if [[ "${line::1}" = "+" ]]; then
-      file=$(echo ${line} | cut -s -d':' -f3)
-      lineno=$(echo ${line} | cut -s -d':' -f4)
-      echo -e "TN:\nSF:${file}\nDA:${lineno},1\nend_of_record" >> "${temp_info}"
+      local scope=$(echo ${line} | cut -s -d':' -f2)
+      if [[ "${scope}" = "lcov.sh" ]]; then
+        file="$(echo "${line}" | cut -s -d':' -f3)"
+        file="$(readlink -f "${file}")"
+        if [[ -n "$(grep -e "^${file}$" "${lcov_files}" && true)" ]]; then
+          lineno=$(echo ${line} | cut -s -d':' -f4)
+          echo -e "TN:\nSF:${file}\nDA:${lineno},1\nend_of_record" >> "${temp_info}"
+        fi
+      fi
     elif [[ "${line}" = "${line_stop}" ]]; then
       if [[ -n "$2" ]]; then
         local info=$(grep . $2 | tail -1)

From 17ad2ba419feceb1a5c1d0135cc2d0adc0616751 Mon Sep 17 00:00:00 2001
From: Francesco Bianco <info.francescobianco@gmail.com>
Date: Wed, 14 Oct 2020 00:04:09 +0200
Subject: [PATCH 14/32] fix missing lcov command

---
 a.txt                | 42 ++++++++++++++++++++++++++++++++++++++++++
 test/bats/test1.bats |  4 ++--
 2 files changed, 44 insertions(+), 2 deletions(-)

diff --git a/a.txt b/a.txt
index f7240fd..0dfcf42 100644
--- a/a.txt
+++ b/a.txt
@@ -40,3 +40,45 @@ SF:/home/francesco/Develop/Javanile/lcov.sh/lcov.sh
 DA:459,1
 end_of_record
 STOP
+START
+TN:
+SF:/home/francesco/Develop/Javanile/lcov.sh/lcov.sh
+DA:457,1
+end_of_record
+TN:
+SF:/home/francesco/Develop/Javanile/lcov.sh/lcov.sh
+DA:457,1
+end_of_record
+TN:
+SF:/home/francesco/Develop/Javanile/lcov.sh/test/bats/test1.sh
+DA:10,1
+end_of_record
+TN:
+SF:/home/francesco/Develop/Javanile/lcov.sh/lcov.sh
+DA:457,1
+end_of_record
+TN:
+SF:/home/francesco/Develop/Javanile/lcov.sh/lcov.sh
+DA:458,1
+end_of_record
+TN:
+SF:/home/francesco/Develop/Javanile/lcov.sh/lcov.sh
+DA:458,1
+end_of_record
+TN:
+SF:/home/francesco/Develop/Javanile/lcov.sh/lcov.sh
+DA:459,1
+end_of_record
+TN:
+SF:/home/francesco/Develop/Javanile/lcov.sh/lcov.sh
+DA:459,1
+end_of_record
+TN:
+SF:/home/francesco/Develop/Javanile/lcov.sh/lcov.sh
+DA:459,1
+end_of_record
+TN:
+SF:/home/francesco/Develop/Javanile/lcov.sh/lcov.sh
+DA:459,1
+end_of_record
+STOP
diff --git a/test/bats/test1.bats b/test/bats/test1.bats
index 994df8d..1aeb2c5 100644
--- a/test/bats/test1.bats
+++ b/test/bats/test1.bats
@@ -10,7 +10,7 @@ load ../../lcov.sh
 }
 
 @test "testing: test1_func2()" {
-    run test1_func1
+    run test1_func2
 
-    [ "${output}" = "wrong" ]
+    [ "${output}" = "TEST1_FUNC2" ]
 }

From 172578bb9aa10f3e6fe224811760c0d4f3f427f7 Mon Sep 17 00:00:00 2001
From: francescobianco <info.francescobianco@gmail.com>
Date: Thu, 15 Oct 2020 00:28:37 +0200
Subject: [PATCH 15/32] test uuid fix #4

---
 Makefile  |  33 ++++++++++++---------
 README.md |   4 +--
 a.txt     |  84 ------------------------------------------------------
 lcov.png  | Bin 47931 -> 0 bytes
 lcov.sh   |  60 ++++++++++++++++++++++----------------
 5 files changed, 56 insertions(+), 125 deletions(-)
 delete mode 100644 a.txt
 delete mode 100644 lcov.png

diff --git a/Makefile b/Makefile
index 93e4948..6531c34 100644
--- a/Makefile
+++ b/Makefile
@@ -1,3 +1,4 @@
+#!make
 
 BIN ?= lcov.sh
 PREFIX ?= /usr/local
@@ -24,26 +25,15 @@ getdeps: deps
 deps:
 	bpkg getdeps
 
-test: deps
-	@bash ./lcov.sh test/*.test.sh -x deps
-
-docker-test:
-	docker-compose run --rm test
-
-release: build-examples
-	git add .
-	git commit -am "Release"
-	git push
-
 qa:
 	curl -sL https://javanile.org/readme-standard/check.sh | bash -
 
-build-examples:
-	bash examples/build.sh
-
 ## -------
 ## Testing
 ## -------
+test: deps
+	@bash ./lcov.sh test/*.test.sh -x deps
+
 test-bats:
 	@rm -fr coverage a.txt
 	@bats test/bats
@@ -51,3 +41,18 @@ test-bats:
 test-get-uuid-function:
 	@rm -fr coverage test/coverage
 	@bash lcov.sh test/get_uuid.test.sh
+
+docker-test:
+	@docker-compose run --rm test
+
+## ----------
+## Operations
+## ----------
+build-examples:
+	bash examples/build.sh
+
+release: build-examples
+	git add .
+	git commit -am "Release"
+	git push
+
diff --git a/README.md b/README.md
index 7b8bafb..04c82d3 100644
--- a/README.md
+++ b/README.md
@@ -1,8 +1,6 @@
 # LCOV.SH
 
-<img align="right" width="400" height="230" src="https://github.com/javanile/lcov.sh/raw/master/lcov.png">
-
-The best LCOV framework around a BASH project
+> The best LCOV framework around a BASH project
 
 ![.github/workflows/super-linter.yml](https://github.com/javanile/lcov.sh/workflows/.github/workflows/super-linter.yml/badge.svg)
 [![Build Status](https://travis-ci.org/javanile/lcov.sh.svg?branch=master)](https://travis-ci.org/javanile/lcov.sh)
diff --git a/a.txt b/a.txt
deleted file mode 100644
index 0dfcf42..0000000
--- a/a.txt
+++ /dev/null
@@ -1,84 +0,0 @@
-START
-TN:
-SF:/home/francesco/Develop/Javanile/lcov.sh/lcov.sh
-DA:457,1
-end_of_record
-TN:
-SF:/home/francesco/Develop/Javanile/lcov.sh/lcov.sh
-DA:457,1
-end_of_record
-TN:
-SF:/home/francesco/Develop/Javanile/lcov.sh/test/bats/test1.sh
-DA:6,1
-end_of_record
-TN:
-SF:/home/francesco/Develop/Javanile/lcov.sh/lcov.sh
-DA:457,1
-end_of_record
-TN:
-SF:/home/francesco/Develop/Javanile/lcov.sh/lcov.sh
-DA:458,1
-end_of_record
-TN:
-SF:/home/francesco/Develop/Javanile/lcov.sh/lcov.sh
-DA:458,1
-end_of_record
-TN:
-SF:/home/francesco/Develop/Javanile/lcov.sh/lcov.sh
-DA:459,1
-end_of_record
-TN:
-SF:/home/francesco/Develop/Javanile/lcov.sh/lcov.sh
-DA:459,1
-end_of_record
-TN:
-SF:/home/francesco/Develop/Javanile/lcov.sh/lcov.sh
-DA:459,1
-end_of_record
-TN:
-SF:/home/francesco/Develop/Javanile/lcov.sh/lcov.sh
-DA:459,1
-end_of_record
-STOP
-START
-TN:
-SF:/home/francesco/Develop/Javanile/lcov.sh/lcov.sh
-DA:457,1
-end_of_record
-TN:
-SF:/home/francesco/Develop/Javanile/lcov.sh/lcov.sh
-DA:457,1
-end_of_record
-TN:
-SF:/home/francesco/Develop/Javanile/lcov.sh/test/bats/test1.sh
-DA:10,1
-end_of_record
-TN:
-SF:/home/francesco/Develop/Javanile/lcov.sh/lcov.sh
-DA:457,1
-end_of_record
-TN:
-SF:/home/francesco/Develop/Javanile/lcov.sh/lcov.sh
-DA:458,1
-end_of_record
-TN:
-SF:/home/francesco/Develop/Javanile/lcov.sh/lcov.sh
-DA:458,1
-end_of_record
-TN:
-SF:/home/francesco/Develop/Javanile/lcov.sh/lcov.sh
-DA:459,1
-end_of_record
-TN:
-SF:/home/francesco/Develop/Javanile/lcov.sh/lcov.sh
-DA:459,1
-end_of_record
-TN:
-SF:/home/francesco/Develop/Javanile/lcov.sh/lcov.sh
-DA:459,1
-end_of_record
-TN:
-SF:/home/francesco/Develop/Javanile/lcov.sh/lcov.sh
-DA:459,1
-end_of_record
-STOP
diff --git a/lcov.png b/lcov.png
deleted file mode 100644
index c3e646b8232b04b447605b2a5011344cbce58dfd..0000000000000000000000000000000000000000
GIT binary patch
diff --git a/lcov.sh b/lcov.sh
index 5b8dd6f..da57569 100755
--- a/lcov.sh
+++ b/lcov.sh
@@ -96,6 +96,7 @@ lcov_log="${lcov_output}/lcov.log"
 lcov_info="${lcov_output}/lcov.info"
 lcov_files="${lcov_output}/lcov.files"
 lcov_test_log="${lcov_output}/test.log"
+lcov_test_out="${lcov_output}/test.out"
 lcov_test_lock="${lcov_output}/test.lock"
 lcov_test_info="${lcov_output}/test.info"
 
@@ -271,6 +272,7 @@ lcov_done() {
 #
 ##
 lcov_test_wait() {
+  [[ -f "${lcov_test_lock}" ]] && echo "A" || echo "B"
   while [[ -f "${lcov_test_lock}" ]]; do sleep 2; done
   touch "${lcov_test_lock}"
   return 0
@@ -307,21 +309,23 @@ lcov_test_stat () {
 lcov_test() {
   if [[ -n "$1" ]]; then
     lcov_test_wait
-    echo -n "  > "
+    echo -n "  > $1"
     if [[ -f "$1" ]]; then
-      lcov_test_debug "$1" "${lcov_output}/test.log" "${lcov_output}/test.out"
-      lcov_test_check "$?"
+      lcov_test_debug "$1" && true
+      lcov_test_check "$?" && true
     else
       if [[ -d "$1" ]]; then
         echo -e "${skip_flag} $1/: is directory.";
       else
         echo -e "${skip_flag} $1: file not found.";
       fi
-      shift
-      lcov_test_next
       lcov_test_stat 1 0 0 1
-      lcov_test "$@"
     fi
+    shift
+    lcov_test_next
+    echo "A1"
+    lcov_test "$@"
+    echo "A2"
   fi
   return 0
 }
@@ -340,10 +344,13 @@ lcov_test_debug () {
   export PS4="${LCOV_PS4}"
 
   ## Execute test as bash script and capture output and logs
-  bash -x "$1" > "$3" 2> "$2" && true
+  bash -x "$1" > "${lcov_test_out}" 2> "${lcov_test_log}" && true
+  exit_code=$?
 
   export LCOV_DEBUG="${orig_lcov_debug}"
   export PS4="${orig_ps4}"
+
+  return "${exit_code}"
 }
 
 ##
@@ -351,17 +358,16 @@ lcov_test_debug () {
 ##
 lcov_test_check() {
   local exit_code="$1"
-
+  echo "CHE ${exit_code}"
   if [[ ${exit_code} -eq 0 ]]; then
-    lcov_append_info "${lcov_output}/test.log" "${lcov_output}/test.out"
+    echo "KK"
+    lcov_append_info "${lcov_test_log}" "${lcov_test_out}"
+    echo "LL"
   else
     local info="$(grep "." "${lcov_output}/test.out" | tail -1)"
     [[ -z "${info}" ]] && info="$(grep "." "${lcov_output}/test.log" | tail -1)"
     echo -e "${fail_flag} $1: '${info}' (exit ${exit_code})"
-    shift
     lcov_test_stat 1 0 1 0
-    lcov_test_next
-    lcov_test "$@"
   fi
 }
 
@@ -377,9 +383,13 @@ lcov_append_info() {
   echo "${line_stop}" >> "$1"
   #echo "STOP" >> /home/francesco/Develop/Javanile/lcov.sh/a.txt
   #cat "$1" >> /home/francesco/Develop/Javanile/lcov.sh/a.txt
+  echo "YY"
+  index=0
   while IFS= read line || [[ -n "${line}" ]]; do
+    index=$((index+1))
+    echo "$index"
     if [[ "${line::1}" = "+" ]]; then
-      local scope=$(echo ${line} | cut -s -d':' -f2)
+      scope=$(echo ${line} | cut -s -d':' -f2)
       if [[ "${scope}" = "lcov.sh" ]]; then
         file="$(echo "${line}" | cut -s -d':' -f3)"
         file="$(readlink -f "${file}")"
@@ -390,18 +400,13 @@ lcov_append_info() {
       fi
     elif [[ "${line}" = "${line_stop}" ]]; then
       if [[ -n "$2" ]]; then
-        local info=$(grep . $2 | tail -1)
+        info=$(grep . $2 | tail -1)
         echo -e "${done_flag} $1: '${info}' (ok)";
       fi
-      echo "START" >> /home/francesco/Develop/Javanile/lcov.sh/a.txt
-      cat "${temp_info}" >> /home/francesco/Develop/Javanile/lcov.sh/a.txt
-      echo "STOP" >> /home/francesco/Develop/Javanile/lcov.sh/a.txt
+      echo "LL"
       lcov_exec -q -a "${temp_info}" -a "${lcov_info}" -o "${lcov_info}"
       rm -f "${temp_info}"
-      shift
       lcov_test_stat 1 1 0 0
-      lcov_test_next
-      lcov_test "$@"
     fi
   done < "$1"
 }
@@ -426,6 +431,17 @@ run () {
   export PS4="${orig_ps4}"
 }
 
+setup() {
+  lcov_setup
+}
+
+lcov_setup() {
+  if [[ -z "${LCOV_INIT}" ]]; then
+    export LCOV_INIT=1
+    lcov_init "${lcov_coverage[@]}"
+  fi
+}
+
 ##
 # Run function used by BATS test case.
 #
@@ -492,10 +508,6 @@ main() {
 ## Bypass entry-point if file was sourced
 ## than expose LCOV.SH and BATS functions
 if [[ "${BASH_SOURCE[0]}" != "${0}" ]]; then
-  if [[ -z "${LCOV_INIT}" ]]; then
-    export LCOV_INIT=1
-    lcov_init "${lcov_coverage[@]}"
-  fi
   export -f run
 else
   main "$@"

From 57e727aae3f985e0f919c2f8f80dac03a30e1585 Mon Sep 17 00:00:00 2001
From: francescobianco <info.francescobianco@gmail.com>
Date: Thu, 15 Oct 2020 00:37:07 +0200
Subject: [PATCH 16/32] test uuid fix #4

---
 lcov.sh | 21 +++++++++------------
 1 file changed, 9 insertions(+), 12 deletions(-)

diff --git a/lcov.sh b/lcov.sh
index da57569..051be27 100755
--- a/lcov.sh
+++ b/lcov.sh
@@ -98,6 +98,7 @@ lcov_files="${lcov_output}/lcov.files"
 lcov_test_log="${lcov_output}/test.log"
 lcov_test_out="${lcov_output}/test.out"
 lcov_test_lock="${lcov_output}/test.lock"
+lcov_test_stat="${lcov_output}/test.stat"
 lcov_test_info="${lcov_output}/test.info"
 
 ##
@@ -247,6 +248,7 @@ lcov_scan() {
 lcov_done() {
   local stat="0 0 0 0"
   [[ -f "${lcov_test_stat}" ]] && stat="$(cat ${lcov_test_stat} && true)"
+
   test="$(echo ${stat} | cut -s -d' ' -f1)"
   done="$(echo ${stat} | cut -s -d' ' -f2)"
   fail="$(echo ${stat} | cut -s -d' ' -f3)"
@@ -272,7 +274,6 @@ lcov_done() {
 #
 ##
 lcov_test_wait() {
-  [[ -f "${lcov_test_lock}" ]] && echo "A" || echo "B"
   while [[ -f "${lcov_test_lock}" ]]; do sleep 2; done
   touch "${lcov_test_lock}"
   return 0
@@ -309,10 +310,10 @@ lcov_test_stat () {
 lcov_test() {
   if [[ -n "$1" ]]; then
     lcov_test_wait
-    echo -n "  > $1"
+    echo -n "  > "
     if [[ -f "$1" ]]; then
       lcov_test_debug "$1" && true
-      lcov_test_check "$?" && true
+      lcov_test_check "$1" "$?"
     else
       if [[ -d "$1" ]]; then
         echo -e "${skip_flag} $1/: is directory.";
@@ -323,9 +324,7 @@ lcov_test() {
     fi
     shift
     lcov_test_next
-    echo "A1"
     lcov_test "$@"
-    echo "A2"
   fi
   return 0
 }
@@ -357,16 +356,14 @@ lcov_test_debug () {
 #
 ##
 lcov_test_check() {
-  local exit_code="$1"
-  echo "CHE ${exit_code}"
+  local test="$1"
+  local exit_code="$2"
   if [[ ${exit_code} -eq 0 ]]; then
-    echo "KK"
     lcov_append_info "${lcov_test_log}" "${lcov_test_out}"
-    echo "LL"
   else
-    local info="$(grep "." "${lcov_output}/test.out" | tail -1)"
-    [[ -z "${info}" ]] && info="$(grep "." "${lcov_output}/test.log" | tail -1)"
-    echo -e "${fail_flag} $1: '${info}' (exit ${exit_code})"
+    local info="$(grep "." "${lcov_test_out}" | tail -1)"
+    [[ -z "${info}" ]] && info="$(grep "." "${lcov_test_log}" | tail -1)"
+    echo -e "${fail_flag} ${test}: '${info}' (exit ${exit_code})"
     lcov_test_stat 1 0 1 0
   fi
 }

From 65a39efe258b2907c280142ac94bf1df23094e4c Mon Sep 17 00:00:00 2001
From: Francesco Bianco <info.francescobianco@gmail.com>
Date: Mon, 19 Oct 2020 15:56:07 +0200
Subject: [PATCH 17/32] fix follow

---
 test/get_files.test.sh | 2 ++
 test/get_uuid.test.sh  | 2 ++
 test/lcov_init.test.sh | 2 ++
 test/lcov_scan.test.sh | 2 ++
 test/run.test.sh       | 2 ++
 5 files changed, 10 insertions(+)

diff --git a/test/get_files.test.sh b/test/get_files.test.sh
index c65c2eb..4af7826 100755
--- a/test/get_files.test.sh
+++ b/test/get_files.test.sh
@@ -1,7 +1,9 @@
 #!/usr/bin/env bash
 set -e
 
+# shellcheck disable=SC1091
 source ./deps/pipetest/pipetest.sh
+# shellcheck source=./lcov.sh
 source ./lcov.sh -o test/coverage
 
 get_files ./*.md !./*.sh | assert_equals "$(cat <<EOF
diff --git a/test/get_uuid.test.sh b/test/get_uuid.test.sh
index 3b12a9b..d0bca46 100755
--- a/test/get_uuid.test.sh
+++ b/test/get_uuid.test.sh
@@ -1,7 +1,9 @@
 #!/usr/bin/env bash
 set -e
 
+# shellcheck disable=SC1091
 source ./deps/pipetest/pipetest.sh
+# shellcheck source=./lcov.sh
 source ./lcov.sh -o test/coverage
 
 get_uuid ./*.md !./*.sh | wc -c | assert_equals 37
diff --git a/test/lcov_init.test.sh b/test/lcov_init.test.sh
index f901d74..0b0037f 100755
--- a/test/lcov_init.test.sh
+++ b/test/lcov_init.test.sh
@@ -1,7 +1,9 @@
 #!/usr/bin/env bash
 set -e
 
+# shellcheck disable=SC1091
 source ./deps/pipetest/pipetest.sh
+# shellcheck source=./lcov.sh
 source ./lcov.sh -o test/coverage
 
 rm -fr ./test/coverage
diff --git a/test/lcov_scan.test.sh b/test/lcov_scan.test.sh
index 29a1970..9b31089 100755
--- a/test/lcov_scan.test.sh
+++ b/test/lcov_scan.test.sh
@@ -1,7 +1,9 @@
 #!/usr/bin/env bash
 set -e
 
+# shellcheck disable=SC1091
 source ./deps/pipetest/pipetest.sh
+# shellcheck source=./lcov.sh
 source ./lcov.sh -o test/coverage
 
 lcov_scan test/fixtures/sample.sh | assert_equals "$(cat <<EOF
diff --git a/test/run.test.sh b/test/run.test.sh
index 6ba2aa8..6fe6362 100755
--- a/test/run.test.sh
+++ b/test/run.test.sh
@@ -1,7 +1,9 @@
 #!/usr/bin/env bash
 set -e
 
+# shellcheck disable=SC1091
 source ./deps/pipetest/pipetest.sh
+# shellcheck source=./lcov.sh
 source ./lcov.sh -o test/coverage
 
 run echo "Hello World!"

From 252d2bfb7c846c306a719f1ffc7f37bfe6c098bb Mon Sep 17 00:00:00 2001
From: Francesco Bianco <info.francescobianco@gmail.com>
Date: Mon, 19 Oct 2020 16:01:07 +0200
Subject: [PATCH 18/32] fix follow

---
 lcov.sh | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/lcov.sh b/lcov.sh
index 051be27..676c9b9 100755
--- a/lcov.sh
+++ b/lcov.sh
@@ -382,7 +382,7 @@ lcov_append_info() {
   #cat "$1" >> /home/francesco/Develop/Javanile/lcov.sh/a.txt
   echo "YY"
   index=0
-  while IFS= read line || [[ -n "${line}" ]]; do
+  while IFS= read -r line || [[ -n "${line}" ]]; do
     index=$((index+1))
     echo "$index"
     if [[ "${line::1}" = "+" ]]; then
@@ -391,13 +391,13 @@ lcov_append_info() {
         file="$(echo "${line}" | cut -s -d':' -f3)"
         file="$(readlink -f "${file}")"
         if [[ -n "$(grep -e "^${file}$" "${lcov_files}" && true)" ]]; then
-          lineno=$(echo ${line} | cut -s -d':' -f4)
+          lineno=$(echo "${line}" | cut -s -d':' -f4)
           echo -e "TN:\nSF:${file}\nDA:${lineno},1\nend_of_record" >> "${temp_info}"
         fi
       fi
     elif [[ "${line}" = "${line_stop}" ]]; then
       if [[ -n "$2" ]]; then
-        info=$(grep . $2 | tail -1)
+        info=$(grep . "$2" | tail -1)
         echo -e "${done_flag} $1: '${info}' (ok)";
       fi
       echo "LL"
@@ -422,7 +422,7 @@ run () {
   export LCOV_DEBUG=1
   export PS4="${LCOV_PS4}"
 
-  lcov_bats_run "${@}" 2>> ${log_file}
+  lcov_bats_run "${@}" 2>> "${log_file}"
 
   export LCOV_DEBUG="${orig_lcov_debug}"
   export PS4="${orig_ps4}"
@@ -467,7 +467,9 @@ lcov_bats_run() {
   set +eET
   local orig_ifs="$IFS"
   [[ "${flags}" =~ x ]] || set -x
+  # shellcheck disable=SC2034
   output="$("$@")"
+  # shellcheck disable=SC2034
   status="$?"
   [[ "${flags}" =~ x ]] || set +x
   # shellcheck disable=SC2034,SC2206

From 9e60c5461963559e230f3cdad981ec92fe230d57 Mon Sep 17 00:00:00 2001
From: francescobianco <info.francescobianco@gmail.com>
Date: Tue, 20 Oct 2020 00:12:52 +0200
Subject: [PATCH 19/32] test uuid fix #4

---
 demo.sh                 |  8 --------
 lcov.sh                 | 17 +++++------------
 test/fixtures/sample.md |  0
 test/get_files.test.sh  |  6 +++---
 test/usage.test.sh      | 23 +++++++++++++++++++++++
 5 files changed, 31 insertions(+), 23 deletions(-)
 delete mode 100644 demo.sh
 create mode 100644 test/fixtures/sample.md
 create mode 100755 test/usage.test.sh

diff --git a/demo.sh b/demo.sh
deleted file mode 100644
index a565d37..0000000
--- a/demo.sh
+++ /dev/null
@@ -1,8 +0,0 @@
-#!/usr/bin/env bash
-set -e
-
-if [[ -n "$(grep -e "^/home/francesco/Develop/Javanile/lcov.sh/examples/basic/script-test.s$" "coverage/lcov.files" && true)" ]]; then
-  echo "A"
-else
-  echo "B"
-fi
diff --git a/lcov.sh b/lcov.sh
index 676c9b9..595dd46 100755
--- a/lcov.sh
+++ b/lcov.sh
@@ -33,7 +33,7 @@ set -ef
 VERSION="0.1.0"
 LCOV_PS4='+:lcov.sh:${BASH_SOURCE}:${LINENO}:${FUNCNAME[0]}: '
 
-usage () {
+usage() {
   echo "Usage: ./lcov.sh [OPTION]... FILE..."
   echo ""
   echo "Executes FILE as a test case also collect each LCOV info and generate HTML report"
@@ -305,7 +305,7 @@ lcov_test_stat () {
 }
 
 ##
-# Execute testcase and process LCOV info.
+# Execute test case and process LCOV info.
 ##
 lcov_test() {
   if [[ -n "$1" ]]; then
@@ -360,6 +360,9 @@ lcov_test_check() {
   local exit_code="$2"
   if [[ ${exit_code} -eq 0 ]]; then
     lcov_append_info "${lcov_test_log}" "${lcov_test_out}"
+    local info=$(grep . "${lcov_test_out}" | tail -1)
+    echo -e "${done_flag} ${test}: '${info}' (ok)";
+    lcov_test_stat 1 1 0 0
   else
     local info="$(grep "." "${lcov_test_out}" | tail -1)"
     [[ -z "${info}" ]] && info="$(grep "." "${lcov_test_log}" | tail -1)"
@@ -380,11 +383,7 @@ lcov_append_info() {
   echo "${line_stop}" >> "$1"
   #echo "STOP" >> /home/francesco/Develop/Javanile/lcov.sh/a.txt
   #cat "$1" >> /home/francesco/Develop/Javanile/lcov.sh/a.txt
-  echo "YY"
-  index=0
   while IFS= read -r line || [[ -n "${line}" ]]; do
-    index=$((index+1))
-    echo "$index"
     if [[ "${line::1}" = "+" ]]; then
       scope=$(echo ${line} | cut -s -d':' -f2)
       if [[ "${scope}" = "lcov.sh" ]]; then
@@ -396,14 +395,8 @@ lcov_append_info() {
         fi
       fi
     elif [[ "${line}" = "${line_stop}" ]]; then
-      if [[ -n "$2" ]]; then
-        info=$(grep . "$2" | tail -1)
-        echo -e "${done_flag} $1: '${info}' (ok)";
-      fi
-      echo "LL"
       lcov_exec -q -a "${temp_info}" -a "${lcov_info}" -o "${lcov_info}"
       rm -f "${temp_info}"
-      lcov_test_stat 1 1 0 0
     fi
   done < "$1"
 }
diff --git a/test/fixtures/sample.md b/test/fixtures/sample.md
new file mode 100644
index 0000000..e69de29
diff --git a/test/get_files.test.sh b/test/get_files.test.sh
index 4af7826..5584cc7 100755
--- a/test/get_files.test.sh
+++ b/test/get_files.test.sh
@@ -6,12 +6,12 @@ source ./deps/pipetest/pipetest.sh
 # shellcheck source=./lcov.sh
 source ./lcov.sh -o test/coverage
 
-get_files ./*.md !./*.sh | assert_equals "$(cat <<EOF
-./README.md
+get_files ./test/fixtures/*.md !./*.sh | assert_equals "$(cat <<EOF
+./test/fixtures/sample.md
 EOF
 )"
 
-get_files ./test/fixtures/*.sh !deps !lcov.sh !*test.sh | sort | assert_equals "$(cat <<EOF
+get_files ./test/fixtures/*.sh !deps !lcov.sh !*test.sh !example* !test/bats* | sort | assert_equals "$(cat <<EOF
 ./test/fixtures/sample.sh
 ./test/fixtures/test1.sh
 ./test/fixtures/test2.sh
diff --git a/test/usage.test.sh b/test/usage.test.sh
new file mode 100755
index 0000000..18d5be9
--- /dev/null
+++ b/test/usage.test.sh
@@ -0,0 +1,23 @@
+#!/usr/bin/env bash
+set -e
+
+# shellcheck disable=SC1091
+source ./deps/pipetest/pipetest.sh
+# shellcheck source=./lcov.sh
+source ./lcov.sh -o test/coverage
+
+usage | assert_equals "$(cat <<EOF
+Usage: ./lcov.sh [OPTION]... FILE...
+
+Executes FILE as a test case also collect each LCOV info and generate HTML report
+
+List of available options
+  -e, --extension EXT     Coverage of every *.EXT file (default: sh)
+  -i, --include PATH      Include files matching PATH
+  -x, --exclude PATH      Exclude files matching PATH
+  -o, --output OUTDIR     Write HTML output to OUTDIR
+  -h, --help              Display this help and exit
+  -v, --version           Display current version
+Documentation can be found at https://github.com/javanile/lcov.sh
+EOF
+)"

From cfb2dd4c955e5b1c4834b16587f94b3dfe83c8c8 Mon Sep 17 00:00:00 2001
From: francescobianco <info.francescobianco@gmail.com>
Date: Sun, 7 Feb 2021 12:37:18 +0100
Subject: [PATCH 20/32] wip

---
 .travis.yml                    |  2 ++
 Makefile                       |  3 +++
 _config.yml                    |  2 --
 a1.txt                         |  3 ---
 test/travis/docker-compose.yml |  8 ++++++++
 test/travis/test-runner.sh     | 18 ++++++++++++++++++
 6 files changed, 31 insertions(+), 5 deletions(-)
 delete mode 100644 _config.yml
 delete mode 100644 a1.txt
 create mode 100644 test/travis/docker-compose.yml
 create mode 100755 test/travis/test-runner.sh

diff --git a/.travis.yml b/.travis.yml
index 52093a2..8908915 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -5,6 +5,8 @@ language: generic
 
 env:
   - DOCKER_COMPOSE_VERSION=1.22.0
+  - BASH_VERSION=4
+  - BASH_VERSION=5
 
 before_install:
   - bash <(curl -sL https://git.io/get-bpkg)
diff --git a/Makefile b/Makefile
index 6531c34..f0fe5a4 100644
--- a/Makefile
+++ b/Makefile
@@ -34,6 +34,9 @@ qa:
 test: deps
 	@bash ./lcov.sh test/*.test.sh -x deps
 
+test-travis:
+	@docker-compose -f test/travis/docker-compose.yml run --rm travis test/travis/test-runner.sh
+
 test-bats:
 	@rm -fr coverage a.txt
 	@bats test/bats
diff --git a/_config.yml b/_config.yml
deleted file mode 100644
index cff2e1e..0000000
--- a/_config.yml
+++ /dev/null
@@ -1,2 +0,0 @@
-title: LCOV.SH
-remote_theme: tareqdandachi/jekyll-shell-theme
diff --git a/a1.txt b/a1.txt
deleted file mode 100644
index 9dff996..0000000
--- a/a1.txt
+++ /dev/null
@@ -1,3 +0,0 @@
-lcov: ERROR: no valid records found in tracefile .tmp/temp.info
-lcov: ERROR: no valid records found in tracefile .tmp/temp.info
-lcov: ERROR: no valid records found in tracefile .tmp/temp.info
diff --git a/test/travis/docker-compose.yml b/test/travis/docker-compose.yml
new file mode 100644
index 0000000..0bd31ed
--- /dev/null
+++ b/test/travis/docker-compose.yml
@@ -0,0 +1,8 @@
+version: "3"
+
+services:
+  travis:
+    image: bash:${BASH_VERSION:-5}
+    working_dir: /lcov.sh
+    volumes:
+      - ../..:/lcov.sh
diff --git a/test/travis/test-runner.sh b/test/travis/test-runner.sh
new file mode 100755
index 0000000..39cd848
--- /dev/null
+++ b/test/travis/test-runner.sh
@@ -0,0 +1,18 @@
+#!/usr/bin/env bash
+set -e
+
+## Alpine
+if command -v apk &> /dev/null; then
+  apk add \
+    --no-cache \
+    --repository http://dl-cdn.alpinelinux.org/alpine/edge/testing \
+    --repository http://dl-cdn.alpinelinux.org/alpine/edge/main \
+    make lcov
+fi
+
+echo ""
+echo "========================================"
+bash --version
+echo "========================================"
+
+./lcov.sh test

From 7c63ab2a4faead094497de8d407f4275a9692c53 Mon Sep 17 00:00:00 2001
From: Francesco Bianco <info.francescobianco@gmail.com>
Date: Sun, 7 Feb 2021 15:35:40 +0100
Subject: [PATCH 21/32] Update .travis.yml

---
 .travis.yml | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/.travis.yml b/.travis.yml
index 8908915..d2767ae 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -3,6 +3,10 @@ group: stable
 dist: trusty
 language: generic
 
+branches:
+  only:
+    - bats
+
 env:
   - DOCKER_COMPOSE_VERSION=1.22.0
   - BASH_VERSION=4

From e3da6f99e88c3b4f311c0ba9c439c16e9379e4b0 Mon Sep 17 00:00:00 2001
From: Francesco Bianco <info.francescobianco@gmail.com>
Date: Sun, 7 Feb 2021 15:41:22 +0100
Subject: [PATCH 22/32] Update .travis.yml

---
 .travis.yml | 1 -
 1 file changed, 1 deletion(-)

diff --git a/.travis.yml b/.travis.yml
index d2767ae..9fd9b15 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -8,7 +8,6 @@ branches:
     - bats
 
 env:
-  - DOCKER_COMPOSE_VERSION=1.22.0
   - BASH_VERSION=4
   - BASH_VERSION=5
 

From f5f07f84a42098757d54e5e4dd8c6f17d0fae75e Mon Sep 17 00:00:00 2001
From: francescobianco <info.francescobianco@gmail.com>
Date: Sun, 7 Feb 2021 16:48:39 +0100
Subject: [PATCH 23/32] Release

---
 .travis.yml |  4 +---
 Makefile    |  4 ++--
 index.md    | 10 ++++++++++
 3 files changed, 13 insertions(+), 5 deletions(-)
 create mode 100644 index.md

diff --git a/.travis.yml b/.travis.yml
index 8908915..2ced74b 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -4,16 +4,14 @@ dist: trusty
 language: generic
 
 env:
-  - DOCKER_COMPOSE_VERSION=1.22.0
   - BASH_VERSION=4
   - BASH_VERSION=5
 
 before_install:
-  - bash <(curl -sL https://git.io/get-bpkg)
   - bash <(curl -sL https://git.io/get-docker-compose)
 
 script:
-  - make docker-test
+  - make test-travis
 
 after_success:
   - bash <(curl -s https://codecov.io/bash)
diff --git a/Makefile b/Makefile
index f0fe5a4..768cb26 100644
--- a/Makefile
+++ b/Makefile
@@ -52,10 +52,10 @@ docker-test:
 ## Operations
 ## ----------
 build-examples:
-	bash examples/build.sh
+	bash docs/examples/build.sh
 
 release: build-examples
 	git add .
-	git commit -am "Release"
+	git commit -am "Release" && true
 	git push
 
diff --git a/index.md b/index.md
new file mode 100644
index 0000000..7c2f30c
--- /dev/null
+++ b/index.md
@@ -0,0 +1,10 @@
+> File: ` script.sh `
+```bash
+```
+> File: ` script-test.sh `
+```bash
+```
+```
+$ ../../lcov.sh script-test.sh
+```
+<iframe width="100%" height="400" src="coverage/basic"></iframe>

From 71af086581e148fcd0efe7a03a8c8a4dd9488265 Mon Sep 17 00:00:00 2001
From: francescobianco <info.francescobianco@gmail.com>
Date: Sun, 7 Feb 2021 16:49:55 +0100
Subject: [PATCH 24/32] Release

---
 docs/examples/build.sh | 2 +-
 index.md               | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/docs/examples/build.sh b/docs/examples/build.sh
index 304892f..13787b3 100644
--- a/docs/examples/build.sh
+++ b/docs/examples/build.sh
@@ -22,7 +22,7 @@ cd examples/basic
     rm -fr coverage
     code script.sh
     code script-test.sh
-    dump ../../lcov.sh script-test.sh
+    dump ../../../lcov.sh script-test.sh
     echo '<iframe width="100%" height="400" src="coverage/basic"></iframe>'
 ) > index.md
 cd ../..
diff --git a/index.md b/index.md
index 7c2f30c..11519e0 100644
--- a/index.md
+++ b/index.md
@@ -5,6 +5,6 @@
 ```bash
 ```
 ```
-$ ../../lcov.sh script-test.sh
+$ ../../../lcov.sh script-test.sh
 ```
 <iframe width="100%" height="400" src="coverage/basic"></iframe>

From 1be7de9935de702c1bf3c0f4e37113087478f55c Mon Sep 17 00:00:00 2001
From: Francesco Bianco <francescobianco@opencrmitalia.com>
Date: Sun, 7 Feb 2021 18:40:39 +0100
Subject: [PATCH 25/32] fix follow

---
 .gitignore                 |  1 +
 CNAME                      |  1 -
 Makefile                   | 18 ++++++++--------
 index.md                   | 10 ---------
 io.txt                     | 14 -------------
 lcov.sh                    | 42 ++++++++++++++++++++++++++++++++------
 lcov_redirect_log          |  1 -
 log.log                    | 10 ---------
 stderr.log                 |  3 ---
 stdout.log                 |  7 -------
 test/bats/test1.bats       |  8 +++++---
 test/bats/test1.sh         |  2 +-
 test/bats/test2.bats       | 18 ++++++++++++++++
 test/bats/test2.sh         | 11 ++++++++++
 test/travis/test-runner.sh |  3 +--
 15 files changed, 82 insertions(+), 67 deletions(-)
 delete mode 100644 CNAME
 delete mode 100644 index.md
 delete mode 100644 io.txt
 delete mode 100644 lcov_redirect_log
 delete mode 100644 log.log
 delete mode 100644 stderr.log
 delete mode 100644 stdout.log
 create mode 100644 test/bats/test2.bats
 create mode 100644 test/bats/test2.sh

diff --git a/.gitignore b/.gitignore
index 8b135b0..bb0527f 100644
--- a/.gitignore
+++ b/.gitignore
@@ -4,3 +4,4 @@
 coverage/
 !examples/*/coverage/
 deps/
+*.log
diff --git a/CNAME b/CNAME
deleted file mode 100644
index 6bf636b..0000000
--- a/CNAME
+++ /dev/null
@@ -1 +0,0 @@
-lcov.sh
\ No newline at end of file
diff --git a/Makefile b/Makefile
index 768cb26..7a286cf 100644
--- a/Makefile
+++ b/Makefile
@@ -28,9 +28,9 @@ deps:
 qa:
 	curl -sL https://javanile.org/readme-standard/check.sh | bash -
 
-## -------
+## =======
 ## Testing
-## -------
+## =======
 test: deps
 	@bash ./lcov.sh test/*.test.sh -x deps
 
@@ -38,24 +38,24 @@ test-travis:
 	@docker-compose -f test/travis/docker-compose.yml run --rm travis test/travis/test-runner.sh
 
 test-bats:
-	@rm -fr coverage a.txt
-	@bats test/bats
+	@rm -fr coverage lcov.log
+	@bats test/bats/*
 
 test-get-uuid-function:
 	@rm -fr coverage test/coverage
 	@bash lcov.sh test/get_uuid.test.sh
 
-docker-test:
-	@docker-compose run --rm test
+test-docker:
+	@docker-compose run --rm -u $$(id -u) test
 
-## ----------
+## ==========
 ## Operations
-## ----------
+## ==========
 build-examples:
 	bash docs/examples/build.sh
 
 release: build-examples
+	git pull
 	git add .
 	git commit -am "Release" && true
 	git push
-
diff --git a/index.md b/index.md
deleted file mode 100644
index 11519e0..0000000
--- a/index.md
+++ /dev/null
@@ -1,10 +0,0 @@
-> File: ` script.sh `
-```bash
-```
-> File: ` script-test.sh `
-```bash
-```
-```
-$ ../../../lcov.sh script-test.sh
-```
-<iframe width="100%" height="400" src="coverage/basic"></iframe>
diff --git a/io.txt b/io.txt
deleted file mode 100644
index 23d866e..0000000
--- a/io.txt
+++ /dev/null
@@ -1,14 +0,0 @@
-----
-EXI: 1
-----
-EXI: 
-----
-EXI: 1
-----
-EXI: 
-----
-EXI: 1
-----
-EXI: 
-----
-EXI: 
diff --git a/lcov.sh b/lcov.sh
index d1973f1..9d07e97 100755
--- a/lcov.sh
+++ b/lcov.sh
@@ -43,6 +43,7 @@ usage() {
   echo "  -i, --include PATH      Include files matching PATH"
   echo "  -x, --exclude PATH      Exclude files matching PATH"
   echo "  -o, --output OUTDIR     Write HTML output to OUTDIR"
+  echo "  -l, --log FILE          Write log messages to FILE"
   echo "  -h, --help              Display this help and exit"
   echo "  -v, --version           Display current version"
   echo ""
@@ -65,8 +66,9 @@ esac
 lcov_coverage=()
 lcov_extension=sh
 lcov_output=coverage
+lcov_debug_log=${LCOV_DEBUG_LOG}
 lcov_temp_dir=$(mktemp -d -t lcov-sh-XXXXXXXXXXXX)
-if [[ -z "LCOV_DEBUG_NO_COLOR" ]]; then
+if [[ -z "${LCOV_DEBUG_NO_COLOR}" ]]; then
   skip_flag="${escape}[37m(skip)${escape}[0m"
   done_flag="${escape}[1m${escape}[32m(done)${escape}[0m"
   fail_flag="${escape}[1m${escape}[31m(fail)${escape}[0m"
@@ -75,7 +77,7 @@ else
   done_flag="DONE"
   fail_flag="FAIL"
 fi
-options=$(${getopt} -n lcov.sh -o i:e:x:o:vh -l extension:,include:,exclude:,output:,version,help -- "$@")
+options=$(${getopt} -n lcov.sh -o i:e:x:o:l:vh -l extension:,include:,exclude:,output:,log:,version,help -- "$@")
 
 eval set -- "${options}"
 
@@ -85,6 +87,7 @@ while true; do
     -i|--include) shift; lcov_coverage+=("$1") ;;
     -x|--exclude) shift; lcov_coverage+=("!$1") ;;
     -e|--extension) shift; lcov_extension=$1 ;;
+    -l|--log) shift; lcov_log=$1 ;;
     -v|--version) echo "LCOV.SH version ${VERSION}"; exit ;;
     -h|--help) usage; exit ;;
     --) shift; break ;;
@@ -147,7 +150,21 @@ get_files () {
 ##
 #
 ##
-function lcov_error () {
+log() {
+  if [[ -n "${lcov_debug_log}" ]]; then
+    if [[ ! -f "${lcov_debug_log}" ]]; then
+      touch "${lcov_debug_log}"
+      lcov_debug_log="$(realpath "${lcov_debug_log}")"
+      echo "$(date +"%F %T") INIT_LOG ${lcov_debug_log}" >> "${lcov_debug_log}"
+    fi
+    echo "$(date +"%F %T") $@" >> "${lcov_debug_log}"
+  fi
+}
+
+##
+#
+##
+lcov_error() {
    echo "--> $1"
    local i
    local stack_size=${#FUNCNAME[@]}
@@ -402,7 +419,10 @@ lcov_append_info() {
 # Run function used inside BATS test case.
 #
 ##
-run () {
+run() {
+  log "BATS_RUN ${@}"
+  #declare -p >> ${lcov_debug_log}
+
   local orig_ps4="${PS4}"
   local orig_lcov_debug="${LCOV_DEBUG}"
   local log_file="${lcov_temp_dir}/bats_${BATS_SUITE_TEST_NUMBER}_${BATS_TEST_NUMBER}.log"
@@ -414,14 +434,23 @@ run () {
 
   lcov_bats_run "${@}" 2>> "${log_file}"
 
+  #log "BATS_OUTPUT=${output}"
+  log "BATS_STATUS=${status}"
+
   export LCOV_DEBUG="${orig_lcov_debug}"
   export PS4="${orig_ps4}"
 }
 
+##
+#
+##
 setup() {
   lcov_setup
 }
 
+##
+#
+##
 lcov_setup() {
   if [[ -z "${LCOV_INIT}" ]]; then
     export LCOV_INIT=1
@@ -442,6 +471,7 @@ teardown() {
 ##
 lcov_teardown() {
   local log_file="${lcov_temp_dir}/bats_${BATS_SUITE_TEST_NUMBER}_${BATS_TEST_NUMBER}.log"
+  log "BATS_TEARDOWN (${BATS_TEST_COMPLETED}) ${log_file}"
   if [[ "${BATS_TEST_COMPLETED}" = 1 ]]; then
     lcov_append_info "${log_file}"
   fi
@@ -499,6 +529,6 @@ main() {
 if [[ "${BASH_SOURCE[0]}" != "${0}" ]]; then
   export -f run
 else
-    main "$@"
-    exit "$?"
+  main "$@"
+  exit "$?"
 fi
diff --git a/lcov_redirect_log b/lcov_redirect_log
deleted file mode 100644
index e61ef7b..0000000
--- a/lcov_redirect_log
+++ /dev/null
@@ -1 +0,0 @@
-aa
diff --git a/log.log b/log.log
deleted file mode 100644
index f8e75d7..0000000
--- a/log.log
+++ /dev/null
@@ -1,10 +0,0 @@
->>>  aa
->>>  aa
->>>  ++:/Users/francesco/Develop/Javanile/lcov.sh/test/bats/test1.sh:6:test1_func1: echo TEST1_FUNC1
->>>  TEST1_FUNC1
->>>  aa
->>>  ++:/Users/francesco/Develop/Javanile/lcov.sh/test/bats/test1.sh:7:test1_func1: echo -n TEST1_FUNC1
->>>  aa
->>>  ++:/Users/francesco/Develop/Javanile/lcov.sh/test/bats/test1.sh:7:test1_func1: echo -n TEST1_FUNC1
->>>  aa
->>>  ++:/Users/francesco/Develop/Javanile/lcov.sh/test/bats/test1.sh:7:test1_func1: echo -n TEST1_FUNC1
diff --git a/stderr.log b/stderr.log
deleted file mode 100644
index 67c75d6..0000000
--- a/stderr.log
+++ /dev/null
@@ -1,3 +0,0 @@
-+::0:: echo
-+::0:: echo
-+::0:: echo
diff --git a/stdout.log b/stdout.log
deleted file mode 100644
index f119ff2..0000000
--- a/stdout.log
+++ /dev/null
@@ -1,7 +0,0 @@
-Hello World!
-
-+::0:: echo
-
-+::0:: echo
-
-+::0:: echo
diff --git a/test/bats/test1.bats b/test/bats/test1.bats
index 1aeb2c5..943f30a 100644
--- a/test/bats/test1.bats
+++ b/test/bats/test1.bats
@@ -1,15 +1,17 @@
+#!/usr/bin/env bats
+
+export LCOV_DEBUG_LOG=lcov.log
 
 load test1.sh
 load ../../lcov.sh
-#load node_modules/.bin/lcov.sh
 
-@test "testing: test1_func1()" {
+@test "Testing: test1_func1()" {
     run test1_func1
 
     [ "${output}" = "TEST1_FUNC1" ]
 }
 
-@test "testing: test1_func2()" {
+@test "Testing: test1_func2()" {
     run test1_func2
 
     [ "${output}" = "TEST1_FUNC2" ]
diff --git a/test/bats/test1.sh b/test/bats/test1.sh
index af0bae3..40ff3fd 100644
--- a/test/bats/test1.sh
+++ b/test/bats/test1.sh
@@ -1,6 +1,6 @@
 #!/usr/bin/env bash
 
-[[ -n "${LCOV_DEBUG}" ]] && set -x
+[ -f "${LCOV_DEBUG}" ] && set -x
 
 test1_func1() {
   echo -n "TEST1_FUNC1"
diff --git a/test/bats/test2.bats b/test/bats/test2.bats
new file mode 100644
index 0000000..fd930c7
--- /dev/null
+++ b/test/bats/test2.bats
@@ -0,0 +1,18 @@
+#!/usr/bin/env bats
+
+export LCOV_DEBUG_LOG=lcov.log
+
+load test2.sh
+load ../../lcov.sh
+
+@test "Testing: test2_func1()" {
+    run test2_func1
+
+    [ "${output}" != "TEST2_FUNC1" ]
+}
+
+@test "Testing: test2_func2()" {
+    run test2_func2
+
+    [ "${output}" = "TEST2_FUNC2" ]
+}
diff --git a/test/bats/test2.sh b/test/bats/test2.sh
new file mode 100644
index 0000000..0a17bbc
--- /dev/null
+++ b/test/bats/test2.sh
@@ -0,0 +1,11 @@
+#!/usr/bin/env bash
+
+[ -f "${LCOV_DEBUG}" ] && set -x
+
+test2_func1() {
+  echo -n "TEST2_FUNC1"
+}
+
+test2_func2() {
+  echo -n "TEST2_FUNC2"
+}
diff --git a/test/travis/test-runner.sh b/test/travis/test-runner.sh
index 39cd848..2a81d07 100755
--- a/test/travis/test-runner.sh
+++ b/test/travis/test-runner.sh
@@ -10,9 +10,8 @@ if command -v apk &> /dev/null; then
     make lcov
 fi
 
-echo ""
 echo "========================================"
 bash --version
 echo "========================================"
 
-./lcov.sh test
+make test-bats

From 03ad0e4abf997b3db5f1a383fd3db590c3f472db Mon Sep 17 00:00:00 2001
From: Francesco Bianco <francescobianco@opencrmitalia.com>
Date: Sun, 7 Feb 2021 18:42:00 +0100
Subject: [PATCH 26/32] fix follow

---
 Dockerfile => test/docker/Dockerfile                 | 0
 docker-compose.yml => test/docker/docker-compose.yml | 0
 2 files changed, 0 insertions(+), 0 deletions(-)
 rename Dockerfile => test/docker/Dockerfile (100%)
 rename docker-compose.yml => test/docker/docker-compose.yml (100%)

diff --git a/Dockerfile b/test/docker/Dockerfile
similarity index 100%
rename from Dockerfile
rename to test/docker/Dockerfile
diff --git a/docker-compose.yml b/test/docker/docker-compose.yml
similarity index 100%
rename from docker-compose.yml
rename to test/docker/docker-compose.yml

From c5eb301b516f9ae1e0abd172759da1f6983ee6a0 Mon Sep 17 00:00:00 2001
From: Francesco Bianco <francescobianco@opencrmitalia.com>
Date: Sun, 7 Feb 2021 18:42:53 +0100
Subject: [PATCH 27/32] fix follow

---
 test/bats/test1.bats | 2 +-
 test/bats/test2.bats | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/test/bats/test1.bats b/test/bats/test1.bats
index 943f30a..ae8a85a 100644
--- a/test/bats/test1.bats
+++ b/test/bats/test1.bats
@@ -1,6 +1,6 @@
 #!/usr/bin/env bats
 
-export LCOV_DEBUG_LOG=lcov.log
+export LCOV_DEBUG_LOG=test/bats/lcov.log
 
 load test1.sh
 load ../../lcov.sh
diff --git a/test/bats/test2.bats b/test/bats/test2.bats
index fd930c7..8a014f9 100644
--- a/test/bats/test2.bats
+++ b/test/bats/test2.bats
@@ -1,6 +1,6 @@
 #!/usr/bin/env bats
 
-export LCOV_DEBUG_LOG=lcov.log
+export LCOV_DEBUG_LOG=test/bats/lcov.log
 
 load test2.sh
 load ../../lcov.sh

From 0e2ecaddf1fd8df9199d1becbd339fa28b4bb399 Mon Sep 17 00:00:00 2001
From: francescobianco <info.francescobianco@gmail.com>
Date: Sun, 7 Feb 2021 19:10:10 +0100
Subject: [PATCH 28/32] add all tests

---
 test/lcov_append_info.test.sh | 17 +++++++++++++++++
 test/lcov_done.test.sh        | 20 +++++++++++++++++---
 test/lcov_error.test.sh       | 22 ++++++++++++++++++++++
 test/lcov_exec.test.sh        | 22 ++++++++++++++++++++++
 test/lcov_test.test.sh        | 22 ++++++++++++++++++++++
 test/lcov_test_check.test.sh  | 22 ++++++++++++++++++++++
 test/lcov_test_debug.test.sh  | 22 ++++++++++++++++++++++
 test/lcov_test_next.test.sh   | 17 +++++++++++++++++
 test/lcov_test_stat.test.sh   | 22 ++++++++++++++++++++++
 test/lcov_test_wait.test.sh   | 22 ++++++++++++++++++++++
 test/log.test.sh              | 19 +++++++++++++++++++
 test/main.test.sh             | 22 ++++++++++++++++++++++
 12 files changed, 246 insertions(+), 3 deletions(-)
 create mode 100755 test/lcov_append_info.test.sh
 create mode 100755 test/lcov_error.test.sh
 create mode 100755 test/lcov_exec.test.sh
 create mode 100755 test/lcov_test.test.sh
 create mode 100755 test/lcov_test_check.test.sh
 create mode 100755 test/lcov_test_debug.test.sh
 create mode 100755 test/lcov_test_next.test.sh
 create mode 100755 test/lcov_test_stat.test.sh
 create mode 100755 test/lcov_test_wait.test.sh
 create mode 100755 test/log.test.sh
 create mode 100755 test/main.test.sh

diff --git a/test/lcov_append_info.test.sh b/test/lcov_append_info.test.sh
new file mode 100755
index 0000000..9b31089
--- /dev/null
+++ b/test/lcov_append_info.test.sh
@@ -0,0 +1,17 @@
+#!/usr/bin/env bash
+set -e
+
+# shellcheck disable=SC1091
+source ./deps/pipetest/pipetest.sh
+# shellcheck source=./lcov.sh
+source ./lcov.sh -o test/coverage
+
+lcov_scan test/fixtures/sample.sh | assert_equals "$(cat <<EOF
+TN:
+SF:test/fixtures/sample.sh
+DA:2,0
+DA:4,0
+DA:5,0
+end_of_record
+EOF
+)"
diff --git a/test/lcov_done.test.sh b/test/lcov_done.test.sh
index 67f0c82..0b0037f 100755
--- a/test/lcov_done.test.sh
+++ b/test/lcov_done.test.sh
@@ -1,8 +1,22 @@
 #!/usr/bin/env bash
 set -e
 
-source lcov.sh lcov.sh
+# shellcheck disable=SC1091
+source ./deps/pipetest/pipetest.sh
+# shellcheck source=./lcov.sh
+source ./lcov.sh -o test/coverage
 
-lcov_init a
+rm -fr ./test/coverage
 
-exit 1
+lcov_init ./test/fixtures/subdir/*.zsh !lcov.sh !deps !*test.sh | assert_equals "LCOV.SH by Francesco Bianco <bianco@javanile.org>"
+
+assert_directory_exists ./test/coverage
+assert_file_exists ./test/coverage/lcov.info
+
+grep -e "^SF:" ./test/coverage/lcov.info | assert_equals "$(cat <<EOF
+SF:./test/fixtures/sample.sh
+SF:./test/fixtures/subdir/custom1.zsh
+SF:./test/fixtures/test1.sh
+SF:./test/fixtures/test2.sh
+EOF
+)"
diff --git a/test/lcov_error.test.sh b/test/lcov_error.test.sh
new file mode 100755
index 0000000..0b0037f
--- /dev/null
+++ b/test/lcov_error.test.sh
@@ -0,0 +1,22 @@
+#!/usr/bin/env bash
+set -e
+
+# shellcheck disable=SC1091
+source ./deps/pipetest/pipetest.sh
+# shellcheck source=./lcov.sh
+source ./lcov.sh -o test/coverage
+
+rm -fr ./test/coverage
+
+lcov_init ./test/fixtures/subdir/*.zsh !lcov.sh !deps !*test.sh | assert_equals "LCOV.SH by Francesco Bianco <bianco@javanile.org>"
+
+assert_directory_exists ./test/coverage
+assert_file_exists ./test/coverage/lcov.info
+
+grep -e "^SF:" ./test/coverage/lcov.info | assert_equals "$(cat <<EOF
+SF:./test/fixtures/sample.sh
+SF:./test/fixtures/subdir/custom1.zsh
+SF:./test/fixtures/test1.sh
+SF:./test/fixtures/test2.sh
+EOF
+)"
diff --git a/test/lcov_exec.test.sh b/test/lcov_exec.test.sh
new file mode 100755
index 0000000..0b0037f
--- /dev/null
+++ b/test/lcov_exec.test.sh
@@ -0,0 +1,22 @@
+#!/usr/bin/env bash
+set -e
+
+# shellcheck disable=SC1091
+source ./deps/pipetest/pipetest.sh
+# shellcheck source=./lcov.sh
+source ./lcov.sh -o test/coverage
+
+rm -fr ./test/coverage
+
+lcov_init ./test/fixtures/subdir/*.zsh !lcov.sh !deps !*test.sh | assert_equals "LCOV.SH by Francesco Bianco <bianco@javanile.org>"
+
+assert_directory_exists ./test/coverage
+assert_file_exists ./test/coverage/lcov.info
+
+grep -e "^SF:" ./test/coverage/lcov.info | assert_equals "$(cat <<EOF
+SF:./test/fixtures/sample.sh
+SF:./test/fixtures/subdir/custom1.zsh
+SF:./test/fixtures/test1.sh
+SF:./test/fixtures/test2.sh
+EOF
+)"
diff --git a/test/lcov_test.test.sh b/test/lcov_test.test.sh
new file mode 100755
index 0000000..0b0037f
--- /dev/null
+++ b/test/lcov_test.test.sh
@@ -0,0 +1,22 @@
+#!/usr/bin/env bash
+set -e
+
+# shellcheck disable=SC1091
+source ./deps/pipetest/pipetest.sh
+# shellcheck source=./lcov.sh
+source ./lcov.sh -o test/coverage
+
+rm -fr ./test/coverage
+
+lcov_init ./test/fixtures/subdir/*.zsh !lcov.sh !deps !*test.sh | assert_equals "LCOV.SH by Francesco Bianco <bianco@javanile.org>"
+
+assert_directory_exists ./test/coverage
+assert_file_exists ./test/coverage/lcov.info
+
+grep -e "^SF:" ./test/coverage/lcov.info | assert_equals "$(cat <<EOF
+SF:./test/fixtures/sample.sh
+SF:./test/fixtures/subdir/custom1.zsh
+SF:./test/fixtures/test1.sh
+SF:./test/fixtures/test2.sh
+EOF
+)"
diff --git a/test/lcov_test_check.test.sh b/test/lcov_test_check.test.sh
new file mode 100755
index 0000000..0b0037f
--- /dev/null
+++ b/test/lcov_test_check.test.sh
@@ -0,0 +1,22 @@
+#!/usr/bin/env bash
+set -e
+
+# shellcheck disable=SC1091
+source ./deps/pipetest/pipetest.sh
+# shellcheck source=./lcov.sh
+source ./lcov.sh -o test/coverage
+
+rm -fr ./test/coverage
+
+lcov_init ./test/fixtures/subdir/*.zsh !lcov.sh !deps !*test.sh | assert_equals "LCOV.SH by Francesco Bianco <bianco@javanile.org>"
+
+assert_directory_exists ./test/coverage
+assert_file_exists ./test/coverage/lcov.info
+
+grep -e "^SF:" ./test/coverage/lcov.info | assert_equals "$(cat <<EOF
+SF:./test/fixtures/sample.sh
+SF:./test/fixtures/subdir/custom1.zsh
+SF:./test/fixtures/test1.sh
+SF:./test/fixtures/test2.sh
+EOF
+)"
diff --git a/test/lcov_test_debug.test.sh b/test/lcov_test_debug.test.sh
new file mode 100755
index 0000000..0b0037f
--- /dev/null
+++ b/test/lcov_test_debug.test.sh
@@ -0,0 +1,22 @@
+#!/usr/bin/env bash
+set -e
+
+# shellcheck disable=SC1091
+source ./deps/pipetest/pipetest.sh
+# shellcheck source=./lcov.sh
+source ./lcov.sh -o test/coverage
+
+rm -fr ./test/coverage
+
+lcov_init ./test/fixtures/subdir/*.zsh !lcov.sh !deps !*test.sh | assert_equals "LCOV.SH by Francesco Bianco <bianco@javanile.org>"
+
+assert_directory_exists ./test/coverage
+assert_file_exists ./test/coverage/lcov.info
+
+grep -e "^SF:" ./test/coverage/lcov.info | assert_equals "$(cat <<EOF
+SF:./test/fixtures/sample.sh
+SF:./test/fixtures/subdir/custom1.zsh
+SF:./test/fixtures/test1.sh
+SF:./test/fixtures/test2.sh
+EOF
+)"
diff --git a/test/lcov_test_next.test.sh b/test/lcov_test_next.test.sh
new file mode 100755
index 0000000..9b31089
--- /dev/null
+++ b/test/lcov_test_next.test.sh
@@ -0,0 +1,17 @@
+#!/usr/bin/env bash
+set -e
+
+# shellcheck disable=SC1091
+source ./deps/pipetest/pipetest.sh
+# shellcheck source=./lcov.sh
+source ./lcov.sh -o test/coverage
+
+lcov_scan test/fixtures/sample.sh | assert_equals "$(cat <<EOF
+TN:
+SF:test/fixtures/sample.sh
+DA:2,0
+DA:4,0
+DA:5,0
+end_of_record
+EOF
+)"
diff --git a/test/lcov_test_stat.test.sh b/test/lcov_test_stat.test.sh
new file mode 100755
index 0000000..0b0037f
--- /dev/null
+++ b/test/lcov_test_stat.test.sh
@@ -0,0 +1,22 @@
+#!/usr/bin/env bash
+set -e
+
+# shellcheck disable=SC1091
+source ./deps/pipetest/pipetest.sh
+# shellcheck source=./lcov.sh
+source ./lcov.sh -o test/coverage
+
+rm -fr ./test/coverage
+
+lcov_init ./test/fixtures/subdir/*.zsh !lcov.sh !deps !*test.sh | assert_equals "LCOV.SH by Francesco Bianco <bianco@javanile.org>"
+
+assert_directory_exists ./test/coverage
+assert_file_exists ./test/coverage/lcov.info
+
+grep -e "^SF:" ./test/coverage/lcov.info | assert_equals "$(cat <<EOF
+SF:./test/fixtures/sample.sh
+SF:./test/fixtures/subdir/custom1.zsh
+SF:./test/fixtures/test1.sh
+SF:./test/fixtures/test2.sh
+EOF
+)"
diff --git a/test/lcov_test_wait.test.sh b/test/lcov_test_wait.test.sh
new file mode 100755
index 0000000..0b0037f
--- /dev/null
+++ b/test/lcov_test_wait.test.sh
@@ -0,0 +1,22 @@
+#!/usr/bin/env bash
+set -e
+
+# shellcheck disable=SC1091
+source ./deps/pipetest/pipetest.sh
+# shellcheck source=./lcov.sh
+source ./lcov.sh -o test/coverage
+
+rm -fr ./test/coverage
+
+lcov_init ./test/fixtures/subdir/*.zsh !lcov.sh !deps !*test.sh | assert_equals "LCOV.SH by Francesco Bianco <bianco@javanile.org>"
+
+assert_directory_exists ./test/coverage
+assert_file_exists ./test/coverage/lcov.info
+
+grep -e "^SF:" ./test/coverage/lcov.info | assert_equals "$(cat <<EOF
+SF:./test/fixtures/sample.sh
+SF:./test/fixtures/subdir/custom1.zsh
+SF:./test/fixtures/test1.sh
+SF:./test/fixtures/test2.sh
+EOF
+)"
diff --git a/test/log.test.sh b/test/log.test.sh
new file mode 100755
index 0000000..5584cc7
--- /dev/null
+++ b/test/log.test.sh
@@ -0,0 +1,19 @@
+#!/usr/bin/env bash
+set -e
+
+# shellcheck disable=SC1091
+source ./deps/pipetest/pipetest.sh
+# shellcheck source=./lcov.sh
+source ./lcov.sh -o test/coverage
+
+get_files ./test/fixtures/*.md !./*.sh | assert_equals "$(cat <<EOF
+./test/fixtures/sample.md
+EOF
+)"
+
+get_files ./test/fixtures/*.sh !deps !lcov.sh !*test.sh !example* !test/bats* | sort | assert_equals "$(cat <<EOF
+./test/fixtures/sample.sh
+./test/fixtures/test1.sh
+./test/fixtures/test2.sh
+EOF
+)"
diff --git a/test/main.test.sh b/test/main.test.sh
new file mode 100755
index 0000000..0b0037f
--- /dev/null
+++ b/test/main.test.sh
@@ -0,0 +1,22 @@
+#!/usr/bin/env bash
+set -e
+
+# shellcheck disable=SC1091
+source ./deps/pipetest/pipetest.sh
+# shellcheck source=./lcov.sh
+source ./lcov.sh -o test/coverage
+
+rm -fr ./test/coverage
+
+lcov_init ./test/fixtures/subdir/*.zsh !lcov.sh !deps !*test.sh | assert_equals "LCOV.SH by Francesco Bianco <bianco@javanile.org>"
+
+assert_directory_exists ./test/coverage
+assert_file_exists ./test/coverage/lcov.info
+
+grep -e "^SF:" ./test/coverage/lcov.info | assert_equals "$(cat <<EOF
+SF:./test/fixtures/sample.sh
+SF:./test/fixtures/subdir/custom1.zsh
+SF:./test/fixtures/test1.sh
+SF:./test/fixtures/test2.sh
+EOF
+)"

From 5063d68f87cfd3920cf087410f616161e7f4f676 Mon Sep 17 00:00:00 2001
From: francescobianco <info.francescobianco@gmail.com>
Date: Sun, 7 Feb 2021 20:25:56 +0100
Subject: [PATCH 29/32] fix

---
 Makefile             | 3 ++-
 lcov.sh              | 1 -
 test/bats/test1.bats | 2 --
 test/bats/test2.bats | 2 --
 4 files changed, 2 insertions(+), 6 deletions(-)

diff --git a/Makefile b/Makefile
index 7a286cf..e94f81b 100644
--- a/Makefile
+++ b/Makefile
@@ -39,7 +39,8 @@ test-travis:
 
 test-bats:
 	@rm -fr coverage lcov.log
-	@bats test/bats/*
+	@export LCOV_DEBUG_LOG=test/bats/lcov.log
+	@bats test/bats
 
 test-get-uuid-function:
 	@rm -fr coverage test/coverage
diff --git a/lcov.sh b/lcov.sh
index 9d07e97..91bf0e9 100755
--- a/lcov.sh
+++ b/lcov.sh
@@ -43,7 +43,6 @@ usage() {
   echo "  -i, --include PATH      Include files matching PATH"
   echo "  -x, --exclude PATH      Exclude files matching PATH"
   echo "  -o, --output OUTDIR     Write HTML output to OUTDIR"
-  echo "  -l, --log FILE          Write log messages to FILE"
   echo "  -h, --help              Display this help and exit"
   echo "  -v, --version           Display current version"
   echo ""
diff --git a/test/bats/test1.bats b/test/bats/test1.bats
index ae8a85a..49a0e52 100644
--- a/test/bats/test1.bats
+++ b/test/bats/test1.bats
@@ -1,7 +1,5 @@
 #!/usr/bin/env bats
 
-export LCOV_DEBUG_LOG=test/bats/lcov.log
-
 load test1.sh
 load ../../lcov.sh
 
diff --git a/test/bats/test2.bats b/test/bats/test2.bats
index 8a014f9..45a7152 100644
--- a/test/bats/test2.bats
+++ b/test/bats/test2.bats
@@ -1,7 +1,5 @@
 #!/usr/bin/env bats
 
-export LCOV_DEBUG_LOG=test/bats/lcov.log
-
 load test2.sh
 load ../../lcov.sh
 

From 13464643a27fcbf0057ec58d1e87a5552f9a85c3 Mon Sep 17 00:00:00 2001
From: francescobianco <info.francescobianco@gmail.com>
Date: Sun, 7 Feb 2021 20:51:29 +0100
Subject: [PATCH 30/32] Release

---
 index.md | 10 ++++++++++
 lcov.sh  | 18 ++++++++++--------
 2 files changed, 20 insertions(+), 8 deletions(-)
 create mode 100644 index.md

diff --git a/index.md b/index.md
new file mode 100644
index 0000000..11519e0
--- /dev/null
+++ b/index.md
@@ -0,0 +1,10 @@
+> File: ` script.sh `
+```bash
+```
+> File: ` script-test.sh `
+```bash
+```
+```
+$ ../../../lcov.sh script-test.sh
+```
+<iframe width="100%" height="400" src="coverage/basic"></iframe>
diff --git a/lcov.sh b/lcov.sh
index 91bf0e9..4062ee2 100755
--- a/lcov.sh
+++ b/lcov.sh
@@ -39,12 +39,13 @@ usage() {
   echo "Executes FILE as a test case also collect each LCOV info and generate HTML report"
   echo ""
   echo "List of available options"
-  echo "  -e, --extension EXT     Coverage of every *.EXT file (default: sh)"
-  echo "  -i, --include PATH      Include files matching PATH"
-  echo "  -x, --exclude PATH      Exclude files matching PATH"
-  echo "  -o, --output OUTDIR     Write HTML output to OUTDIR"
-  echo "  -h, --help              Display this help and exit"
-  echo "  -v, --version           Display current version"
+  echo "  -e, --extension EXT      Coverage of every *.EXT file (default: sh)"
+  echo "  -i, --include PATH       Include files matching PATH"
+  echo "  -x, --exclude PATH       Exclude files matching PATH"
+  echo "  -o, --output OUTDIR      Write HTML output to OUTDIR"
+  echo "  -s, --stop-on-failure    Stop analysis if a test fails"
+  echo "  -h, --help               Display this help and exit"
+  echo "  -v, --version            Display current version"
   echo ""
   echo "Documentation can be found at https://github.com/javanile/lcov.sh"
 }
@@ -62,6 +63,7 @@ case "$(uname -s)" in
     ;;
 esac
 
+stop_on_failure=
 lcov_coverage=()
 lcov_extension=sh
 lcov_output=coverage
@@ -76,7 +78,7 @@ else
   done_flag="DONE"
   fail_flag="FAIL"
 fi
-options=$(${getopt} -n lcov.sh -o i:e:x:o:l:vh -l extension:,include:,exclude:,output:,log:,version,help -- "$@")
+options=$(${getopt} -n lcov.sh -o i:e:x:o:svh -l extension:,include:,exclude:,output:,stop-on-failure,version,help -- "$@")
 
 eval set -- "${options}"
 
@@ -86,7 +88,7 @@ while true; do
     -i|--include) shift; lcov_coverage+=("$1") ;;
     -x|--exclude) shift; lcov_coverage+=("!$1") ;;
     -e|--extension) shift; lcov_extension=$1 ;;
-    -l|--log) shift; lcov_log=$1 ;;
+    -s|--stop-on-failure) shift; stop_on_failure=1 ;;
     -v|--version) echo "LCOV.SH version ${VERSION}"; exit ;;
     -h|--help) usage; exit ;;
     --) shift; break ;;

From c54566e2ba9b771f795215c322aa18692b0ead29 Mon Sep 17 00:00:00 2001
From: francescobianco <info.francescobianco@gmail.com>
Date: Sun, 7 Feb 2021 22:36:53 +0100
Subject: [PATCH 31/32] Release

---
 Makefile               |  5 ++++-
 lcov.sh                | 24 ++++++++++++++++--------
 test/lcov_done.test.sh | 14 ++++----------
 3 files changed, 24 insertions(+), 19 deletions(-)

diff --git a/Makefile b/Makefile
index e94f81b..47e2bc0 100644
--- a/Makefile
+++ b/Makefile
@@ -32,7 +32,10 @@ qa:
 ## Testing
 ## =======
 test: deps
-	@bash ./lcov.sh test/*.test.sh -x deps
+	@bash ./lcov.sh test/*.test.sh -sx deps
+
+test-file:
+	@bash ./lcov.sh -sx deps $(file)
 
 test-travis:
 	@docker-compose -f test/travis/docker-compose.yml run --rm travis test/travis/test-runner.sh
diff --git a/lcov.sh b/lcov.sh
index 4062ee2..a8201a3 100755
--- a/lcov.sh
+++ b/lcov.sh
@@ -165,8 +165,8 @@ log() {
 ##
 #
 ##
-lcov_error() {
-   echo "--> $1"
+error() {
+   echo "==> $1"
    local i
    local stack_size=${#FUNCNAME[@]}
    for (( i=1; i<$stack_size ; i++ )); do
@@ -263,7 +263,8 @@ lcov_scan() {
 # Outputs:
 #  - Show LCOV summary with tests information
 ##
-lcov_done () {
+lcov_done() {
+  if [[ -f "${lcov_info}" ]]; then
     echo ""
     stat="0 0 0 0"
     [[ -f "${lcov_output}/test.stat" ]] && stat="$(cat ${lcov_output}/test.stat && true)"
@@ -272,17 +273,20 @@ lcov_done () {
     fail="$(echo ${stat} | cut -s -d' ' -f3)"
     skip="$(echo ${stat} | cut -s -d' ' -f4)"
     if [[ ${fail} -gt 0 || ${done} -eq 0 ]]; then
-        exit_info="${fail_flag}"
-        exit_code=1
+      exit_info="${fail_flag}"
+      exit_code=1
     else
-        exit_info="${done_flag}"
-        exit_code=0
+      exit_info="${done_flag}"
+      exit_code=0
     fi
-    genhtml -q -o "${lcov_output}" "${lcov_output}/lcov.info"
+    genhtml -q -o "${lcov_output}" "${lcov_output}/lcov.info" && true
     lcov --summary "${lcov_output}/lcov.info"
     echo -e "  tests......: ${test} (${done} done, ${fail} fail, ${skip} skip)"
     echo -e "  exit.......: ${exit_code} ${exit_info}"
     exit ${exit_code}
+  else
+    error "Error missing lcov_init before lcov_done."
+  fi
 }
 
 ##
@@ -383,6 +387,10 @@ lcov_test_check() {
     [[ -z "${info}" ]] && info="$(grep "." "${lcov_test_log}" | tail -1)"
     echo -e "${fail_flag} ${test}: '${info}' (exit ${exit_code})"
     lcov_test_stat 1 0 1 0
+    if [[ -n "${stop_on_failure}" ]]; then
+      cat "${lcov_test_out}"
+      exit 1
+    fi
   fi
 }
 
diff --git a/test/lcov_done.test.sh b/test/lcov_done.test.sh
index 0b0037f..8f5606b 100755
--- a/test/lcov_done.test.sh
+++ b/test/lcov_done.test.sh
@@ -8,15 +8,9 @@ source ./lcov.sh -o test/coverage
 
 rm -fr ./test/coverage
 
-lcov_init ./test/fixtures/subdir/*.zsh !lcov.sh !deps !*test.sh | assert_equals "LCOV.SH by Francesco Bianco <bianco@javanile.org>"
-
-assert_directory_exists ./test/coverage
-assert_file_exists ./test/coverage/lcov.info
-
-grep -e "^SF:" ./test/coverage/lcov.info | assert_equals "$(cat <<EOF
-SF:./test/fixtures/sample.sh
-SF:./test/fixtures/subdir/custom1.zsh
-SF:./test/fixtures/test1.sh
-SF:./test/fixtures/test2.sh
+lcov_done | assert_equals "$(cat <<EOF
+==> Error missing lcov_init bef ore lcov_done.
+    lcov_done() at ./lcov.sh:11
+    main() at test/lcov_done.test.sh:1
 EOF
 )"

From 181ea0f8076829e13903610de45cddb66b098b3c Mon Sep 17 00:00:00 2001
From: francesco <info.francescobianco@gmail.com>
Date: Thu, 2 Nov 2023 12:58:32 +0100
Subject: [PATCH 32/32] Merge remote-tracking branch 'origin/bats' into mush

# Conflicts:
#	test/docker/docker-compose.yml
---
 .editorconfig                                 |   2 -
 .../{super-linter.yml => super-linter.yml.0}  |   0
 Manifest.toml                                 |   8 +
 index.md => docs/index.md                     |   0
 test/docker/docker-compose.yml => src/lcov.sh |   0
 src/main.sh                                   | 531 ++++++++++++++++++
 src/usage.sh                                  |  18 +
 {test => tests/bare}/get_files.test.sh        |   0
 {test => tests/bare}/get_uuid.test.sh         |   0
 {test => tests/bare}/lcov_append_info.test.sh |   0
 {test => tests/bare}/lcov_done.test.sh        |   0
 {test => tests/bare}/lcov_error.test.sh       |   0
 {test => tests/bare}/lcov_exec.test.sh        |   0
 {test => tests/bare}/lcov_init.test.sh        |   0
 {test => tests/bare}/lcov_scan.test.sh        |   0
 {test => tests/bare}/lcov_test.test.sh        |   0
 {test => tests/bare}/lcov_test_check.test.sh  |   0
 {test => tests/bare}/lcov_test_debug.test.sh  |   0
 {test => tests/bare}/lcov_test_next.test.sh   |   0
 {test => tests/bare}/lcov_test_stat.test.sh   |   0
 {test => tests/bare}/lcov_test_wait.test.sh   |   0
 {test => tests/bare}/log.test.sh              |   0
 {test => tests/bare}/main.test.sh             |   0
 {test => tests/bare}/run.test.sh              |   0
 {test => tests/bare}/usage.test.sh            |   0
 {test => tests}/bats/test1.bats               |   0
 {test => tests}/bats/test1.sh                 |   0
 {test => tests}/bats/test2.bats               |   0
 {test => tests}/bats/test2.sh                 |   0
 {test => tests}/docker/Dockerfile             |   0
 .../docker/docker-compose.yml                 |   0
 {test => tests}/fixtures/custom.zsh           |   0
 tests/fixtures/sample.md                      |   0
 {test => tests}/fixtures/sample.sh            |   0
 {test => tests}/fixtures/subdir/custom1.zsh   |   0
 {test => tests}/fixtures/test1.sh             |   0
 {test => tests}/fixtures/test2.sh             |   0
 {test => tests}/travis/docker-compose.yml     |   0
 {test => tests}/travis/test-runner.sh         |   0
 39 files changed, 557 insertions(+), 2 deletions(-)
 delete mode 100644 .editorconfig
 rename .github/workflows/{super-linter.yml => super-linter.yml.0} (100%)
 create mode 100644 Manifest.toml
 rename index.md => docs/index.md (100%)
 rename test/docker/docker-compose.yml => src/lcov.sh (100%)
 create mode 100644 src/main.sh
 create mode 100644 src/usage.sh
 rename {test => tests/bare}/get_files.test.sh (100%)
 rename {test => tests/bare}/get_uuid.test.sh (100%)
 rename {test => tests/bare}/lcov_append_info.test.sh (100%)
 rename {test => tests/bare}/lcov_done.test.sh (100%)
 rename {test => tests/bare}/lcov_error.test.sh (100%)
 rename {test => tests/bare}/lcov_exec.test.sh (100%)
 rename {test => tests/bare}/lcov_init.test.sh (100%)
 rename {test => tests/bare}/lcov_scan.test.sh (100%)
 rename {test => tests/bare}/lcov_test.test.sh (100%)
 rename {test => tests/bare}/lcov_test_check.test.sh (100%)
 rename {test => tests/bare}/lcov_test_debug.test.sh (100%)
 rename {test => tests/bare}/lcov_test_next.test.sh (100%)
 rename {test => tests/bare}/lcov_test_stat.test.sh (100%)
 rename {test => tests/bare}/lcov_test_wait.test.sh (100%)
 rename {test => tests/bare}/log.test.sh (100%)
 rename {test => tests/bare}/main.test.sh (100%)
 rename {test => tests/bare}/run.test.sh (100%)
 rename {test => tests/bare}/usage.test.sh (100%)
 rename {test => tests}/bats/test1.bats (100%)
 rename {test => tests}/bats/test1.sh (100%)
 rename {test => tests}/bats/test2.bats (100%)
 rename {test => tests}/bats/test2.sh (100%)
 rename {test => tests}/docker/Dockerfile (100%)
 rename test/fixtures/sample.md => tests/docker/docker-compose.yml (100%)
 rename {test => tests}/fixtures/custom.zsh (100%)
 create mode 100644 tests/fixtures/sample.md
 rename {test => tests}/fixtures/sample.sh (100%)
 rename {test => tests}/fixtures/subdir/custom1.zsh (100%)
 rename {test => tests}/fixtures/test1.sh (100%)
 rename {test => tests}/fixtures/test2.sh (100%)
 rename {test => tests}/travis/docker-compose.yml (100%)
 rename {test => tests}/travis/test-runner.sh (100%)

diff --git a/.editorconfig b/.editorconfig
deleted file mode 100644
index 8c5189d..0000000
--- a/.editorconfig
+++ /dev/null
@@ -1,2 +0,0 @@
-[Makefile]
-indent_style = tab
diff --git a/.github/workflows/super-linter.yml b/.github/workflows/super-linter.yml.0
similarity index 100%
rename from .github/workflows/super-linter.yml
rename to .github/workflows/super-linter.yml.0
diff --git a/Manifest.toml b/Manifest.toml
new file mode 100644
index 0000000..9cf5e69
--- /dev/null
+++ b/Manifest.toml
@@ -0,0 +1,8 @@
+[package]
+name = "lcov.sh"
+version = "0.1.0"
+edition = "2022"
+
+# See more keys and their definitions at https://mush.javanile.org/manifest.html
+
+[dependencies]
diff --git a/index.md b/docs/index.md
similarity index 100%
rename from index.md
rename to docs/index.md
diff --git a/test/docker/docker-compose.yml b/src/lcov.sh
similarity index 100%
rename from test/docker/docker-compose.yml
rename to src/lcov.sh
diff --git a/src/main.sh b/src/main.sh
new file mode 100644
index 0000000..a17f2f5
--- /dev/null
+++ b/src/main.sh
@@ -0,0 +1,531 @@
+#!/usr/bin/env bash
+
+##
+# LCOV.SH
+#
+# The best LCOV framework around BASH projects.
+#
+# Copyright (c) 2020 Francesco Bianco <bianco@javanile.org>
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included in all
+# copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+# SOFTWARE.
+##
+
+[ -n "${LCOV_DEBUG}" ] && set -x
+
+set -ef
+
+module usage
+
+VERSION="Mush v0.1.0"
+
+# shellcheck disable=SC2016
+LCOV_PS4='+:lcov.sh:${BASH_SOURCE}:${LINENO}:${FUNCNAME[0]}: '
+
+##
+# Generate UUID.
+#
+# Arguments
+#  - None
+# Outputs
+#  - UUID random code
+##
+get_uuid ()  {
+  if [[ -f /proc/sys/kernel/random/uuid ]]; then
+    cat /proc/sys/kernel/random/uuid
+  else
+    /usr/bin/uuidgen
+  fi
+  return 0
+}
+
+##
+# Get all files for coverage analysis.
+#
+# Arguments
+#  - $1...$N: include or exclude glob or path (eg: *.sh, !test, etc...)
+# Outputs
+#  - Create output directory with scanned tracefile lcov.info file.
+##
+get_files () {
+  local include="-name *.${lcov_extension}"
+  local exclude="-not -wholename ${lcov_output} -not -path .git"
+
+  for arg in "$@"; do
+    #echo "ARG: ${arg}"
+    if [[ "${arg::1}" != "!" ]]; then
+      include+=" -or -wholename ${arg}"
+    else
+      exclude+=" -not -wholename ${arg:1} -not -path *${arg:1}*"
+    fi
+  done
+
+  find . -type f \( ${include[0]} \) \( ${exclude[0]} \)
+
+  return 0
+}
+
+##
+#
+##
+log() {
+  if [[ -n "${lcov_debug_log}" ]]; then
+    if [[ ! -f "${lcov_debug_log}" ]]; then
+      touch "${lcov_debug_log}"
+      lcov_debug_log="$(realpath "${lcov_debug_log}")"
+      echo "$(date +"%F %T") INIT_LOG ${lcov_debug_log}" >> "${lcov_debug_log}"
+    fi
+    echo "$(date +"%F %T") $@" >> "${lcov_debug_log}"
+  fi
+}
+
+##
+#
+##
+error() {
+   echo "==> $1"
+   local i
+   local stack_size=${#FUNCNAME[@]}
+   for (( i=1; i<$stack_size ; i++ )); do
+      local func="${FUNCNAME[$i]}"
+      [ x$func = x ] && func=MAIN
+      #local linen="${BASH_LINENO[(( i - 1 ))]}"
+      local linen="${BASH_LINENO[$i]}"
+      local src="${BASH_SOURCE[$i]}"
+      [ x"$src" = x ] && src=non_file_source
+      echo "    ${func}() at ${src}:${linen}"
+   done
+}
+
+##
+#
+##
+lcov_exec() {
+  local log=$(lcov "${@}" 2>&1 && true)
+  if [[ -n ${log} ]]; then
+    lcov_error "${log}" >> "${lcov_log}"
+  fi
+}
+
+##
+# Initialize output directory.
+#
+# Arguments
+#  - $1...$N: include or exclude glob or path (eg: *.sh, !test, etc...)
+# Outputs
+#  - Create output directory with scanned trace file lcov.info file.
+##
+lcov_init() {
+  mkdir -p "${lcov_output}"
+  rm -f "${lcov_info}" "${lcov_files}" "${lcov_test_stat}" "${lcov_test_lock}"
+
+  local init_info="${lcov_output}/init.info"
+
+  get_files "$@" | while IFS= read -r file; do
+    readlink -f "${file}" >> "${lcov_files}"
+    lcov_scan "${file}" > "${init_info}"
+    [[ -f "${lcov_info}" ]] || lcov_exec -q -a "${init_info}" -o "${lcov_info}" && true
+    lcov_exec -q -a "${init_info}" -a "${lcov_info}" -o "${lcov_info}"
+    rm -f "${init_info}"
+  done
+
+  return 0
+}
+
+##
+# Scan file and generate default lcov file info.
+#
+# Arguments
+#  - $1: file to scan.
+# Outputs
+#  - LCOV rules from file.
+##
+lcov_scan() {
+  local lineno=0
+  local skip_eof=
+
+  echo "TN:"
+  echo "SF:$1"
+
+  while IFS= read line || [[ -n "${line}" ]]; do
+    #line=${line%%*( )}
+    line="${line#"${line%%[![:space:]]*}"}"
+    line="${line%"${line##*[![:space:]]}"}"
+    lineno=$((lineno + 1))
+    [[ -z "${line}" ]] && continue
+    [[ "${line}" == "else" ]] && continue
+    [[ "${line}" == "fi" ]] && continue
+    [[ "${line}" == ";;" ]] && continue
+    [[ "${line}" == "esac" ]] && continue
+    [[ "${line}" == "done" ]] && continue
+    [[ "${line::1}" == "#" ]] && continue
+    [[ "${line::1}" == "}" ]] && continue
+    [[ "${line}" == *"{" ]] && continue
+    [[ "${line}" == "EOF" ]] && skip_eof= && continue
+    [[ "${skip_eof}" == "EOF" ]] && continue
+    [[ "${line}" == *"<<EOF" ]] && skip_eof=EOF
+    echo "DA:${lineno},0"
+  done < "$1"
+
+  echo "end_of_record"
+
+  return 0
+}
+
+##
+# Print-out summary of tests.
+#
+# Arguments:
+#  - no args
+# Outputs:
+#  - Show LCOV summary with tests information
+##
+lcov_done() {
+  if [[ -f "${lcov_info}" ]]; then
+    echo ""
+    stat="0 0 0 0"
+    [[ -f "${lcov_output}/test.stat" ]] && stat="$(cat ${lcov_output}/test.stat && true)"
+    test="$(echo ${stat} | cut -s -d' ' -f1)"
+    done="$(echo ${stat} | cut -s -d' ' -f2)"
+    fail="$(echo ${stat} | cut -s -d' ' -f3)"
+    skip="$(echo ${stat} | cut -s -d' ' -f4)"
+    if [[ ${fail} -gt 0 || ${done} -eq 0 ]]; then
+      exit_info="${fail_flag}"
+      exit_code=1
+    else
+      exit_info="${done_flag}"
+      exit_code=0
+    fi
+    genhtml -q -o "${lcov_output}" "${lcov_output}/lcov.info" && true
+    lcov --summary "${lcov_output}/lcov.info"
+    echo -e "  tests......: ${test} (${done} done, ${fail} fail, ${skip} skip)"
+    echo -e "  exit.......: ${exit_code} ${exit_info}"
+    exit ${exit_code}
+  else
+    error "Error missing lcov_init before lcov_done."
+  fi
+}
+
+##
+#
+##
+lcov_test_wait() {
+  while [[ -f "${lcov_test_lock}" ]]; do sleep 2; done
+  touch "${lcov_test_lock}"
+  return 0
+}
+
+##
+#
+##
+lcov_test_next() {
+  rm -f ${lcov_output}/test.lock
+  return 0
+}
+
+##
+# Store running tests stat.
+##
+lcov_test_stat () {
+  local stat="0 "
+  [[ -f "${lcov_test_stat}" ]] && stat+="$(cat "${lcov_test_stat}")"
+
+  local test=$(expr $(echo ${stat} | cut -d' ' -f2) + $1 || true)
+  local done=$(expr $(echo ${stat} | cut -d' ' -f3) + $2 || true)
+  local fail=$(expr $(echo ${stat} | cut -d' ' -f4) + $3 || true)
+  local skip=$(expr $(echo ${stat} | cut -d' ' -f5) + $4 || true)
+
+  echo "${test} ${done} ${fail} ${skip}" > "${lcov_test_stat}"
+
+  return 0
+}
+
+##
+# Execute test case and process LCOV info.
+##
+lcov_test() {
+  if [[ -n "$1" ]]; then
+    lcov_test_wait
+    echo -n "  > "
+    if [[ -f "$1" ]]; then
+      lcov_test_debug "$1" && true
+      lcov_test_check "$1" "$?"
+    else
+      if [[ -d "$1" ]]; then
+        echo -e "${skip_flag} $1/: is directory.";
+      else
+        echo -e "${skip_flag} $1: file not found.";
+      fi
+      lcov_test_stat 1 0 0 1
+    fi
+    shift
+    lcov_test_next
+    lcov_test "$@"
+  fi
+  return 0
+}
+
+##
+# $1 - Test file
+# $2 - Log file
+# $3 - Output file
+##
+lcov_test_debug () {
+  local orig_ps4="${PS4}"
+  local orig_lcov_debug="${LCOV_DEBUG}"
+  local log_file=${lcov_tmp}/run.log
+
+  export LCOV_DEBUG=1
+  export PS4="${LCOV_PS4}"
+
+  ## Execute test as bash script and capture output and logs
+  bash -x "$1" > "${lcov_test_out}" 2> "${lcov_test_log}" && true
+  exit_code=$?
+
+  export LCOV_DEBUG="${orig_lcov_debug}"
+  export PS4="${orig_ps4}"
+
+  return "${exit_code}"
+}
+
+##
+#
+##
+lcov_test_check() {
+  local test="$1"
+  local exit_code="$2"
+  if [[ ${exit_code} -eq 0 ]]; then
+    lcov_append_info "${lcov_test_log}" "${lcov_test_out}"
+    local info=$(grep . "${lcov_test_out}" | tail -1)
+    echo -e "${done_flag} ${test}: '${info}' (ok)";
+    lcov_test_stat 1 1 0 0
+  else
+    local info="$(grep "." "${lcov_test_out}" | tail -1)"
+    [[ -z "${info}" ]] && info="$(grep "." "${lcov_test_log}" | tail -1)"
+    echo -e "${fail_flag} ${test}: '${info}' (exit ${exit_code})"
+    lcov_test_stat 1 0 1 0
+    if [[ -n "${stop_on_failure}" ]]; then
+      cat "${lcov_test_out}"
+      exit 1
+    fi
+  fi
+}
+
+##
+# $1 - Log file
+# $2 - Output file
+##
+lcov_append_info() {
+  local line_stop="$(get_uuid)"
+  local temp_info="${lcov_temp_dir}/temp.info"
+
+  rm -f "${temp_info}"
+  echo "${line_stop}" >> "$1"
+  #echo "STOP" >> /home/francesco/Develop/Javanile/lcov.sh/a.txt
+  #cat "$1" >> /home/francesco/Develop/Javanile/lcov.sh/a.txt
+  while IFS= read -r line || [[ -n "${line}" ]]; do
+    if [[ "${line::1}" = "+" ]]; then
+      scope=$(echo ${line} | cut -s -d':' -f2)
+      if [[ "${scope}" = "lcov.sh" ]]; then
+        file="$(echo "${line}" | cut -s -d':' -f3)"
+        file="$(readlink -f "${file}")"
+        if [[ -n "$(grep -e "^${file}$" "${lcov_files}" && true)" ]]; then
+          lineno=$(echo "${line}" | cut -s -d':' -f4)
+          echo -e "TN:\nSF:${file}\nDA:${lineno},1\nend_of_record" >> "${temp_info}"
+        fi
+      fi
+    elif [[ "${line}" = "${line_stop}" ]]; then
+      lcov_exec -q -a "${temp_info}" -a "${lcov_info}" -o "${lcov_info}"
+      rm -f "${temp_info}"
+    fi
+  done < "$1"
+}
+
+##
+# Run function used inside BATS test case.
+#
+##
+run() {
+  log "BATS_RUN ${@}"
+  #declare -p >> ${lcov_debug_log}
+
+  local orig_ps4="${PS4}"
+  local orig_lcov_debug="${LCOV_DEBUG}"
+  local log_file="${lcov_temp_dir}/bats_${BATS_SUITE_TEST_NUMBER}_${BATS_TEST_NUMBER}.log"
+
+  rm -f "${log_file}"
+
+  export LCOV_DEBUG=1
+  export PS4="${LCOV_PS4}"
+
+  lcov_bats_run "${@}" 2>> "${log_file}"
+
+  #log "BATS_OUTPUT=${output}"
+  log "BATS_STATUS=${status}"
+
+  export LCOV_DEBUG="${orig_lcov_debug}"
+  export PS4="${orig_ps4}"
+}
+
+##
+#
+##
+setup() {
+  lcov_setup
+}
+
+##
+#
+##
+lcov_setup() {
+  if [[ -z "${LCOV_INIT}" ]]; then
+    export LCOV_INIT=1
+    lcov_init "${lcov_coverage[@]}"
+  fi
+}
+
+##
+# Run function used by BATS test case.
+#
+##
+teardown() {
+  lcov_teardown
+}
+
+##
+#
+##
+lcov_teardown() {
+  local log_file="${lcov_temp_dir}/bats_${BATS_SUITE_TEST_NUMBER}_${BATS_TEST_NUMBER}.log"
+  log "BATS_TEARDOWN (${BATS_TEST_COMPLETED}) ${log_file}"
+  if [[ "${BATS_TEST_COMPLETED}" = 1 ]]; then
+    lcov_append_info "${log_file}"
+  fi
+  #rm "${log_file}"
+  genhtml -q -o "${lcov_output}" "${lcov_info}"
+}
+
+##
+# Execute testcase and prepare BATS global vars.
+##
+lcov_bats_run() {
+  local flags="$-"
+  set +eET
+  local orig_ifs="$IFS"
+  [[ "${flags}" =~ x ]] || set -x
+  # shellcheck disable=SC2034
+  output="$("$@")"
+  # shellcheck disable=SC2034
+  status="$?"
+  [[ "${flags}" =~ x ]] || set +x
+  # shellcheck disable=SC2034,SC2206
+  IFS=$'\n' lines=($output)
+  IFS="$orig_ifs"
+  set "-$flags"
+}
+
+##
+# Entry-point
+##
+main() {
+  if [[ -z "$(command -v lcov)" ]]; then
+    echo "lcov.sh: missing 'lcov' command on your system. (try: sudo apt install lcov)" >&2
+    exit 1
+  fi
+
+  if [[ -z "$1" ]]; then
+    echo "lcov.sh: missing file to test as test case. (try: lcov.sh test/*-test.sh)" >&2
+    exit 1
+  fi
+
+  echo "LCOV.SH by Francesco Bianco <bianco@javanile.org>"
+  echo ""
+
+  trap '$(jobs -p) || kill $(jobs -p)' EXIT
+
+  case "$(uname -s)" in
+    Darwin*)
+      getopt=/usr/local/opt/gnu-getopt/bin/getopt
+      escape='\x1B'
+      ;;
+    Linux|*)
+      [ -x /bin/getopt ] && getopt=/bin/getopt || getopt=/usr/bin/getopt
+      escape='\e'
+      ;;
+  esac
+
+  stop_on_failure=
+  lcov_coverage=()
+  lcov_extension=sh
+  lcov_output=coverage
+  lcov_debug_log=${LCOV_DEBUG_LOG}
+  lcov_temp_dir=$(mktemp -d -t lcov-sh-XXXXXXXXXXXX)
+  if [[ -z "${LCOV_DEBUG_NO_COLOR}" ]]; then
+    skip_flag="${escape}[37m(skip)${escape}[0m"
+    done_flag="${escape}[1m${escape}[32m(done)${escape}[0m"
+    fail_flag="${escape}[1m${escape}[31m(fail)${escape}[0m"
+  else
+    skip_flag="SKIP"
+    done_flag="DONE"
+    fail_flag="FAIL"
+  fi
+  options=$(${getopt} -n lcov.sh -o i:e:x:o:svh -l extension:,include:,exclude:,output:,stop-on-failure,version,help -- "$@")
+
+  eval set -- "${options}"
+
+  while true; do
+    case "$1" in
+      -o|--output) shift; lcov_output=$1 ;;
+      -i|--include) shift; lcov_coverage+=("$1") ;;
+      -x|--exclude) shift; lcov_coverage+=("!$1") ;;
+      -e|--extension) shift; lcov_extension=$1 ;;
+      -s|--stop-on-failure) shift; stop_on_failure=1 ;;
+      -v|--version) echo "LCOV.SH version ${VERSION}"; exit ;;
+      -h|--help) usage; exit ;;
+      --) shift; break ;;
+    esac
+    shift
+  done
+
+  lcov_log="${lcov_output}/lcov.log"
+  lcov_info="${lcov_output}/lcov.info"
+  lcov_files="${lcov_output}/lcov.files"
+  lcov_test_log="${lcov_output}/test.log"
+  lcov_test_out="${lcov_output}/test.out"
+  lcov_test_lock="${lcov_output}/test.lock"
+  lcov_test_stat="${lcov_output}/test.stat"
+  lcov_test_info="${lcov_output}/test.info"
+
+
+  lcov_init "${lcov_coverage[@]}"
+
+  for test in "$@"; do
+    lcov_test "${test}"
+  done
+
+  lcov_done
+}
+
+## Bypass entry-point if file was sourced
+## than expose LCOV.SH and BATS functions
+#if [[ "${BASH_SOURCE[0]}" != "${0}" ]]; then
+#  export -f run
+#else
+#  main "$@"
+#  exit "$?"
+#fi
diff --git a/src/usage.sh b/src/usage.sh
new file mode 100644
index 0000000..ddff0f8
--- /dev/null
+++ b/src/usage.sh
@@ -0,0 +1,18 @@
+
+usage() {
+  echo "Usage: ./lcov.sh [OPTION]... FILE..."
+  echo ""
+  echo "Executes FILE as a test case also collect each LCOV info and generate HTML report"
+  echo ""
+  echo "List of available options"
+  echo "  -e, --extension EXT      Coverage of every *.EXT file (default: sh)"
+  echo "  -i, --include PATH       Include files matching PATH"
+  echo "  -x, --exclude PATH       Exclude files matching PATH"
+  echo "  -o, --output OUTDIR      Write HTML output to OUTDIR"
+  echo "  -s, --stop-on-failure    Stop analysis if a test fails"
+  echo "  -h, --help               Display this help and exit"
+  echo "  -v, --version            Display current version"
+  echo ""
+  echo "Documentation can be found at https://github.com/javanile/lcov.sh"
+}
+
diff --git a/test/get_files.test.sh b/tests/bare/get_files.test.sh
similarity index 100%
rename from test/get_files.test.sh
rename to tests/bare/get_files.test.sh
diff --git a/test/get_uuid.test.sh b/tests/bare/get_uuid.test.sh
similarity index 100%
rename from test/get_uuid.test.sh
rename to tests/bare/get_uuid.test.sh
diff --git a/test/lcov_append_info.test.sh b/tests/bare/lcov_append_info.test.sh
similarity index 100%
rename from test/lcov_append_info.test.sh
rename to tests/bare/lcov_append_info.test.sh
diff --git a/test/lcov_done.test.sh b/tests/bare/lcov_done.test.sh
similarity index 100%
rename from test/lcov_done.test.sh
rename to tests/bare/lcov_done.test.sh
diff --git a/test/lcov_error.test.sh b/tests/bare/lcov_error.test.sh
similarity index 100%
rename from test/lcov_error.test.sh
rename to tests/bare/lcov_error.test.sh
diff --git a/test/lcov_exec.test.sh b/tests/bare/lcov_exec.test.sh
similarity index 100%
rename from test/lcov_exec.test.sh
rename to tests/bare/lcov_exec.test.sh
diff --git a/test/lcov_init.test.sh b/tests/bare/lcov_init.test.sh
similarity index 100%
rename from test/lcov_init.test.sh
rename to tests/bare/lcov_init.test.sh
diff --git a/test/lcov_scan.test.sh b/tests/bare/lcov_scan.test.sh
similarity index 100%
rename from test/lcov_scan.test.sh
rename to tests/bare/lcov_scan.test.sh
diff --git a/test/lcov_test.test.sh b/tests/bare/lcov_test.test.sh
similarity index 100%
rename from test/lcov_test.test.sh
rename to tests/bare/lcov_test.test.sh
diff --git a/test/lcov_test_check.test.sh b/tests/bare/lcov_test_check.test.sh
similarity index 100%
rename from test/lcov_test_check.test.sh
rename to tests/bare/lcov_test_check.test.sh
diff --git a/test/lcov_test_debug.test.sh b/tests/bare/lcov_test_debug.test.sh
similarity index 100%
rename from test/lcov_test_debug.test.sh
rename to tests/bare/lcov_test_debug.test.sh
diff --git a/test/lcov_test_next.test.sh b/tests/bare/lcov_test_next.test.sh
similarity index 100%
rename from test/lcov_test_next.test.sh
rename to tests/bare/lcov_test_next.test.sh
diff --git a/test/lcov_test_stat.test.sh b/tests/bare/lcov_test_stat.test.sh
similarity index 100%
rename from test/lcov_test_stat.test.sh
rename to tests/bare/lcov_test_stat.test.sh
diff --git a/test/lcov_test_wait.test.sh b/tests/bare/lcov_test_wait.test.sh
similarity index 100%
rename from test/lcov_test_wait.test.sh
rename to tests/bare/lcov_test_wait.test.sh
diff --git a/test/log.test.sh b/tests/bare/log.test.sh
similarity index 100%
rename from test/log.test.sh
rename to tests/bare/log.test.sh
diff --git a/test/main.test.sh b/tests/bare/main.test.sh
similarity index 100%
rename from test/main.test.sh
rename to tests/bare/main.test.sh
diff --git a/test/run.test.sh b/tests/bare/run.test.sh
similarity index 100%
rename from test/run.test.sh
rename to tests/bare/run.test.sh
diff --git a/test/usage.test.sh b/tests/bare/usage.test.sh
similarity index 100%
rename from test/usage.test.sh
rename to tests/bare/usage.test.sh
diff --git a/test/bats/test1.bats b/tests/bats/test1.bats
similarity index 100%
rename from test/bats/test1.bats
rename to tests/bats/test1.bats
diff --git a/test/bats/test1.sh b/tests/bats/test1.sh
similarity index 100%
rename from test/bats/test1.sh
rename to tests/bats/test1.sh
diff --git a/test/bats/test2.bats b/tests/bats/test2.bats
similarity index 100%
rename from test/bats/test2.bats
rename to tests/bats/test2.bats
diff --git a/test/bats/test2.sh b/tests/bats/test2.sh
similarity index 100%
rename from test/bats/test2.sh
rename to tests/bats/test2.sh
diff --git a/test/docker/Dockerfile b/tests/docker/Dockerfile
similarity index 100%
rename from test/docker/Dockerfile
rename to tests/docker/Dockerfile
diff --git a/test/fixtures/sample.md b/tests/docker/docker-compose.yml
similarity index 100%
rename from test/fixtures/sample.md
rename to tests/docker/docker-compose.yml
diff --git a/test/fixtures/custom.zsh b/tests/fixtures/custom.zsh
similarity index 100%
rename from test/fixtures/custom.zsh
rename to tests/fixtures/custom.zsh
diff --git a/tests/fixtures/sample.md b/tests/fixtures/sample.md
new file mode 100644
index 0000000..e69de29
diff --git a/test/fixtures/sample.sh b/tests/fixtures/sample.sh
similarity index 100%
rename from test/fixtures/sample.sh
rename to tests/fixtures/sample.sh
diff --git a/test/fixtures/subdir/custom1.zsh b/tests/fixtures/subdir/custom1.zsh
similarity index 100%
rename from test/fixtures/subdir/custom1.zsh
rename to tests/fixtures/subdir/custom1.zsh
diff --git a/test/fixtures/test1.sh b/tests/fixtures/test1.sh
similarity index 100%
rename from test/fixtures/test1.sh
rename to tests/fixtures/test1.sh
diff --git a/test/fixtures/test2.sh b/tests/fixtures/test2.sh
similarity index 100%
rename from test/fixtures/test2.sh
rename to tests/fixtures/test2.sh
diff --git a/test/travis/docker-compose.yml b/tests/travis/docker-compose.yml
similarity index 100%
rename from test/travis/docker-compose.yml
rename to tests/travis/docker-compose.yml
diff --git a/test/travis/test-runner.sh b/tests/travis/test-runner.sh
similarity index 100%
rename from test/travis/test-runner.sh
rename to tests/travis/test-runner.sh
