Need to simplify the cmake of inference's unittest
Created by: Xreki
When we add an inference unittest, we need to add a cc_test
and set_tests_properties
to ensure the C++ unittest running after the corresponding Python unittest.
It is the same for all unittests, so that we can write a common function to simplify the CMakeLists.txt.