<div dir="ltr">Anyone want to review? Thanks.<br><div class="gmail_extra"><br><br><div class="gmail_quote">On Wed, Nov 13, 2013 at 2:19 PM, Frank Henigman <span dir="ltr"><<a href="mailto:fjhenigman@google.com" target="_blank">fjhenigman@google.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Signed-off-by: Frank Henigman <<a href="mailto:fjhenigman@google.com">fjhenigman@google.com</a>><br>
---<br>
Paul's patch for HACKING inspired me to go through my notes for mistakes I<br>
made trying to contribute, and for suggestions seen on the list or irc.<br>
Note: I do not have commit access.<br>
<br>
HACKING | 22 ++++++++++++++++++++++<br>
1 file changed, 22 insertions(+)<br>
<br>
diff --git a/HACKING b/HACKING<br>
index d96b994..815de5b 100644<br>
--- a/HACKING<br>
+++ b/HACKING<br>
@@ -73,6 +73,9 @@ Basic formatting:<br>
* Function return type and name go on successive lines<br>
* Opening function brace goes on line by itself<br>
* Opening statement braces go on same line as the 'for' or 'else'<br>
+* Use /* C style comments */, not // C++ style<br>
+* Don't write 'if (condition) statement;' on one line - put the statement on<br>
+ a separate line. Braces around a single statement are optional.<br>
<br>
The following indent command will generally format your code for piglit's<br>
style:<br>
@@ -94,6 +97,9 @@ Code conventions:<br>
* Preprocessor macros should be UPPER_CASE<br>
* Enumeration tokens should be UPPER_CASE<br>
* Most other identifiers are lower_case_with_underscores<br>
+* Library, executable, and source file names are '<base>_<api>.'<br>
+ e.g. libpiglitutil_gles2<br>
+* Test names are '<lowercasegroupname>-<testname>.' e.g. glsl-novertexdata<br>
* Use int, float, bool except when GL types (GLint, GLfloat) are really needed<br>
* Don't put declarations after code. For example:<br>
if (x < 3)<br>
@@ -102,10 +108,26 @@ Code conventions:<br>
This will not compile with MSVC. The 'int y' declaration must be at the<br>
top of the brace-block.<br>
* Don't use named/designated initializers. They don't compile with MSVC.<br>
+<br>
+<br>
+Test conventions:<br>
+<br>
+* The goal is to find bugs and demonstrate them as simply as possible, not<br>
+ to measure performance or demonstrate features.<br>
* Write tests that are easily read, understood and debugged. Long, complicated<br>
functions are frowned upon.<br>
* Don't try to test too much in a single test program. Most piglit programs<br>
are less than 300 lines long.<br>
+* If a test doesn't render anything, it doesn't need to set the window size.<br>
+* Avoid changing an existing testing such that it might fail where it<br>
+ previously passed. Break it into subtests and add a new subtest, or add<br>
+ a new test which supersedes the old one.<br>
+* Things that should be seen are drawn in green (or blue as a second color)<br>
+ while red is for things that shouldn't be seen.<br>
+* Calculate drawing coordinates from piglit_width/piglit_height as needed,<br>
+ instead of hard coding.<br>
+* If a test can safely run at the same time as other tests, add it as a<br>
+ concurrent test in 'all.tests' (or wherever you add it).<br>
<br>
<br>
Utility code:<br>
<span class="HOEnZb"><font color="#888888">--<br>
1.8.4.1<br>
<br>
</font></span></blockquote></div><br></div></div>