LPS-51439 Refactor compile-test-cmd as a macro