diff options
author | Rico Tzschichholz <ricotz@ubuntu.com> | 2016-09-26 20:01:31 +0200 |
---|---|---|
committer | Rico Tzschichholz <ricotz@ubuntu.com> | 2017-11-19 12:35:04 +0100 |
commit | 99959f8ececf19c143f672a9600068a551bf480d (patch) | |
tree | 8f9537b9b1410c3d623e8014023aa886269913a5 | |
parent | 29a887812c48e529b00cc585b80982f9d592c676 (diff) | |
download | vala-99959f8ececf19c143f672a9600068a551bf480d.tar.gz |
Rename Module to TestModule
-rw-r--r-- | valadate/Makefile.am | 2 | ||||
-rw-r--r-- | valadate/testexplorer.vala | 14 | ||||
-rw-r--r-- | valadate/testmodule.vala (renamed from valadate/module.vala) | 16 |
3 files changed, 16 insertions, 16 deletions
diff --git a/valadate/Makefile.am b/valadate/Makefile.am index 1d6dbf7d2..6c71cf831 100644 --- a/valadate/Makefile.am +++ b/valadate/Makefile.am @@ -21,12 +21,12 @@ lib_LTLIBRARIES = \ $(NULL) libvaladate_la_VALASOURCES = \ - module.vala \ test.vala \ testcase.vala \ testconfig.vala \ testexplorer.vala \ testiterator.vala \ + testmodule.vala \ testresult.vala \ testrunner.vala \ testsuite.vala \ diff --git a/valadate/testexplorer.vala b/valadate/testexplorer.vala index 97a72f262..7c12b9ce3 100644 --- a/valadate/testexplorer.vala +++ b/valadate/testexplorer.vala @@ -27,7 +27,7 @@ internal class Valadate.TestExplorer : Vala.CodeVisitor { private TestSuite current; private Vala.CodeContext context; - private Module module; + private TestModule module; private string binary; private string? running; @@ -50,10 +50,10 @@ internal class Valadate.TestExplorer : Vala.CodeVisitor { throw new ConfigError.TESTPLAN ("Test Plan %s Not Found!", testplanfile); try { - module = new Module (binary); + module = new TestModule (binary); module.load_module (); load_test_plan (testplanfile); - } catch (ModuleError e) { + } catch (TestModuleError e) { throw new ConfigError.MODULE (e.message); } } @@ -83,7 +83,7 @@ internal class Valadate.TestExplorer : Vala.CodeVisitor { class.is_abstract != true) current.add_test (visit_testsuite (class)); - } catch (ModuleError e) { + } catch (TestModuleError e) { error (e.message); } class.accept_children (this); @@ -96,12 +96,12 @@ internal class Valadate.TestExplorer : Vala.CodeVisitor { return false; } - private unowned Constructor get_constructor (Vala.Class class) throws ModuleError { + private unowned Constructor get_constructor (Vala.Class class) throws TestModuleError { var attr = new Vala.CCodeAttribute (class.default_construction_method); return (Constructor)module.get_method (attr.name); } - public TestCase visit_testcase (Vala.Class testclass) throws ModuleError { + public TestCase visit_testcase (Vala.Class testclass) throws TestModuleError { unowned Constructor meth = get_constructor(testclass); var current_test = meth () as TestCase; current_test.name = testclass.name; @@ -129,7 +129,7 @@ internal class Valadate.TestExplorer : Vala.CodeVisitor { return current_test; } - public TestSuite visit_testsuite (Vala.Class testclass) throws ModuleError { + public TestSuite visit_testsuite (Vala.Class testclass) throws TestModuleError { unowned Constructor meth = get_constructor (testclass); var current_test = meth () as TestSuite; current_test.name = testclass.name; diff --git a/valadate/module.vala b/valadate/testmodule.vala index 1cf32c80a..eda6ac59e 100644 --- a/valadate/module.vala +++ b/valadate/testmodule.vala @@ -20,7 +20,7 @@ * Chris Daley <chebizarro@gmail.com> */ -public errordomain Valadate.ModuleError { +public errordomain Valadate.TestModuleError { NOT_FOUND, LOAD, METHOD @@ -29,30 +29,30 @@ public errordomain Valadate.ModuleError { /** * Represents a loadable module containing {@link Valadate.Test}s */ -public class Valadate.Module : Object { +public class Valadate.TestModule : Object { private string lib_path; private GLib.Module module; - public Module (string libpath) { + public TestModule (string libpath) { lib_path = libpath; } - public void load_module () throws ModuleError { + public void load_module () throws TestModuleError { if (!File.new_for_path (lib_path).query_exists ()) - throw new ModuleError.NOT_FOUND ("Module: %s does not exist", lib_path); + throw new TestModuleError.NOT_FOUND ("Module: %s does not exist", lib_path); module = GLib.Module.open (lib_path, ModuleFlags.BIND_LOCAL); if (module == null) - throw new ModuleError.LOAD (GLib.Module.error ()); + throw new TestModuleError.LOAD (GLib.Module.error ()); module.make_resident (); } - internal void* get_method (string method_name) throws ModuleError { + internal void* get_method (string method_name) throws TestModuleError { void* function; if (module.symbol (method_name, out function)) if (function != null) return function; - throw new ModuleError.METHOD (GLib.Module.error ()); + throw new TestModuleError.METHOD (GLib.Module.error ()); } } |