Files
rocm-systems/tests/README.md
T

62 baris
1.6 KiB
Markdown
Mentah Pandangan Normal Riwayat

# 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
### If a test fails:
Extract the commandline from the testing log:
$ grep -A3 -m2 hipMemcpy-size Testing/Temporary/LastTest.log
36/47 Testing: hipMemcpy-size
36/47 Test: hipMemcpy-size
Command: "/home/bensander/git/compute/external/hip/hip/tests/b6.hcc-LC.debug/runtimeApi/memory/hipMemcpy" "--tests" "0x6"
Directory: /home/bensander/git/compute/external/hip/hip/tests/b6.hcc-LC.debug/runtimeApi/memory