![]() |
FOSSology Advancing open source analysis and development |
This shows you the differences between the selected revision and the current version of the page.
| unit_testing_with_cunit 2010/07/29 04:52 | unit_testing_with_cunit 2010/08/01 20:23 current | ||
|---|---|---|---|
| Line 6: | Line 6: | ||
| * Description in brief {{:investigation_about_cunit_coverage.ppt}} | * Description in brief {{:investigation_about_cunit_coverage.ppt}} | ||
| - | * Usage{{:cunit_coverage_manual.doc|}} | + | * [[Usage]] |
| * Demo{{:mypro.zip|}} | * Demo{{:mypro.zip|}} | ||
| Line 13: | Line 12: | ||
| ===Make file orgnization=== | ===Make file orgnization=== | ||
| + | |||
| + | >mark: Larry, why are you talking about automake? I know it's used a lot, but FOSSology doesn't use it. I would just leave this part out. | ||
| + | >>larry: 1) The Beijing team suggest that I investigate the normal process for C open source development, we want to know if the automake suits FOSSology , so list it here. 2) I know that FOSSology doesn't use it now. | ||
| * The steps of automake | * The steps of automake | ||
| - configure the project, generate the makefile files | - configure the project, generate the makefile files | ||
| Line 38: | Line 40: | ||
| * Add one target named **test_xxx** for testcases to build the testcases | * Add one target named **test_xxx** for testcases to build the testcases | ||
| * Run the build result **test_xxx** from ./module_name/tests/<test cases, etc>, when **make test** | * Run the build result **test_xxx** from ./module_name/tests/<test cases, etc>, when **make test** | ||
| + | |||
| + | >mark: The executable names need to conform to the cunit convention so that they are easily runnable. Larry, in the above you are thinking that the make test target will invoke cunit to run the tests? | ||
| + | >>larry: 1) Thank you, there the executable names is only proposal, your means is that there is cunit convention? I am sorry, I do not know it, can you say more concretely? also I will investigate it after, thanks. 2) yes, make test target will invoke cunit to run the tests. | ||
| + | |||
| + | >mark: I don't think we will redesign our makefiles. Do you think they need redesign to use cunit? | ||
| + | >>larry: Maybe there is misunderstanding, I do not think we will redesign our makefiles. 1) My means is that: if we use automake, we will redesign makefiles, if not, we do not need redesign our makefiles. 2) Also, after I investigate automake and our makefiles, I think it is unnecessary to use automake. | ||
| + | >mark: I would suggest the following, there is a top level makefile under the tests directory. It defines things common to all tests and invokes the lower level makefiles to build the unit tests. Is that what you are trying to say? | ||
| + | >>larry: thank you, your means is that: | ||
| + | |||
| + | >mark: There should be separate targets for running the tests and collecting coverage information. You may not want to run coverage every time you run the tests. Plus there is execution overhead when collecting coverage information and that overhead should not be paid every time the tests are run. Also, to perform the coverage of an agent, the agent must be complied with coverage and run/tested in a particular way, which may be different than a standard cunit test run. The tests should get run a lot, but coverage could be done on a daily, semi-weekly, or some other time frame that the team decides on. | ||
| test: ./tests/test_xxx | test: ./tests/test_xxx | ||
| Line 49: | Line 61: | ||
| === Framework organization === | === Framework organization === | ||
| + | |||
| + | >mark: Larry, I don't understand what you are trying to explain below. If you are trying to describe how both the unit and functional tests will be run, it might be launched by a make file, but all the makefile will do is run some script. PHP is not a complied language so there is nothing to make like in C. Additionally, cunit will not run php tests, both Simpletest and PHPUnit may be used to test php/web code. I will be designing and proposing how all tests will get run and reported. If you have some ideas on how to accomplish this, they would be great to hear. | ||
| ==./fossology/Makefile== | ==./fossology/Makefile== | ||
| <code> | <code> | ||
| Line 64: | Line 78: | ||
| </code> | </code> | ||
| - | * **make test**, test all test cases in sub directories | + | * **make test**, test all test cases in sub directories. The makefile for specified module please see |
| + | Makefile test format for specified module proposal above | ||
| <code> | <code> | ||
| test: all $(TESTDIRS) | test: all $(TESTDIRS) | ||