Boost logo

Boost Testing :

From: Voronkov Konstantin (beowinkle_at_[hidden])
Date: 2005-07-28 03:52:46


Beman, thanks for you advice,
I downloaded and build latest Boost Regression Tests tools,
  but have problem. I developed 2 tests which run under control
of Boost Regression Tests: first test should pass and second
should fail.

With latest build (boost_1_32_0) tests works as expected,
  but with latest CVS tools version both two tests fail.

Can you help me to detect what is wrong, please?

As I can see from the bjam output the test passed,
  but it still has Fail state in compiler status table.

*****************testPassSample.cpp
#include <boost/utility.hpp>
#include <boost/test/minimal.hpp>
#include <string>

int test_main( int, char*[] )
{
   std::cout << "testPassSample" << std::endl;
   BOOST_TEST( true );
   return boost::exit_success;
}

*****************testFailSample.cpp
#include <boost/utility.hpp>
#include <boost/test/minimal.hpp>
#include <string>

int test_main( int, char*[] )
{
   std::cout << "testFailSample" << std::endl;
   BOOST_TEST( false );
   return 1;
}

*****************Jamfile
subproject myTest/test ;

# bring in rules for testing
import testing ;
# Make tests run by default.
DEPENDS all : myTest ;
{
     # look in BOOST_ROOT for sources first, just in this Jamfile
     local SEARCH_SOURCE = $(BOOST_ROOT) $(SEARCH_SOURCE) ;

    test-suite "myTest"
        : [ run testFailSample.cpp ]
          [ run testPassSample.cpp ]
        ;
}

*****************I invoke bjam in this way
>set BOOST_ROOT=S:\RegressionTests\boost_1_32_0
>set TOOLS=vc7
>call vcvars32.bat > nul
>cd boost_1_32_0\myTest\test\
>bjam clean>..\..\..\runMyTest.log 2>&1
>bjam >>..\..\..\runMyTest.log 2>&1
>process_jam_log.exe <..\..\..\runMyTest.log
>compiler_status.exe %BOOST_ROOT% cs-win32.html cs-win32-links.html

*****************This is cs-win32.html
Compiler Status:
Run Date: 08:45:50 UTC, Thursday 28 July 2005
Library Test Name Test Type Microsoft VC++
                  testFailSample Fail
                  testPassSample Fail

*****************This is cs-win32-links.html
Compiler Status:
Run Date: 08:45:50 UTC, Thursday 28 July 2005

- testPassSample - vc7
Linker output:

LINK : LNK6004:
..\..\bin\boost\myTest\test\testPassSample.test\vc7\debug\threading-multi\testPassSample.exe
not found or not built by the last incremental link; performing full link

Run output:

testPassSample

**** no errors detected

EXIT STATUS: 0

- testFailSample - vc7
Linker output:

LINK : LNK6004:
..\..\bin\boost\myTest\test\testFailSample.test\vc7\debug\threading-multi\testFailSample.exe
not found or not built by the last incremental link; performing full link

Run output:

testFailSample
..\..\myTest\test\testFailSample.cpp(8): test false failed in function:
'int __cdecl test_main(int,char *[])'
S:\QA\Technical\UnitTesting\Frameworks\Evaluation\RegressionTests\boost_1_32_0\boost/test/minimal.hpp(123):
test run_result == 0 || run_result == boost::exit_success failed in
function: 'int __cdecl main(int,char *[])'

**** 2 errors detected

EXIT STATUS: 201

*****************Here is bjam output
...found 1 target...
...updating 1 target...
Clean clean
...updated 1 target...
...found 267 targets...
...updating 10 targets...
vc-C++
..\..\bin\boost\myTest\test\testPassSample.test\vc7\debug\threading-multi\testPassSample.obj
testPassSample.cpp
vc-Link
..\..\bin\boost\myTest\test\testPassSample.test\vc7\debug\threading-multi\testPassSample.exe
LINK : LNK6004:
..\..\bin\boost\myTest\test\testPassSample.test\vc7\debug\threading-multi\testPassSample.exe
not found or not built by the last incremental link; performing full link
vc-C++
..\..\bin\boost\myTest\test\testFailSample.test\vc7\debug\threading-multi\testFailSample.obj
testFailSample.cpp
vc-Link
..\..\bin\boost\myTest\test\testFailSample.test\vc7\debug\threading-multi\testFailSample.exe
LINK : LNK6004:
..\..\bin\boost\myTest\test\testFailSample.test\vc7\debug\threading-multi\testFailSample.exe
not found or not built by the last incremental link; performing full link
execute-test
..\..\bin\boost\myTest\test\testFailSample.test\vc7\debug\threading-multi\testFailSample.run
====== BEGIN OUTPUT ======
testFailSample
..\..\myTest\test\testFailSample.cpp(8): test false failed in function:
'int __cdecl test_main(int,char *[])'
S:\QA\Technical\UnitTesting\Frameworks\Evaluation\RegressionTests\boost_1_32_0\boost/test/minimal.hpp(123):
test run_result == 0 || run_result == boost::exit_success failed in
function: 'int __cdecl main(int,char *[])'

