Add a global mechanism to the job object to allow users to change
the behaviour of profile_only, so that all tests default to
Signed-off-by: John Admanski <jadmanski@google.com>
git-svn-id: http://test.kernel.org/svn/autotest/trunk@3818 592f7852-d20e-0410-864c-8624ca9c26a4
diff --git a/client/common_lib/test_unittest.py b/client/common_lib/test_unittest.py
index 481bc72..9710fd0 100755
--- a/client/common_lib/test_unittest.py
+++ b/client/common_lib/test_unittest.py
@@ -22,6 +22,7 @@
def present(self):
return True
self.job = MockJob()
+ self.job.default_profile_only = False
self.job.profilers = MockProfilerManager()
self._new_keyval = False
self.iteration = 0
@@ -132,6 +133,19 @@
self.god.check_playback()
+ def test_execute_default_profile_only(self):
+ # test that profile_only=True works.
+ self.god.stub_function(self.test, 'drop_caches_between_iterations')
+ for _ in xrange(3):
+ self.test.drop_caches_between_iterations.expect_call()
+ self.test.run_once_profiling.expect_call(None)
+ self.test.postprocess.expect_call()
+ self.test.process_failed_constraints.expect_call()
+ self.test.job.default_profile_only = True
+ self.test.execute(iterations=3)
+ self.god.check_playback()
+
+
def test_execute_postprocess_profiled_false(self):
# test that postprocess_profiled_run=False works
self.god.stub_function(self.test, '_call_run_once')