Skip to contentSkip to conversation

Port: don't quote wc output in test scripts

PATCH Jérémie Galarneau 1 participant 1 message Aug 31, 2017 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

Jérémie Galarneau

author Applied
#1 lore raw

Merged, thanks!

Jérémie

Quoted 28 lines · Michael Jeanson

The 'wc' command on macOS prefixes the count it returns with spaces, if we quote the output it won't be properly converted to integer for the comparison.

---
 tests/cli/intersection/test_intersection.in | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
tests/cli/intersection/test_intersection.in +2 -3
index 07a267f..7cea9be 100644
@@ -26,9 +26,9 @@ test_intersect() {
        totalevents="$2"
        intersect="$3"
 
-       test "$("${BT_BIN}" "$trace" | wc -l)" = "$totalevents"
+       test $("${BT_BIN}" "$trace" | wc -l) = "$totalevents"
        ok $? "$totalevents events in the whole trace"
-       test "$("${BT_BIN}" --stream-intersection "$trace" 2>/dev/null| wc -l)" = "$intersect"
+       test $("${BT_BIN}" --stream-intersection "$trace" 2>/dev/null| wc -l) = "$intersect"
        ok $? "$intersect events in packets intersecting"
 }
 
--

2.7.4

Signature · 7 lines
Jérémie Galarneau
EfficiOS Inc.
http://www.efficios.com
_______________________________________________
lttng-dev mailing list
[email protected]
https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev