Files
rocm-systems/tests/README.md
T

64 lines
1.5 KiB
Markdown
Raw Normal View History

# HIP testing environment.
2016-01-26 20:14:33 -06:00
This document explains how to use the HIP CMAKE testing environment.
### Quickstart
Usage :
2016-02-26 19:38:22 -06:00
```
$ mkdir build
$ cd build
$ cmake ../src
$ make
$ make test
```
2016-01-26 20:14:33 -06:00
2016-02-26 19:39:14 -06:00
### How to add a new test
2016-01-26 20:14:33 -06:00
2016-06-17 14:56:53 -05:00
The tests/src/runtimeApi/memory/hipMemtest.cpp file contains a simple unit test and is a good starting point for other tests.
Copy this to a new test name and modify tests/src/CMakefiles.txt to add the test to the build environment.
2016-01-26 20:14:33 -06:00
2016-06-17 14:56:53 -05:00
Recent versions of the test infrastructure use a hierarchy of folders. Each folder contains src and CMakefiles.txt file.
See the CMakefiles.txt files for description of the intended purpose for each sub-directory.
#### Edit CMakefiles.txt:
// Example:
2016-02-26 19:38:22 -06:00
```
2016-06-17 14:56:53 -05:00
# Build the test executable:
build_hip_executable (hipMemset hipMemset.cpp)
# This runs the tests with the specified command-line testing.
# Multiple make_test may be specified.
2016-02-26 19:38:22 -06:00
make_test(hipMemset " ")
```
2016-01-26 20:14:33 -06:00
2016-06-17 14:56:53 -05:00
It is recommended to place the build and run steps adjacent in the CMakefiles.txt.
2016-02-26 19:39:14 -06:00
### Running tests:
2016-02-26 19:38:22 -06:00
```
ctest
2016-02-26 19:38:22 -06:00
```
2016-01-26 20:14:33 -06:00
### Run subsets of all tests:
2016-02-26 19:38:22 -06:00
```
# Run one test on the commandline (obtain commandline parms from CMakefiles.tst)
2016-01-26 20:14:33 -06:00
./hipMemset
# Run all the memory tests:
ctest -R Memcpy
2016-02-26 19:38:22 -06:00
```
2016-01-26 20:14:33 -06:00
2016-09-02 09:38:42 -05:00
2016-09-22 17:51:52 -05:00
### If a test fails - how to debug a test
2016-09-02 09:38:42 -05:00
2016-11-10 10:53:10 -06:00
Find the test and commandline that fail:
2016-09-22 17:51:52 -05:00
(From the test build directory, perhaps hip/tests/build)
2016-11-10 10:53:10 -06:00
grep -IR hipMemcpy-modes -IR ../tests/
../tests/src/runtimeApi/memory/hipMemcpy.cpp: * RUN_NAMED: %t hipMemcpy-modes --tests 0x1