2016-05-12 5 views
0

Valgrindは、テスト対象の実行ファイルが0で終了すると、終了コードが1になるのはなぜですか?テスト対象の実行ファイルが0で終了すると、Valgrindの終了コードが1になるのはなぜですか?

$ ./test 
Starting tests... 
ALL TESTS PASSED 
Tests run: 1 

$ valgrind --error-exitcode=123 test 
==27705== Memcheck, a memory error detector 
==27705== Copyright (C) 2002-2013, and GNU GPL'd, by Julian Seward et al. 
==27705== Using Valgrind-3.10.1 and LibVEX; rerun with -h for copyright info 
==27705== Command: test 
==27705== 
==27705== 
==27705== HEAP SUMMARY: 
==27705==  in use at exit: 0 bytes in 0 blocks 
==27705== total heap usage: 30 allocs, 30 frees, 3,681 bytes allocated 
==27705== 
==27705== All heap blocks were freed -- no leaks are possible 
==27705== 
==27705== For counts of detected and suppressed errors, rerun with: -v 
==27705== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0) 
$ echo $? 
1 

答えて

0

これは動作します:

$ valgrind --error-exitcode=123 ./test 
==27764== Memcheck, a memory error detector 
==27764== Copyright (C) 2002-2013, and GNU GPL'd, by Julian Seward et al. 
==27764== Using Valgrind-3.10.1 and LibVEX; rerun with -h for copyright info 
==27764== Command: ./test 
==27764== 
Starting tests... 
ALL TESTS PASSED 
Tests run: 1 
==27764== 
==27764== HEAP SUMMARY: 
==27764==  in use at exit: 0 bytes in 0 blocks 
==27764== total heap usage: 0 allocs, 0 frees, 0 bytes allocated 
==27764== 
==27764== All heap blocks were freed -- no leaks are possible 
==27764== 
==27764== For counts of detected and suppressed errors, rerun with: -v 
==27764== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0) 

2016-05-12T07:51:35Z [email protected]:~/vr2200-platform/pmu (master) 
$ echo $? 
0 

原因は1.

を返さも "テスト" と呼ばれるパス上で実行可能でした
関連する問題