Skip to content

Instantly share code, notes, and snippets.

@hackallcode
Last active November 27, 2017 18:25
Show Gist options
  • Save hackallcode/756a994c3551a01ce4925e58b0ce546a to your computer and use it in GitHub Desktop.
Save hackallcode/756a994c3551a01ce4925e58b0ce546a to your computer and use it in GitHub Desktop.
lab11

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=hackallcode
$ alias edit=nano
$ alias gsed=sed
$ 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
$ 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
$ rm -f .travis.yml
$ cat >> .travis.yml <<EOF
language: cpp
script: 
- cmake -H. -B_build -DCMAKE_INSTALL_PREFIX=_install
- cmake --build _build --target install
- rm -f -R artifacts
- 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