Skip to content

Commit

Permalink
Measure runtime for paranoid tests
Browse files Browse the repository at this point in the history
  • Loading branch information
untergasser committed Aug 3, 2024
1 parent af3ca52 commit e26ace3
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# IDE files
.vscode/

# Compiled Object files
*.o

Expand Down
13 changes: 13 additions & 0 deletions src/paranoid_tests.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
export PATH=/usr/bin:$PATH

res1=$(date +%s.%N)

echo; echo; echo 'STARTING 1ST SET OF TESTS (-O2)'; echo; echo;
make clean
make test
Expand All @@ -12,3 +15,13 @@ make O_OPTS=-O0
cd ../test
make TESTOPTS=--valgrind

res2=$(date +%s.%N)
dt=$(echo "$res2 - $res1" | bc)
dd=$(echo "$dt/86400" | bc)
dt2=$(echo "$dt-86400*$dd" | bc)
dh=$(echo "$dt2/3600" | bc)
dt3=$(echo "$dt2-3600*$dh" | bc)
dm=$(echo "$dt3/60" | bc)
ds=$(echo "$dt3-60*$dm" | bc)

LC_NUMERIC=C printf "Total runtime: %d:%02d:%02d:%02.4f\n" $dd $dh $dm $ds

0 comments on commit e26ace3

Please sign in to comment.