Skip to content

Testing framework

gbelvin edited this page Jun 24, 2011 · 2 revisions

Charm Crypto Testing Framework

Each scheme in the ./schemes/ directory shall have a method that executes a basic test of the scheme named main that shall use assert to verify the correct functioning of the scheme like so

def main():
   #Run scheme
   m = 'message'
   c = scheme.encrypt(m)
   d = scheme.decrypt(c)
   assert m == d, "Decryption Failed"
   print("Scheme Works!")

if __name__ == "__main__":
   main()

`

Services offered by the framework

  • all_unittests.py searches for unit test classes and executes all tests that it finds
  • all_schemes.py executes the main test case for each scheme and displays the results
  • make test runs all tests on the framework, currently the two preceding tasks.