Author Topic: Trying to get cctest to work  (Read 8674 times)

Offline jat1

  • Single posting newcomer
  • *
  • Posts: 5
Trying to get cctest to work
« on: July 08, 2015, 09:03:23 pm »
Hi,

I created a patch (attached) to solve the first two test cases listed in this ticket: http://sourceforge.net/p/codeblocks/tickets/158/. I wrote some test cases (also attached), which work when I test manually, but don't work in cctest.

These are the steps I take:
1) apply the patch
2) compile CC and run update.bat
3) run cctest in \codeblocks\src\output\
4) open the test file and run a single test

Only the first test case passes (the AAA typedef). The rest fail.

Am I missing a step somewhere?

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5910
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: Trying to get cctest to work
« Reply #1 on: July 09, 2015, 01:09:31 am »
Hi, thanks for the contribution.
Apply the patch, and rename your test file to "ccc_type_alias.cpp", then run cc_test, I get such result:

Code
********************************************************
  Testing in file: F:\cb_sf_git\trunk\src\plugins\codecompletion\testing\ccc_type_alias.cpp
********************************************************
-PASS: DDD.  m_bbb
-PASS: CCC::cs.  m_bbb
-PASS: BBB.  m_aaa
-PASS: AAA.  m_aaa
--------------------------------------------------------
Total 4 tests, 4 PASS, 0 FAIL
--------------------------------------------------------

In the mean while, the content of the ccc_type_alias.cpp is loaded to the control (or you can open that file from Menu->file->open)
Run "Test single" just run the test code in the editor control, I get such result:
Code
********************************************************
  Testing file in edit control
********************************************************
-PASS: DDD.  m_bbb
-PASS: CCC::cs.  m_bbb
-PASS: BBB.  m_aaa
-PASS: AAA.  m_aaa
--------------------------------------------------------
Total 4 tests, 4 PASS, 0 FAIL
--------------------------------------------------------

Note, ccc_*.cpp(only one ccc_*.cpp is parsed, so you only need one ccc_*.cpp in the folder) has much precedence than cc_*.cpp. The logic here is that this can used to test a single test file, because testing all the cc_*.cpp takes a lot of time, especially we have TRACE enabled when building cctest.

Hope the above helps. Thanks.
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5910
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: Trying to get cctest to work
« Reply #2 on: July 10, 2015, 04:33:56 pm »
Hi, jat1, the patch and the test case were in trunk now, thank you very much!
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

Offline jat1

  • Single posting newcomer
  • *
  • Posts: 5
Re: Trying to get cctest to work
« Reply #3 on: July 11, 2015, 09:05:26 am »
Ok, thanks for the info. I wanted to make sure cctest wasn't failing because I was running it incorrectly. After reading your post, it looks as though I was doing it right. So I decided to just reinstall C::B and all the tests pass now. Thanks again.

Edit: I believe this error occurred because I originally copied wxmsw28u_gcc_custom.dll to codeblocks\src\output instead of \codeblocks\src\devel. Fixed it during the reinstall.
« Last Edit: July 11, 2015, 09:24:02 am by jat1 »