Test 작성 방법
오호균 edited this page Jun 11, 2020
·
1 revision
test/
├── boot.test.cpp
├── grub.cfg
└── test.sh
test/
아래의 모든 *.test.cpp
파일에 대해 테스트 케이스가 생성됩니다.
현재는 파일 이름의 규칙에
[^\.\/]*\.test\.cpp
와 같은 제한이 있습니다. 또한, test 파일명은 unique해야 합니다.
모든 테스트 코드는 test_main()
을 정의하고 시작합니다.
// include your own headers.
#include <test.hpp>
void test_main() {
// do something
if (...) {
report_error();
}
assert_test(1 == 0);
report_success();
}
test_main()
에서는 끝나기 전에 반드시 report_error()
또는 report_success()
가 호출되어야 합니다.