Skip to content

Commit

Permalink
Debug
Browse files Browse the repository at this point in the history
  • Loading branch information
sashacmc committed Dec 12, 2024
1 parent 23c811d commit 43d74ee
Showing 1 changed file with 35 additions and 35 deletions.
70 changes: 35 additions & 35 deletions tests/memory_leak.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@
import time

# Specify the directory for the binaries
DIR_EXAMPLES = "build/examples"
# DIR_EXAMPLES = "build/examples"

NO_LEAK_OUTPUT = "All heap blocks were freed -- no leaks are possible"
# NO_LEAK_OUTPUT = "All heap blocks were freed -- no leaks are possible"

VALGRIND_CMD = f"stdbuf -oL -eL valgrind --leak-check=full ./{DIR_EXAMPLES}/"
# VALGRIND_CMD = f"stdbuf -oL -eL valgrind --leak-check=full ./{DIR_EXAMPLES}/"


def failure_mode(fail_cmd):
Expand Down Expand Up @@ -154,35 +154,35 @@ def query_and_queryable(query_cmd, queryable_cmd):

if __name__ == "__main__":
print("!!!!! Start")
signal.signal(signal.SIGINT, signal.SIG_IGN)
print("!!!!! Signal set")
EXIT_STATUS = 0

# Test failure mode
print("*** Failure mode ***")
if failure_mode('z_pub -m peer') == 1:
EXIT_STATUS = 1
# Test pub and sub examples
print("*** Pub & sub test ***")
if pub_and_sub('z_pub -n 1', 'z_sub -n 1') == 1:
EXIT_STATUS = 1
print("*** Pub & sub attachment test ***")
if pub_and_sub('z_pub_attachment -n 1', 'z_sub_attachment -n 1') == 1:
EXIT_STATUS = 1
# Test query and queryable examples
print("*** Query & queryable test ***")
if query_and_queryable('z_get', 'z_queryable -n 1') == 1:
EXIT_STATUS = 1
print("*** Query & queryable attachment test ***")
if query_and_queryable('z_get_attachment -v Something', 'z_queryable_attachment -n 1') == 1:
EXIT_STATUS = 1
# Test liveliness query
print("*** Get liveliness test ***")
if query_and_queryable('z_get_liveliness', 'z_liveliness') == 1:
EXIT_STATUS = 1
# Test liveliness subscriber
print("*** Liveliness subscriber test ***")
if query_and_queryable('z_sub_liveliness -h -n 1', 'z_liveliness') == 1:
EXIT_STATUS = 1
# Exit
sys.exit(EXIT_STATUS)
# signal.signal(signal.SIGINT, signal.SIG_IGN)
# print("!!!!! Signal set")
# EXIT_STATUS = 0

## Test failure mode
# print("*** Failure mode ***")
# if failure_mode('z_pub -m peer') == 1:
# EXIT_STATUS = 1
## Test pub and sub examples
# print("*** Pub & sub test ***")
# if pub_and_sub('z_pub -n 1', 'z_sub -n 1') == 1:
# EXIT_STATUS = 1
# print("*** Pub & sub attachment test ***")
# if pub_and_sub('z_pub_attachment -n 1', 'z_sub_attachment -n 1') == 1:
# EXIT_STATUS = 1
## Test query and queryable examples
# print("*** Query & queryable test ***")
# if query_and_queryable('z_get', 'z_queryable -n 1') == 1:
# EXIT_STATUS = 1
# print("*** Query & queryable attachment test ***")
# if query_and_queryable('z_get_attachment -v Something', 'z_queryable_attachment -n 1') == 1:
# EXIT_STATUS = 1
## Test liveliness query
# print("*** Get liveliness test ***")
# if query_and_queryable('z_get_liveliness', 'z_liveliness') == 1:
# EXIT_STATUS = 1
## Test liveliness subscriber
# print("*** Liveliness subscriber test ***")
# if query_and_queryable('z_sub_liveliness -h -n 1', 'z_liveliness') == 1:
# EXIT_STATUS = 1
## Exit
# sys.exit(EXIT_STATUS)

0 comments on commit 43d74ee

Please sign in to comment.