]> mj.ucw.cz Git - moe.git/commitdiff
Added dummy task type
authorTomas Gavenciak <gavento@ucw.cz>
Sat, 11 Sep 2010 15:44:43 +0000 (17:44 +0200)
committerTomas Gavenciak <gavento@ucw.cz>
Sat, 11 Sep 2010 15:44:43 +0000 (17:44 +0200)
t/moe/tasktypes/dummy.py [new file with mode: 0644]

diff --git a/t/moe/tasktypes/dummy.py b/t/moe/tasktypes/dummy.py
new file mode 100644 (file)
index 0000000..6262def
--- /dev/null
@@ -0,0 +1,35 @@
+"""
+
+Dummy task type.
+
+Adds several info-printing hooks to both pipelines.
+Runs the test pipeline for each TEST
+"""
+
+def init(e):
+      
+      def hook_m_50:
+         e.log.info('Here should be compiling')
+      
+      e.main_pipeline.insert(hook_m_50, 'dummy tasktype hook_m_50', 50)
+      
+      def hook_m_60:
+         e.log.info('Here should be test pipeline running')
+         tests = e['TESTS'].split()
+         for t in tests:
+              e.log.info('Running test %s' % t)
+              e.log.user.info('TEST %s ...' % t)
+
+              op = moe.config.Operation('SET', None, t, level=70, source='<dummy tasktype>')
+              testvar = e.config.lookup('TEST')
+              # Add and remove operation setting 'TEST="..."'
+              testvar.add_operation(op)
+              e.test_pipeline.run()
+              testvar.remove_operation(op)
+      
+      e.main_pipeline.insert(hook_m_60, 'dummy tasktype hook_m_60', 60) 
+      
+      def hook_t_30:
+         e.log.info("Maybe we should do something? Nah...")
+      
+      e.test_pipeline.insert(hook_t_30, 'dummy tasktype hook_t_30', 30)