-
Notifications
You must be signed in to change notification settings - Fork 5
Debugging Granary: Test Suite
Granary's test suite can only be run from user space. The test suite uses the Google C++ testing and mocking frameworks to test various parts of Granary. The majority of the tests focus on trying to evaluate whether or not Granary's translation process is correct.
The following command will build and run Granary's test suite.
make clean test GRANARY_TARGET=test
Note: The GRANARY_TARGET=test
is required.
If you encounter a compiler error saying that the file gmock/gmock.h
could not be found then some of Granary's dependencies might not have been correctly fetched. Run the following commands:
git submodule init
git submodule update
Granary can be used to instrument itself. The test
target is explicitly set up for this purpose; however, you will need to compile it with GRANARY_RECURSIVE=1
. After re-building the test cases, you can run Granary recursively by doing:
./bin/debug_linux_user/grr -- ./bin/test_linux_user/granary.out
In the above command, grr
is Granary's user-space "injector", and is part of a debug
build. Also, granary.out
is the name of the executable that runs Granary through its tests.