Skip to content

Instantly share code, notes, and snippets.

@rusdevops
Last active January 8, 2018 09:26
Show Gist options
  • Save rusdevops/3907bf60279f10810994647b6f550176 to your computer and use it in GitHub Desktop.
Save rusdevops/3907bf60279f10810994647b6f550176 to your computer and use it in GitHub Desktop.

Laboratory work XI

Данная лабораторная работа посвещена изучению компонентов Boost на примере program_options

$ open http://www.boost.org/doc/libs/1_65_0/doc/html/program_options.html

Tasks

  • 1. Создать публичный репозиторий с названием lab11 на сервисе GitHub
  • 2. Выполнить инструкцию учебного материала
  • 3. Ознакомиться со ссылками учебного материала
  • 4. Составить отчет и отправить ссылку личным сообщением в Slack

Tutorial

$ export GITHUB_USERNAME=<имя_пользователя>
$ alias edit=<nano|vi|vim|subl>
$ alias gsed=sed # for *-nix system
$ cd ${GITHUB_USERNAME}/workspace
$ pushd .
$ source scripts/activate
$ git clone https://github.com/${GITHUB_USERNAME}/lab10 projects/lab11
$ cd projects/lab11
$ git remote remove origin
$ git remote add origin https://github.com/${GITHUB_USERNAME}/lab11
# boost::program_options
$ edit CMakeLists.txt
$ edit sources/demo.cpp
$ cmake -H. -B_build -DCMAKE_INSTALL_PREFIX=_install
$ cmake --build _build --target install
$ mkdir artifacts && cd artifacts
$ echo "text1 text2 text3" | ../_install/bin/demo
$ test -f default.log 
$ echo $?
0
$ mkdir ${HOME}/.config
$ echo "output=config.log" > ${HOME}/.config/demo.cfg
$ echo "text1 text2 text3" | ../_install/bin/demo
$ test -f config.log 
$ echo $?
0
$ export DEMO_OUTPUT=env.log
$ echo "text1 text2 text3" | ../_install/bin/demo
$ test -f env.log 
$ echo $?
0
$ echo "text1 text2 text3" | ../_install/bin/demo --output arg.log
$ test -f arg.log 
$ echo $?
0
$ cat >> .travis.yml <<EOF
- cmake -H. -B_build -DCMAKE_INSTALL_PREFIX=_install
- cmake --build _build --target install
- mkdir artifacts && cd artifacts
- echo "text1 text2 text3" | ../_install/bin/demo
- test -f default.log 
- mkdir -p ${HOME}/.config
- echo "output=config.log" > \${HOME}/.config/demo.cfg
- echo "text1 text2 text3" | ../_install/bin/demo
- test -f config.log 
- export DEMO_OUTPUT=env.log
- echo "text1 text2 text3" | ../_install/bin/demo
- test -f env.log 
- echo "text1 text2 text3" | ../_install/bin/demo --output arg.log
- test -f arg.log 
EOF
$ gsed -i 's/lab10/lab11/g' README.md
$ git add .
$ git commit -m"changed format output"
$ git push origin master
$ travis login --auto
$ travis enable

Report

$ popd
$ export LAB_NUMBER=11
$ git clone https://github.com/tp-labs/lab${LAB_NUMBER} tasks/lab${LAB_NUMBER}
$ mkdir reports/lab${LAB_NUMBER}
$ cp tasks/lab${LAB_NUMBER}/README.md reports/lab${LAB_NUMBER}/REPORT.md
$ cd reports/lab${LAB_NUMBER}
$ edit REPORT.md
$ gistup -m "lab${LAB_NUMBER}"

Links

Copyright (c) 2017 Братья Вершинины
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment