README.md 1.01 KB
Newer Older
1
2
3
Unit test
===

VoVAllen's avatar
VoVAllen committed
4
## Python Unittest
5
6
7
8
9
10
11
12
13
14
15
16
17
18
The code organization goes as follows:

* `backend`: Additional unified tensor interface for supported frameworks.
  The functions there are only used in unit tests, not DGL itself.  Note that
  the code there are not unit tests by themselves.
* `compute`: All framework-agnostic computation-related unit tests go there.
* `${DGLBACKEND}` (e.g. `pytorch` and `mxnet`): All framework-specific
  computation-related unit tests go there.
* `graph_index`: All unit tests for C++ graph structure implementation go
  there.  The Python API being tested in this directory, if any, should be
  as minimal as possible (usually simple wrappers of corresponding C++
  functions).
* `lint`: Pylint-related files.
* `scripts`: Automated test scripts for CI.
VoVAllen's avatar
VoVAllen committed
19
20
21
22
23
24
25
26
27
28
29

## C++ Unittest
Compile with unittest by executing the command below
```
# Assume current directory is the root directory of dgl, and googletest submodule is initialized
mkdir build
cd build
cmake .. -DBUILD_CPP_TEST=1
make -j${nproc}
./runUnitTests
```