Author Topic: Let CCTest project parse many test files  (Read 4944 times)

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5242
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Let CCTest project parse many test files
« on: September 28, 2014, 05:12:05 pm »
I add some test files under trunk\src\plugins\codecompletion\testing\ in rev9921 to rev9924, all the files were prefix with cc_.
I have some code changes for CCTest, so that:
1, it can enumerate all the cc_xxxx.cpp files in that folder, parse and test those files one by one.
2, I have removed all the priority header file settings, since we don't use them.
3, I think for parsing the files, we don't need to load file to editor control, and save to a temp file, we can directly one the file and parse it.

Patch is not ready for public testing, because it still need some clean up, also I need to sleep now.  ;D
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: 5242
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: Let CCTest project parse many test files
« Reply #1 on: September 29, 2014, 09:05:35 am »
Git style diff file added.


[attachment deleted by admin]
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: 5242
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: Let CCTest project parse many test files
« Reply #2 on: September 30, 2014, 04:54:33 pm »
Here is the testing result with Huki's latest patch to handle function ptr.
Quote
********************************************************
  Testing in file: F:\cb_sf_git\trunk\src\plugins\codecompletion\testing\cc_function_decls.cpp
********************************************************
*FAIL:  vt[1].  GetInt
-PASS:  g_S.  i
-PASS:  g_  g_S
-PASS:  tc.Vo  Void
-PASS:  tc.St  StaticVoid
-PASS:  tc.GetC  GetClass
-PASS:  tc.GetI  GetInt
*FAIL:  str.  size
*FAIL:  str.  length
--------------------------------------------------------
Total 9 tests, 6 PASS, 3 FAIL
--------------------------------------------------------
********************************************************
  Testing in file: F:\cb_sf_git\trunk\src\plugins\codecompletion\testing\cc_function_ptr.cpp
********************************************************
-PASS: foo  foo
--------------------------------------------------------
Total 1 tests, 1 PASS, 0 FAIL
--------------------------------------------------------
********************************************************
  Testing in file: F:\cb_sf_git\trunk\src\plugins\codecompletion\testing\cc_function_ptr_com_interface.cpp
********************************************************
-PASS: factory->  QueryInterface
-PASS: factory->  QueryInterface
-PASS: factory->  AddRef
-PASS: factory->  AddRef
-PASS: factory->  Release
-PASS: factory->  Release
-PASS: factory->  CreateInstance
-PASS: factory->  LockServer
-PASS: unknwown->  QueryInterface
-PASS: unknwown->  AddRef
-PASS: unknwown->  Release
--------------------------------------------------------
Total 11 tests, 11 PASS, 0 FAIL
--------------------------------------------------------
********************************************************
  Testing in file: F:\cb_sf_git\trunk\src\plugins\codecompletion\testing\cc_unnamed_class.cpp
********************************************************
-PASS: ClassA::  a
-PASS: ClassA::  s
-PASS: ClassA::  u
-PASS: ClassA::  v
-PASS: ClassA::  STRUCT_A
-PASS: ClassA::  STRUCT_B
-PASS: ClassA::  UNNAMED_A
-PASS: ClassA::  UNNAMED_B
-PASS: ClassA::  ENUM_A
-PASS: ClassA::  ENUM_B
--------------------------------------------------------
Total 10 tests, 10 PASS, 0 FAIL
--------------------------------------------------------
********************************************************
  Testing in file: F:\cb_sf_git\trunk\src\plugins\codecompletion\testing\cc_x_macro.cpp
********************************************************
-PASS:  val  value1
-PASS:  val  value2
-PASS:  val  value3
--------------------------------------------------------
Total 3 tests, 3 PASS, 0 FAIL
--------------------------------------------------------

So nice!

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: 5242
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: Let CCTest project parse many test files
« Reply #3 on: October 13, 2014, 09:23:10 am »
Hi, this serial of patches were in trunk now. I have created several patches one by one by Git, and all the revisions should build and work OK. (with codecompletion.cbp)
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.