Skip to main content
aboutsummaryrefslogtreecommitdiffstats
blob: ad267563bceea809769d94743c792d82f03613ed (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
/*******************************************************************************
 * Copyright (c) 2011, 2012 Anton Gorenkov 
 *
 * This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License 2.0
 * which accompanies this distribution, and is available at
 * https://www.eclipse.org/legal/epl-2.0/
 *
 * SPDX-License-Identifier: EPL-2.0
 *
 * Contributors:
 *     Anton Gorenkov - initial API and implementation
 *******************************************************************************/
package org.eclipse.cdt.testsrunner.model;

/**
 * The interface to easily build or update testing model.
 * It is intended to use from the Tests Runner provider plug-in.
 * 
 * @noextend This interface is not intended to be extended by clients.
 * @noimplement This interface is not intended to be implemented by clients.
 */
public interface ITestModelUpdater {

	/**
	 * Specifies that a new test suite has been started.
	 * 
	 * @param name the name of the started test suite
	 */
	public void enterTestSuite(String name);
	
	/**
	 * Specifies that the last test suite has been finished.
	 * Automatically exists from the currently running test case (if any).
	 */
	public void exitTestSuite();
	
	/**
	 * Specifies that a new test case has been started.
	 * 
	 * @param name the name of the started test case
	 */
	public void enterTestCase(String name);
	
	/**
	 * Sets the status of the currently running test case.
	 * The exception is thrown if no test case is running.
	 * 
	 * @param status new test status
	 */
	public void setTestStatus(ITestItem.Status status);
	
	/**
	 * Sets the execution time of the currently running test case.
	 * If the execution time has already been set, it will be overridden.
	 * The exception is thrown if no test case is running.
	 * 
	 * @param testingTime test execution time
	 */
	public void setTestingTime(int testingTime);
	
	/**
	 * Specifies that the currently running test case has been finished.
	 * The test execution time is set if Tests Runner provider plug-in 
	 * requires time measurement.
	 */
	public void exitTestCase();
	
	/**
	 * Add a new testing message connected to the currently running test case.
	 * 
	 * @param file message file name
	 * @param line message line number
	 * @param level message level
	 * @param text message text
	 * 
	 * @note If file name is <code>null</code> or empty or if line number is
	 * negative or 0 then message location will not be set.
	 */
	public void addTestMessage(String file, int line, ITestMessage.Level level, String text);
	
	
	/**
	 * Access the top most currently running test suite object.
	 * 
	 * @return top most test suite
	 */
	public ITestSuite currentTestSuite();
	
	/**
	 * Access the currently running test case object.
	 * 
	 * @return top most test case
	 */
	public ITestCase currentTestCase();
	
}

Back to the top