Index

lognestmonster / 6dd952c

A general-purpose single-header C logging library and parser for event-based logs. (Incomplete)

Latest Commit

{#}TimeHashSubjectAuthor#(+)(-)GPG?
16208 Dec 2019 19:536dd952cUpdate unit testing and CI testing configurationJosh Stockin11947N

Blob @ lognestmonster / test

text/x-shellscript755 bytesdownload raw
1#!/usr/bin/env bash
2
3mkdir -p bin
4
5success() {
6 echo -e "\033[92m\033[1m\033[7m${@}\033[0m"
7}
8
9success_lite() {
10 echo -e "\033[92m${@}\033[0m"
11}
12
13error() {
14 echo -e "\033[91m\033[7m\033[1m${@}\033[0m"
15}
16
17warn() {
18 echo -e "\033[93m\033[1m\033[7m${@}\033[0m"
19}
20
21warn_lite() {
22 echo -e "\033[93m${@}\033[0m"
23}
24
25exit_on_error() {
26 if [ $1 -ne 0 ]
27 then
28 error "Error in test. Exiting..."
29 exit $1
30 else
31 success_lite "Success in test."
32 fi
33}
34
35handle() {
36 $1
37 exit_on_error $?
38}
39
40c_unit() {
41 warn "Running C unit test chain"
42 echo
43
44 # Compile C unit tests
45 warn_lite "Making C header unit test"
46 handle make c_unit
47 echo
48
49 warn_lite "Running C header unit test"
50 handle bin/c
51 echo
52
53 success "Finished"
54}
55
56$1
57
58echo -e "Time elapsed: ${SECONDS} second(s)"
59