Index

lognestmonster / 756852d

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

Latest Commit

{#}TimeHashSubjectAuthor#(+)(-)GPG?
11712 Sep 2019 18:15711a196update cross platform commandsJosh Stockin133N

Blob @ lognestmonster / test

text/x-shellscript614 bytesdownload raw
1#!/usr/bin/env bash
2
3mkdir -p bin
4
5py() {
6 python3 $@
7}
8
9good() {
10 echo -e "\033[92m${1}\033[0m"
11}
12
13bad() {
14 echo -e "\033[91m\033[7m${1}\033[0m"
15}
16
17warn() {
18 echo -e "\033[93m${1}\033[0m"
19}
20
21run() {
22 py $@
23 code=$?
24 if [ ${code} -ne 0 ]
25 then
26 bad "Error in test '${@}'. Exiting..."
27 exit ${code}
28 fi
29}
30
31run_tests() {
32 # Test prep (generate log files)
33 warn "Undergoing test preparations"
34 run ./tests/write.py ./bin/w1.lnm
35 run ./tests/write_many.py ./bin/w2.lnm 100
36 echo
37
38 # Unit tests
39 warn "Beginning unit tests"
40 run ./tests/unit_parserargs.py
41 echo
42
43 good "Finished! Exiting with code 0..."
44}
45
46run_tests
47