[PATCH v4 04/12] selftests/nolibc: add macros to reduce duplicated changes