~pwlars/lava-test/uninstall

« back to all changes in this revision

Viewing changes to abrek/builtins.py

  • Committer: Paul Larson
  • Date: 2010-06-29 21:23:04 UTC
  • mfrom: (8.1.7 abrek-run)
  • Revision ID: paul.larson@canonical.com-20100629212304-78lz9cdytxu6yah1
Add support for running tests, a run command, and an example using this

Show diffs side-by-side

added added

removed removed

Lines of Context:
13
13
        if len(argv) != 1:
14
14
            print "please specify the name of the test to install"
15
15
            sys.exit(1)
16
 
        testname = argv[0]
17
16
        test = testloader(argv[0])
18
17
        try:
19
18
            test.install()
20
19
        except RuntimeError as strerror:
21
20
            print "Test installation error: %s" % strerror
22
21
            sys.exit(1)
 
22
 
 
23
class cmd_run(AbrekCmd):
 
24
    def run(self, argv):
 
25
        if len(argv) != 1:
 
26
            print "please specify the name of the test to run"
 
27
            sys.exit(1)
 
28
        test = testloader(argv[0])
 
29
        try:
 
30
            test.run()
 
31
        except Exception as strerror:
 
32
            print "Test execution error: %s" % strerror
 
33
            sys.exit(1)