* [PATCH babeltrace] Port: don't quote wc output in test scripts
@ 2017-08-30 18:29 Michael Jeanson
0 siblings, 0 replies; 2+ messages in thread
From: Michael Jeanson @ 2017-08-30 18:29 UTC (permalink / raw)
To: lttng-dev; +Cc: jgalar
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.
Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
---
tests/cli/intersection/test_intersection.in | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/tests/cli/intersection/test_intersection.in b/tests/cli/intersection/test_intersection.in
index 07a267f..7cea9be 100644
--- a/tests/cli/intersection/test_intersection.in
+++ b/tests/cli/intersection/test_intersection.in
@@ -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
_______________________________________________
lttng-dev mailing list
lttng-dev@lists.lttng.org
https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH babeltrace] Port: don't quote wc output in test scripts
[not found] <1504117766-13198-1-git-send-email-mjeanson@efficios.com>
@ 2017-08-31 20:54 ` Jérémie Galarneau
0 siblings, 0 replies; 2+ messages in thread
From: Jérémie Galarneau @ 2017-08-31 20:54 UTC (permalink / raw)
To: Michael Jeanson; +Cc: lttng-dev, Jeremie Galarneau
Merged, thanks!
Jérémie
On 30 August 2017 at 14:29, Michael Jeanson <mjeanson@efficios.com> wrote:
> 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.
>
> Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
> ---
> tests/cli/intersection/test_intersection.in | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/tests/cli/intersection/test_intersection.in b/tests/cli/intersection/test_intersection.in
> index 07a267f..7cea9be 100644
> --- a/tests/cli/intersection/test_intersection.in
> +++ b/tests/cli/intersection/test_intersection.in
> @@ -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
>
--
Jérémie Galarneau
EfficiOS Inc.
http://www.efficios.com
_______________________________________________
lttng-dev mailing list
lttng-dev@lists.lttng.org
https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2017-08-31 20:54 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-08-30 18:29 [PATCH babeltrace] Port: don't quote wc output in test scripts Michael Jeanson
[not found] <1504117766-13198-1-git-send-email-mjeanson@efficios.com>
2017-08-31 20:54 ` Jérémie Galarneau
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.