Skip to content

Commit

Permalink
#171 @call --tracing
Browse files Browse the repository at this point in the history
  • Loading branch information
xonixx committed Jan 1, 2025
1 parent ab31f37 commit 5b3e70b
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 1 deletion.
6 changes: 5 additions & 1 deletion makesure.awk
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,11 @@ function handleCalls( i) {

function processCalls( i) {
for (i = 2; i <= NF; i++)
addCodeLine(quoteArg(ProgAbs) ("silent" in Options ? " --silent" : "") ("timing" in Options ? " --timing --timing-skip-total" : "") " --file " quoteArg(MakesurefileAbs) " " quoteArg($i))
addCodeLine(quoteArg(ProgAbs)\
("silent" in Options ? " --silent" : "")\
("timing" in Options ? " --timing --timing-skip-total" : "")\
("tracing" in Options ? " --tracing" : "")\
" --file " quoteArg(MakesurefileAbs) " " quoteArg($i))
}

function registerUseLib(goalName) {
Expand Down
24 changes: 24 additions & 0 deletions tests/32_calls.tush
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,27 @@ $ touch /tmp/x ; ./$MAKESURE -f tests/32_calls.sh x-updated --timing | sed 's#to
| goal 'x-updated' took X
| total time X

$ touch /tmp/x ; ./$MAKESURE -f tests/32_calls.sh x-updated --tracing 2>&1 | awk -f tests/unify_tracing_output.awk
| goal 'x-updated' ...
| goal 'x-deleted' ...
| running x-deleted
| goal 'x-created' ...
| running x-created
@ + : x-updated
@ + cd /some/path/tests
@ + /some/path/makesure_dev --tracing --file /some/path/tests/32_calls.sh x-deleted
@ + : x-deleted@reached_if
@ + cd /some/path/tests
@ + test -e /tmp/x
@ + : x-deleted
@ + cd /some/path/tests
@ + echo 'running x-deleted'
@ + rm /tmp/x
@ + /some/path/makesure_dev --tracing --file /some/path/tests/32_calls.sh x-created
@ + : x-created@reached_if
@ + cd /some/path/tests
@ + test -f /tmp/x
@ + : x-created
@ + cd /some/path/tests
@ + echo 'running x-created'
@ + touch /tmp/x
2 changes: 2 additions & 0 deletions tests/unify_tracing_output.awk
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
{
sub(/cd .+\/tests/,"cd /some/path/tests") # my dir
sub(/--file .+\/tests/,"--file /some/path/tests") # my dir
sub(/\/.+\/makesure_dev/,"/some/path/makesure_dev")
sub(/'\['/,"[")
sub(/'\]'/,"]")
sub(/echo 'A=aaa'/,"echo A=aaa")
Expand Down

0 comments on commit 5b3e70b

Please sign in to comment.