Today, we have a closer look at. travis.yml Files and Makefile:
1. Added a statement in the. travis.yml file to the Linux system with the Cppunit library installed, allowing the code to continuously integrate the written unit tests. The main statements are as follows:
Before_install:
- sudo apt-get install-y libcppunit-dev
The 2.makefile file is as follows (Code main reference: Https://github.com/RTCSD15/test1/blob/master/Makefile)
1PROJ = test- Point2SRCs =Point.cpp test_point.cpp testmain.cpp3HDRs =Point.h test_point.h4 5CC =GCC6OBJS = $ (srcs:.cpp=. O)7APP =EST $ (PROJ)8CFLAGS =-c-g-wall-i/opt/local/include9Ldflags =-l/opt/local/LibTenLIBS =-lcppunit-LDL One A All : $ (APP) - - $ (APP): $ (OBJS) the$ (CC) $ (ldflags) $ (OBJS)-o $ (APP) $ (LIBS) - -%.O:%. cpp $ (HDRs) -$ (CC) $ (CFLAGS) $<-o [email protected] + - Clean : +Rm-f *.O $ (APP)
Of course, the meaning of the above statement is generally understood, but the result of the operation is still problematic:
Error display: Test_point.h file cannot find the Point.h file, but from the above makefile statement, the syntax should be no error, should already contain the Point.h file, took a long time and did not find.
Summing up: Today, mainly spent a lot of time to understand the meaning of the makefile statement, the basic can understand the meaning of makefile, but also spent a lot of time to find errors, although the middle also found a lot of mistakes, but still have errors did not find out, feel the words: Should say, take some time should be able to achieve continuous integration. Of course, a person's strength is limited, if you have seniors help, progress should be faster. A simple mistake, I found that it may take half an hour, others found may be one eye, but also realize the "do high School" of the fun, encountered the wrong to find the reason, until the problem is also very good.
Further use of the TRAVIS-CI