Generally, we use
'gn gen out/Debug' and
'ninja -C out/Debug chrome' to build the chromium. Sometimes we need some unit tests to be built and run to test those changes. Mostly the unit test targets had already generated by gn gen command. So all we have to do is look for the target name and invoke it from command line.
- Look for the ninja build file that containing the unit test source you want to build. For example, the ninja build file containing
'obj/base/base_unittests.ninja', which is driven by
'build.ninja'by a line
'build base$:base_unittests: phony ./base_unittests'.
- So, run
'ninja -C out/Debug base:base_unittests'to build the
- That’s all.