1[]{#Unit_Test}Unit Test[](#Unit_Test){.section_anchor} 2====================================================== 3 4sfntly C++ port uses Google testing framework for unit testing. 5 6All test cases are under src/test. 7 8To run the unit test, you need to compile sfntly first, then copy 9Tuffy.ttf from data/ext to the folder that unit\_test(.exe) is located. 10Run the unit\_test. 11 12If you are only interested in one test case, for example, you are 13working on name table and only wants name editing test, you can use the 14gtest\_filter flag in command line. 15 16``` {.prettyprint} 17unit_test --gtest_filter=NameEditing.* 18``` 19 20For more info regarding running a subset of gtest, please see [GTest 21Advanced 22Guide](http://code.google.com/p/googletest/wiki/V1_6_AdvancedGuide). 23 24Its strongly suggested to run unit\_tests with valgrind. The following 25example shows a typical test command 26 27``` {.prettyprint} 28valgrind --leak-check=full -v ./unit_test --gtest_filter=*.*-FontData.* 29``` 30 31FontData tests are the longest and you may want to bypass them during 32development. They shall be run in bots, however. 33