Commit d7b88f4c by Wei Chen Committed by Tianqi Chen

Add instructions to run tests locally (#1868)

parent 6616355d
...@@ -24,3 +24,50 @@ This is a quick guide to submit a pull request, please also refer to the detaile ...@@ -24,3 +24,50 @@ This is a quick guide to submit a pull request, please also refer to the detaile
- The detailed guidelines and summarizes useful lessons. - The detailed guidelines and summarizes useful lessons.
- The patch can be merged after the reviewers approve the pull request. - The patch can be merged after the reviewers approve the pull request.
Testing
-------
Even though we have hooks to run unit tests automatically for each pull request, It's always recommended to run unit tests
locally beforehand to reduce reviewers' burden and speedup review process.
C++
^^^
.. code:: bash
# assume you are in tvm source root
TVM_ROOT=`pwd`
# you need to install google test first, gtest will be installed to $TVM_ROOT/lib
CACHE_PREFIX=. make -f 3rdparty/dmlc-core/scripts/packages.mk gtest
mkdir build
cd build
GTEST_LIB=$TVM_ROOT/lib cmake ..
make cpptest -j
for test in *_test; do
./$test || exit -1
done
Python
^^^^^^
If you want to run all tests:
.. code:: bash
# build tvm
make
./tests/scripts/task_python_unittest.sh
If you want to run a single test:
.. code:: bash
# build tvm
make
# let python know where to find tvm related libraries
export PYTHONPATH=python:topi/python
rm -rf python/tvm/*.pyc python/tvm/*/*.pyc python/tvm/*/*/*.pyc
TVM_FFI=ctypes python -m nose -v tests/python/unittest/test_pass_storage_rewrite.py
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment