Skip to content

Commit

Permalink
Add test drivers
Browse files Browse the repository at this point in the history
  • Loading branch information
tzussman committed Oct 7, 2022
1 parent 035b444 commit 6ec439c
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions examples/fail.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#!/usr/bin/env python3

# Preliminary error parsing script

import sys

from valparse import Parser

if len(sys.argv) != 2:
print("Usage: ./fail.py <xml_file>")
sys.exit(1)

filename = sys.argv[1]
valfile = Parser(filename)

if valfile.signal:
print(f"Fatal signal observed: {valfile.signal.signame}")
print("Do not award memory points if SIGABRT or SIGSEGV")
sys.exit()

if valfile.errcount:
print(f"{valfile.errcount} errors observed, do not award error points")
else:
print("No errors observed.")

if valfile.leakcount:
print(f"f{valfile.leakcount} leaks observed, do not award leak points")
else:
print("No leaks observed.")
Empty file modified examples/test.py
100644 → 100755
Empty file.

0 comments on commit 6ec439c

Please sign in to comment.