Shellcheck 0.10.0 shows:
$ shellcheck -x test-intersection.sh
In test-intersection.sh line 36:
ok $? "$totalevents events in the whole trace"
^-- SC2319 (warning): This $? refers to a condition, not a command. Assign to a variable to avoid it being overwritten.
For more information:
https://www.shellcheck.net/wiki/SC2319 -- This $? refers to a condition, no...
I think that Shellcheck is confused with what we're trying to do and
that the code is actually correct. Nevertheless, change the code to
circumvent this by using `is`, which looks nicer anyway.
This is not seen on the CI, since it currently runs Shellcheck 0.9.0.
Change-Id: I7bb861b478046ab327c5950c9deefa52953bc854
Signed-off-by: Simon Marchi <simon.marchi@efficios.com>
Reviewed-on: https://review.lttng.org/c/babeltrace/+/13316
Reviewed-by: Philippe Proulx <eeppeliteloop@gmail.com>
ok $? "run without --stream-intersection"
cnt=$(wc -l < "${stdout}")
- test "${cnt// /}" = "$totalevents"
- ok $? "$totalevents events in the whole trace"
+ is "${cnt// /}" "$totalevents" "$totalevents events in the whole trace"
bt_cli "${stdout}" "/dev/null" --stream-intersection "${trace}"
ok $? "run with --stream-intersection"
cnt=$(wc -l < "${stdout}")
- test "${cnt// /}" = "$intersect"
- ok $? "$intersect events in streams intersecting"
+ is "${cnt// /}" "$intersect" "$intersect events in streams intersecting"
}
test_intersect_fails() {