1 stacktests.cpp is a unit test of the APIs in ocstack.c.
2 It uses Google Test for the unit tests. Note that
3 the unit tests are only to test the functionality of
4 ocstack.c. It is not a system or end-to-end test.
6 Unit Test Requirements:
8 1. Install Google Test on a Linux build machine
9 2. Create a file called "local.properties" in the
10 root/csdk/stack/test. local.properties is used
11 by the makefile and specifies the path to the
12 Google Test directory on the build machine.
13 Since local.properties is specific to each build
14 system, do not add local.properties to the code repo.
16 local.properties should contain GTEST_DIR.
20 GTEST_DIR := /home/johndoe/utils/gtest-1.7.0
22 3. The unit test assumes that the "eth0" interface is
23 available. If not, the unit tests will FAIL.
24 4. To run the unit test, first build the C OCStack.
25 At the time of this writing this was done by running
27 root/csdk/make deepclean
28 root/csdk/make BUILD=release *default
29 root/csdk/make BUILD=debug
31 5. Next, build the ocstack
32 root/csdk/stack/test/make clean
33 root/csdk/stack/test/make BUILD=release *default
34 root/csdk/stack/test/make BUILD=debug
36 6. Run the unit test by
37 root/csdk/stack/test/release/stacktests
38 root/csdk/stack/test/debug/stacktests