Index

lognestmonster / 0d7cbe3

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

Latest Commit

{#}TimeHashSubjectAuthor#(+)(-)GPG?
12325 Sep 2019 15:3354ba274Update behaviorJosh Stockin111N

Blob @ lognestmonster / test

text/x-shellscript881 bytesdownload raw
1#!/usr/bin/env bash
2
3mkdir -p bin
4
5py() {
6 python3 $@
7}
8
9success() {
10 echo -e "\033[92m\033[1m\033[7m${@}\033[0m"
11}
12
13success_lite() {
14 echo -e "\033[92m${@}\033[0m"
15}
16
17error() {
18 echo -e "\033[91m\033[7m\033[1m${@}\033[0m"
19}
20
21warn() {
22 echo -e "\033[93m\033[1m\033[7m${@}\033[0m"
23}
24
25warn_lite() {
26 echo -e "\033[93m${@}\033[0m"
27}
28
29run() {
30 warn_lite "python3 ${@}"
31 py $@
32 code=$?
33 if [ ${code} -ne 0 ]
34 then
35 error "Error in test '${@}'. Exiting..."
36 exit ${code}
37 else
38 success_lite "Success in test '${@}'."
39 fi
40 echo
41}
42
43run_tests() {
44 # Test prep (generate log files)
45 warn "Undergoing test preparations"
46 run ./tests/write.py ./bin/w1.lnm
47 run ./tests/write_many.py ./bin/w2.lnm 1000
48 echo
49
50 # Unit tests
51 warn "Beginning unit tests"
52 run ./tests/unit_parserargs.py
53 echo
54
55 success "Finished! Exiting with code 0"
56}
57
58run_tests
59
60echo -e "Time elapsed: ${SECONDS} second(s)"
61