aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnastasis Grammenos <anastasis.gramm2@gmail.com>2018-10-07 18:09:18 +0300
committerAnastasis Grammenos <anastasis.gramm2@gmail.com>2018-10-07 18:09:18 +0300
commit02aa2496d9eaf5c6f1234df1f91b8e312ee10022 (patch)
treef52a8ca7d199c3fb7221584631381ee7cecb2e24
parent0f4666c797bf8670e966e6583fd7c90b0d243be0 (diff)
downloadck-02aa2496d9eaf5c6f1234df1f91b8e312ee10022.tar.gz
ck-02aa2496d9eaf5c6f1234df1f91b8e312ee10022.tar.bz2
ck-02aa2496d9eaf5c6f1234df1f91b8e312ee10022.zip
Add count to test output
-rwxr-xr-xres/check_ck9
-rw-r--r--unit/ck-test.c11
2 files changed, 13 insertions, 7 deletions
diff --git a/res/check_ck b/res/check_ck
index 3f6c618..423d3bd 100755
--- a/res/check_ck
+++ b/res/check_ck
@@ -5,7 +5,8 @@ TEST_LOCATION=$(realpath @PROJECT_TESTING_GROUNDS@)
# used in regression tests
function running {
- echo "=> testing $1"
+ echo "[$COUNT/$TOTAL] testing $1"
+ ((++COUNT))
}
# used in regression tests
@@ -45,9 +46,11 @@ function regression_tests {
echo -e "Regression Tests:"
echo -e "~~~~~~~~~~~~~~~~~"
DIR=@BIN_TESTS_DIR@
- for i in $( ls $DIR ); do
+ COUNT=1
+ TOTAL=$(ls $DIR | wc -l)
+ for i in $(ls $DIR); do
ERROR="TEST "$i" FAILED:"
- PASS="$i passed\n"
+ PASS="=> $i passed\n"
source $DIR/$i
wait $!
done
diff --git a/unit/ck-test.c b/unit/ck-test.c
index 42941f9..b907576 100644
--- a/unit/ck-test.c
+++ b/unit/ck-test.c
@@ -4,9 +4,12 @@
#include "cklist.h"
+/* total number of unit tests */
+#define TOTAL 1
+
#define CK_UNIT_TESTS \
X(ck_list_init, "Basic cklist test")
-// X(ck_list_add, "Add elements to ck list")
+ // X(ck_list_add, "Add elements to ck list")
void ck_list_init() {
cklist *ckl1 = list_make_new();
@@ -23,14 +26,14 @@ void ck_list_init() {
}
void ck_list_add() {
- printf("Test2\n");
}
int main() {
+ int count = 1;
#define X(TEST, DESC) \
- printf("=> %s\n", DESC); \
+ printf("[%d/%d] %s\n", count++, TOTAL, DESC); \
TEST(); \
- printf("Passed\n\n");
+ printf("=> Passed\n\n");
CK_UNIT_TESTS
#undef X
}