[v2,09/16] tests/es3conform: use Piglit exceptions

Submitted by Dylan Baker on May 18, 2015, 5:57 p.m.

Details

Message ID 1431971870-20138-10-git-send-email-baker.dylan.c@gmail.com
State New, archived
Headers show

Not browsing as part of any series.

Commit Message

Dylan Baker May 18, 2015, 5:57 p.m.
This makes all of the integrated tests use the new exceptions code,
which simplifies testing and makes error messages nicer.

Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com>
---
 framework/tests/integration_tests.py | 11 -----------
 tests/es3conform.py                  |  6 +++---
 2 files changed, 3 insertions(+), 14 deletions(-)

Patch hide | download patch | download mbox

diff --git a/framework/tests/integration_tests.py b/framework/tests/integration_tests.py
index 664fad1..dc584b3 100644
--- a/framework/tests/integration_tests.py
+++ b/framework/tests/integration_tests.py
@@ -28,7 +28,6 @@  errors and to ensure that the API hasn't changed without fixing these modules
 
 from __future__ import print_function, absolute_import
 import importlib
-import ConfigParser
 
 from nose.plugins.skip import SkipTest
 
@@ -53,16 +52,6 @@  def _import(name):
     except exceptions.PiglitFatalError:
         raise SkipTest('The module experienced a fatal error. '
                        'This may be expected.')
-    except (ConfigParser.NoOptionError, ConfigParser.NoSectionError):
-        # FIXME: This is a legacy path
-        raise SkipTest('No config section for {}'.format(name))
-    except SystemExit as e:
-        # FIXME: This is a legacy path
-        if e.code == 0:
-            # This means that it's a normal operation, but not that it's a pass
-            raise SkipTest('Profile exited normally.')
-        else:
-            raise Exception('Profile exited. code: {}.'.format(e.code))
 
 
 def test_xts_import():
diff --git a/tests/es3conform.py b/tests/es3conform.py
index cde2824..42080dc 100644
--- a/tests/es3conform.py
+++ b/tests/es3conform.py
@@ -21,12 +21,11 @@ 
 # DEALINGS IN THE SOFTWARE.
 
 import re
-import sys
 from os import path
 
 from framework.profile import TestProfile
 from framework.test import TEST_BIN_DIR, Test
-from framework import grouptools
+from framework import grouptools, exceptions
 
 __all__ = ['profile']
 
@@ -39,7 +38,8 @@  __all__ = ['profile']
 #############################################################################
 
 if not path.exists(path.join(TEST_BIN_DIR, 'GTF3')):
-    sys.exit(0)
+    raise exceptions.PiglitFatalError(
+        'Missing GTF3 symlink. Unable to run es3conform tests.')
 
 profile = TestProfile()