doc: reformat guidelines

- use markdown format instead of simple text file

Change-Id: I5a20cee4ad5b2f9653deada839b699f9634fba28
Signed-off-by: Jacek Danecki <jacek.danecki@intel.com>
This commit is contained in:
Jacek Danecki
2018-06-11 17:49:25 +02:00
committed by sys_ocldev
parent 5007c60a03
commit 892cf13c15
3 changed files with 44 additions and 49 deletions

View File

@ -0,0 +1,43 @@
File to cover guidelines for NEO project.
# C++ usage
* use c++ style casts instead of c style casts.
* do not use default parameters
* prefer using over typedef
* avoid defines for constants, use constexpr
* prefer forward declarations in headers
* avoid includes in headers unless absolutely necessary
# Naming conventions
* use camelCase for variables names
* prefer verbose variable names
```
bad examples : sld, elws, aws
good examples : sourceLevelDebugger, enqueuedLocalWorkGroupSize, actualWorkGroupSize
```
* follow givenWhenThen test naming pattern, indicate what is interesting in the test
bad examples :
```
TEST(CsrTests, initialize)
TEST(CQTests, simple)
TEST(CQTests, basic)
TEST(CQTests, works)
```
good examples:
```
TEST(CommandStreamReceiverTests, givenCommandStreamReceiverWhenItIsInitializedThenProperFieldsAreSet)
TEST(CommandQueueTests, givenCommandQueueWhenEnqueueIsDoneThenTaskLevelIsModifed)
TEST(CommandQueueTests, givenCommandQueueWithDefaultParamtersWhenEnqueueIsDoneThenTaskCountIncreases)
TEST(CommandQueueTests, givenCommandQueueWhenEnqueueWithBlockingFlagIsSetThenDriverWaitsUntilAllCommandsAreCompleted)
```
# Testing mindset
* Test behaviors instead of implementations, do not focus on adding a test per every function in the
class (avoid tests for setters and getters), focus on the functionality you are adding and how it changes
the driver behavior, do not bind tests to implementation.
* Make sure that test is fast, our test suite needs to complete in seconds for efficient development pace, as
a general rule test shouldn't be longer then 1ms in Debug driver.

View File

@ -1,48 +0,0 @@
File to cover guidelines for NEO project.
[============================================================================]
C++ usage
[============================================================================]
- use c++ style casts instead of c style casts.
- do not use default parameters
- prefer using over typedef
- avoid defines for constants, use constexpr
- prefer forward declarations in headers
- avoid includes in headers unless absolutely necessary
[============================================================================]
Naming conventions
[============================================================================]
- use camelCase for variables names
- prefer verbose variable names
bad examples : sld, elws, aws
good examples : sourceLevelDebugger, enqueuedLocalWorkGroupSize, actualWorkGroupSize
- follow givenWhenThen test naming pattern, indicate what is interesting in the test
bad examples :
TEST(CsrTests, initialize)
TEST(CQTests, simple)
TEST(CQTests, basic)
TEST(CQTests, works)
good examples:
TEST(CommandStreamReceiverTests, givenCommandStreamReceiverWhenItIsInitializedThenProperFieldsAreSet)
TEST(CommandQueueTests, givenCommandQueueWhenEnqueueIsDoneThenTaskLevelIsModifed)
TEST(CommandQueueTests, givenCommandQueueWithDefaultParamtersWhenEnqueueIsDoneThenTaskCountIncreases)
TEST(CommandQueueTests, givenCommandQueueWhenEnqueueWithBlockingFlagIsSetThenDriverWaitsUntilAllCommandsAreCompleted)
[============================================================================]
Testing mindset
[============================================================================]
- Test behaviors instead of implementations, do not focus on adding a test per every function in the
class (avoid tests for setters and getters), focus on the functionality you are adding and how it changes
the driver behavior, do not bind tests to implementation.
- Make sure that test is fast, our test suite needs to complete in seconds for efficient development pace, as
a general rule test shouldn't be longer then 1ms in Debug driver.

View File

@ -19,7 +19,7 @@
# OTHER DEALINGS IN THE SOFTWARE. # OTHER DEALINGS IN THE SOFTWARE.
set(RUNTIME_CODING_GUIDELINES set(RUNTIME_CODING_GUIDELINES
${CMAKE_CURRENT_SOURCE_DIR}/../../documentation/GUIDELINES.txt ${CMAKE_CURRENT_SOURCE_DIR}/../../documentation/GUIDELINES.md
) )
target_sources(${NEO_STATIC_LIB_NAME} PRIVATE ${RUNTIME_CODING_GUIDELINES}) target_sources(${NEO_STATIC_LIB_NAME} PRIVATE ${RUNTIME_CODING_GUIDELINES})
set_property(GLOBAL PROPERTY RUNTIME_CODING_GUIDELINES ${RUNTIME_CODING_GUIDELINES}) set_property(GLOBAL PROPERTY RUNTIME_CODING_GUIDELINES ${RUNTIME_CODING_GUIDELINES})