Use the makefile to compile the c++ file and run the test with googleTest.
Follow the steps to complete settings. You need to setup the compile environment on your PC to run the project with test, and add webhook for your repository that can trigger CI server to do the building and running automated test.
This project is only used to create the environment, you should clean it when HW1.
-
Fri Sep 15 2017 21:26:13
HW1 already upload, deadline is on 9/21 23:59. Any question about homework or some suggestions, just email to us.
-
Fri Sep 15 2017 13:45:26
And for CI job building, we recommend you do not put the build files (*.o, executable file) into github. You can use .gitignore to avoid it.
-
Fri Sep 15 2017 11:22:16
When your try to download googleTest on googleTest github page, you should download the release. Do not use respository url.
-
Notice that Mac's googleTest installation guide, the command should be amended.
Original: sudo cp -r gtest-1.7.0/include /usr/local/Cellar/gtest/ Modified: sudo cp -r gtest-1.7.0/include/ /usr/local/Cellar/
cd <your/project/path>
make
./exp
After run the exp file, you should get the result like that:
You already have an account on the CI server. Username and password is your student id, so your need to reset password first.
Name your repository whatever you want, and place this project's file to your own repository(exclude .git folder).
On repository page -> Settings -> Webhooks -> Add webhook -> set Payload URL :
http://140.124.181.114:8080/buildByToken/build?job=<studentId>&token=<studentId>
Good example:
http://140.124.181.114:8080/buildByToken/build?job=1055980XX&token=1055980XX
Bad example:
http://140.124.181.114:8080/buildByToken/build?job=<1055980XX>&token=<1055980XX>
And it should show the green tick.
Email to [email protected]. Just need subject, no content required.
Subject: <studentId>, <repositoryURL>
Wait TA for setting, your CI job will be triggered to run test after every push.
If you want to test your CI job is setup or not: init your repository and place this project's file, commit and push a simple change, and go to CI server to check the job result.
And if you have some problems that you really don't know why and how to solve it, email us: [email protected] or come to 1321 in office hours (Fri. 2pm to 4pm).
-
Thu Sep 14 2017 14:56:35
Modify makefile.
Notice that Mac's googleTest installation guide, the command should be amended.
Original: sudo cp -r gtest-1.7.0/include /usr/local/Cellar/gtest/ Modified: sudo cp -r gtest-1.7.0/include/ /usr/local/Cellar/
-
Wed Sep 13 2017 14:12:35
About <studentId>, you should replace whole brackets not just "studentId". That is ok on email subject , but you should be careful the webhook.
Good: http://140.124.181.114:8080/buildByToken/build?job=1055980XX&token=1055980XX Bad: http://140.124.181.114:8080/buildByToken/build?job=<1055980XX>&token=<1055980XX>
And about your own repository, if you want to test your CI job is setup or not: init your repository and place this project's file, commit and push a simple change, and go to CI server to check the job result.