build: create test_addons function
test/addons/.buildstamp and test/addons-napi/.buildstamp targets are very similar except that they operate on different directories. This commit extracts the common parts into a function to avoid the duplication.
Checklist
-
make -j4 test
(UNIX), orvcbuild test
(Windows) passes -
commit message follows commit guidelines
Affected core subsystem(s)
build