**** 2 errors detected

EXIT STATUS: 201
====== END OUTPUT ======

 
..\..\bin\boost\myTest\test\testFailSample.test\vc7\debug\threading-multi\testFailSample.exe
>
..\..\bin\boost\myTest\test\testFailSample.test\vc7\debug\threading-multi\testFailSample.output
  2>&1
     set status=%ERRORLEVEL%
     echo. >>
..\..\bin\boost\myTest\test\testFailSample.test\vc7\debug\threading-multi\testFailSample.output

     echo EXIT STATUS: %status% >>
..\..\bin\boost\myTest\test\testFailSample.test\vc7\debug\threading-multi\testFailSample.output

     if %status% EQU 0 (
         copy
..\..\bin\boost\myTest\test\testFailSample.test\vc7\debug\threading-multi\testFailSample.output
 
..\..\bin\boost\myTest\test\testFailSample.test\vc7\debug\threading-multi\testFailSample.run

     )
     set verbose=1
     if %status% NEQ 0 (
         set verbose=0
     )
     if %verbose% EQU 0 (
         echo ====== BEGIN OUTPUT ======
         type
..\..\bin\boost\myTest\test\testFailSample.test\vc7\debug\threading-multi\testFailSample.output

         echo ====== END OUTPUT ======
     )
     exit %status%

...failed execute-test
..\..\bin\boost\myTest\test\testFailSample.test\vc7\debug\threading-multi\testFailSample.run...
execute-test
..\..\bin\boost\myTest\test\testPassSample.test\vc7\debug\threading-multi\testPassSample.run
         1 file(s) copied.
**passed**
..\..\bin\boost\myTest\test\testPassSample.test\vc7\debug\threading-multi\testPassSample.test
...failed updating 1 target...
...skipped 1 target...
...updated 8 targets...

Best Regards,
Konstantin

Beman Dawes wrote:
> "Voronkov Konstantin" <beowinkle_at_[hidden]> wrote in message
> news:dbnrt0$sck$1_at_sea.gmane.org...
>
>>Hello, All!
>>
>>I have a question about "--no-warn" option of compiler status
>>
>>I run next script in boost_1_32_0\libs\filesystem\test folder:
>>
>>>set BOOST_ROOT=H:\tmp\Boost\ToBuild\boost_1_32_0
>>>set TOOLS=vc7
>>>call C:\Echo\MicrosoftVisualStudio\7.1\Vc7\bin\vcvars32.bat > nul
>>>bjam clean>clean.log
>>>bjam >bjam.log 2>&1
>>>process_jam_log <bjam.log
>>>compiler_status %BOOST_ROOT% cs-win32.html
>>>compiler_status --ignore-pass --no-warn %BOOST_ROOT%
>>
>>cs-win32-fail.html cs-win32-links.html
>>
>>>compiler_status --ignore-pass %BOOST_ROOT% cs-win32-warn-or-fail.html
>>
>>cs-win32-links.html
>>
>>>compiler_status %BOOST_ROOT% cs-win32-full.html cs-win32-links.html
>>
>>but the result of both 3 invokation of compiler_status produced
>> the same output which contains full report (with pass and fail
>>tests). All output files cs-win32-fail.html, cs-win32-full.html,
>>and cs-win32-warn-or-fail.html are equivalent.
>>
>>What did I done wrong and how can I get only errors result?
>
>
> Have you built compiler_status from a recent CVS? I fixed at least two
> problems about a month ago.
>
> --Beman


Boost-testing list run by mbergal at meta-comm.com