Skip to content

Sumedh Reddy Koppula 117386066 week3 and week4 #3

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 15 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
64 changes: 45 additions & 19 deletions .vscode/c_cpp_properties.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,30 +4,56 @@
"name": "Mac",
"includePath": [
"/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1",
"${workspaceRoot}/vendor/gtest/include",
"${workspaceRoot}/vendor/boost",
"/usr/include"
"${workspaceFolder}/include",
"${workspaceFolder}/week3/AcceleratedC++3-5/include",
"${workspaceFolder}/week3/AcceleratedC++3-5/include",
"${workspaceFolder}/week3/SoftwareEngineering3-10/include",
"${workspaceFolder}/week3/AcceleratedC++6-9/include",
"${workspaceFolder}/week3/AcceleratedC++4-7/include",
"${workspaceFolder}/week3/AcceleratedC++4-5/include",
"${workspaceFolder}/softwareEng_9_4/include"
],
"browse": {
"limitSymbolsToIncludedHeaders": true,
"databaseFilename": ""
},
"macFrameworkPath": [
"/System/Library/Frameworks",
"/Library/Frameworks"
],
"browse" : {
"limitSymbolsToIncludedHeaders" : true,
"databaseFilename" : ""
}
"intelliSenseMode": "macos-clang-x64",
"compilerPath": "/opt/homebrew/bin/gcc-11",
"cStandard": "gnu17",
"cppStandard": "gnu++17"
},
{
"name": "Linux",
"includePath": ["/usr/include"],
"browse" : {
"limitSymbolsToIncludedHeaders" : true,
"databaseFilename" : ""
}
"includePath": [
"/usr/include"
],
"browse": {
"limitSymbolsToIncludedHeaders": true,
"databaseFilename": ""
},
"intelliSenseMode": "linux-gcc-x64",
"compilerPath": "/opt/homebrew/bin/gcc-11",
"cStandard": "gnu17",
"cppStandard": "gnu++17"
},
{
"name": "Win32",
"includePath": ["c:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/include"],
"browse" : {
"limitSymbolsToIncludedHeaders" : true,
"databaseFilename" : ""
}
"includePath": [
"c:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/include"
],
"browse": {
"limitSymbolsToIncludedHeaders": true,
"databaseFilename": ""
},
"intelliSenseMode": "windows-msvc-x64",
"compilerPath": "/opt/homebrew/bin/gcc-11",
"cStandard": "gnu17",
"cppStandard": "gnu++17"
}
]
}
],
"version": 4
}
21 changes: 21 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "clang++ - Build and debug active file",
"type": "cppdbg",
"request": "launch",
"program": "${fileDirname}/${fileBasenameNoExtension}",
"args": [],
"stopAtEntry": true,
"cwd": "${workspaceFolder}",
"environment": [],
"externalConsole": false,
"MIMode": "lldb",
"preLaunchTask": "clang++ build active file"
}
]
}
90 changes: 89 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,93 @@
"ms-vscode.cpptools",
"RichardHe.you-complete-me",
"vector-of-bool.cmake-tools"
]
],
"files.associations": {
"__bit_reference": "cpp",
"__config": "cpp",
"__debug": "cpp",
"__errc": "cpp",
"__functional_base": "cpp",
"__hash_table": "cpp",
"__locale": "cpp",
"__mutex_base": "cpp",
"__node_handle": "cpp",
"__nullptr": "cpp",
"__split_buffer": "cpp",
"__string": "cpp",
"__threading_support": "cpp",
"__tree": "cpp",
"__tuple": "cpp",
"algorithm": "cpp",
"array": "cpp",
"atomic": "cpp",
"bit": "cpp",
"bitset": "cpp",
"cctype": "cpp",
"chrono": "cpp",
"clocale": "cpp",
"cmath": "cpp",
"codecvt": "cpp",
"compare": "cpp",
"complex": "cpp",
"concepts": "cpp",
"condition_variable": "cpp",
"cstdarg": "cpp",
"cstddef": "cpp",
"cstdint": "cpp",
"cstdio": "cpp",
"cstdlib": "cpp",
"cstring": "cpp",
"ctime": "cpp",
"cwchar": "cpp",
"cwctype": "cpp",
"deque": "cpp",
"exception": "cpp",
"forward_list": "cpp",
"fstream": "cpp",
"functional": "cpp",
"initializer_list": "cpp",
"iomanip": "cpp",
"ios": "cpp",
"iosfwd": "cpp",
"iostream": "cpp",
"istream": "cpp",
"iterator": "cpp",
"limits": "cpp",
"list": "cpp",
"locale": "cpp",
"map": "cpp",
"memory": "cpp",
"mutex": "cpp",
"new": "cpp",
"numbers": "cpp",
"numeric": "cpp",
"optional": "cpp",
"ostream": "cpp",
"queue": "cpp",
"random": "cpp",
"ratio": "cpp",
"semaphore": "cpp",
"set": "cpp",
"sstream": "cpp",
"stack": "cpp",
"stdexcept": "cpp",
"streambuf": "cpp",
"string": "cpp",
"string_view": "cpp",
"system_error": "cpp",
"thread": "cpp",
"tuple": "cpp",
"type_traits": "cpp",
"typeinfo": "cpp",
"unordered_map": "cpp",
"utility": "cpp",
"vector": "cpp",
"hash_map": "cpp",
"hash_set": "cpp",
"*.tcc": "cpp",
"memory_resource": "cpp",
"stop_token": "cpp",
"cinttypes": "cpp"
}
}
28 changes: 28 additions & 0 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
"version": "2.0.0",
"tasks": [
{
"type": "shell",
"label": "clang++ build active file",
"command": "/usr/bin/clang++",
"args": [
"-std=c++17",
"-stdlib=libc++",
"-g",
"${file}",
"-o",
"${fileDirname}/${fileBasenameNoExtension}"
],
"options": {
"cwd": "${workspaceFolder}"
},
"problemMatcher": ["$gcc"],
"group": {
"kind": "build",
"isDefault": true
}
}
]
}
2 changes: 1 addition & 1 deletion app/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
add_executable(shell-app main.cpp)
add_executable(shell-app 9_5.cpp)
include_directories(
${CMAKE_SOURCE_DIR}/include
)
112 changes: 35 additions & 77 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,98 +2,56 @@
[![Build Status](https://travis-ci.org/dpiet/cpp-boilerplate.svg?branch=master)](https://travis-ci.org/dpiet/cpp-boilerplate)
[![Coverage Status](https://coveralls.io/repos/github/dpiet/cpp-boilerplate/badge.svg?branch=master)](https://coveralls.io/github/dpiet/cpp-boilerplate?branch=master)
---
## Week 4 Assignment

## Overview
Name: Sumedh Reddy Koppula
UID: 117386066

Simple starter C++ project with:
In week4 directory please find individual folder with programming assignment exercise names with UML diagram. On each folder please perform below executions in command-line to get the ouput.
1. mkdir build
2. cd build
3. cmake ..
4. make
5. cd app
6. ./shell-app

- cmake
- googletest
Please find the written_SoftwareEngineering.pdf assignment and output screenshots in the week4 root folder.

## Standard install via command-line
```
git clone --recursive https://github.com/dpiet/cpp-boilerplate
cd <path to repository>
mkdir build
cd build
cmake ..
make
Run tests: ./test/cpp-test
Run program: ./app/shell-app
```
## Sample Outputs for week4

## Building for code coverage (for assignments beginning in Week 4)
```
sudo apt-get install lcov
cmake -D COVERAGE=ON -D CMAKE_BUILD_TYPE=Debug ../
make
make code_coverage
```
This generates a index.html page in the build/coverage sub-directory that can be viewed locally in a web browser.
![week4](https://user-images.githubusercontent.com/24978535/134793190-87df4081-0227-41d6-b385-bf45234f1c9a.png)

## Working with Eclipse IDE ##
## Week 3 Assignment

## Installation
Name: Sumedh Reddy Koppula
UID: 117386066

In your Eclipse workspace directory (or create a new one), checkout the repo (and submodules)
```
mkdir -p ~/workspace
cd ~/workspace
git clone --recursive https://github.com/dpiet/cpp-boilerplate
```
In week3 directory please find individual folders with programming assignment exercise names with UML diagram. On each folder please perform below executions in command-line to get the ouput.
1. mkdir build
2. cd build
3. cmake ..
4. make
5. cd app
6. ./shell-app

In your work directory, use cmake to create an Eclipse project for an [out-of-source build] of cpp-boilerplate
Please find the wrting assignment .pdf and output screenshots in the root folder.

```
cd ~/workspace
mkdir -p boilerplate-eclipse
cd boilerplate-eclipse
cmake -G "Eclipse CDT4 - Unix Makefiles" -D CMAKE_BUILD_TYPE=Debug -D CMAKE_ECLIPSE_VERSION=4.7.0 -D CMAKE_CXX_COMPILER_ARG1=-std=c++14 ../cpp-boilerplate/
```
## Sample Outputs for week3

## Import
**3_5_output:**
<img width="1440" alt="3_5_output" src="https://user-images.githubusercontent.com/24978535/134241123-d9610cf4-2ae0-4322-820f-425c45c30bf8.png">

Open Eclipse, go to File -> Import -> General -> Existing Projects into Workspace ->
Select "boilerplate-eclipse" directory created previously as root directory -> Finish
**3_10_output**
<img width="1440" alt="3_10_output" src="https://user-images.githubusercontent.com/24978535/134241137-175cd18d-fc65-4356-8da8-1db0e48745f6.png">

# Edit
**4_5_output**
<img width="1440" alt="4_5_output" src="https://user-images.githubusercontent.com/24978535/134241148-fc224652-9a5d-4677-ba38-72c8c49edf82.png">

Source files may be edited under the "[Source Directory]" label in the Project Explorer.
**4_7_output**
<img width="1440" alt="4_7_output" src="https://user-images.githubusercontent.com/24978535/134241159-7d6bbba5-0372-4a08-9d61-3b99a946ac17.png">


## Build

To build the project, in Eclipse, unfold boilerplate-eclipse project in Project Explorer,
unfold Build Targets, double click on "all" to build all projects.

## Run

1. In Eclipse, right click on the boilerplate-eclipse in Project Explorer,
select Run As -> Local C/C++ Application

2. Choose the binaries to run (e.g. shell-app, cpp-test for unit testing)


## Debug


1. Set breakpoint in source file (i.e. double click in the left margin on the line you want
the program to break).

2. In Eclipse, right click on the boilerplate-eclipse in Project Explorer, select Debug As ->
Local C/C++ Application, choose the binaries to run (e.g. shell-app).

3. If prompt to "Confirm Perspective Switch", select yes.

4. Program will break at the breakpoint you set.

5. Press Step Into (F5), Step Over (F6), Step Return (F7) to step/debug your program.

6. Right click on the variable in editor to add watch expression to watch the variable in
debugger window.

7. Press Terminate icon to terminate debugging and press C/C++ icon to switch back to C/C++
perspetive view (or Windows->Perspective->Open Perspective->C/C++).
**6_9_output**
<img width="1440" alt="6_9_output" src="https://user-images.githubusercontent.com/24978535/134241172-0b6f06dd-5258-424f-a2dc-46b1d90b581b.png">


## Plugins
Expand Down
29 changes: 29 additions & 0 deletions week3/AcceleratedC++3-5/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
cmake_minimum_required(VERSION 3.2.1)
project (scratch)

# Add project cmake modules to path.
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${PROJECT_SOURCE_DIR}/cmake)

# We probably don't want this to run on every build.
option(COVERAGE "Generate Coverage Data" OFF)

if (COVERAGE)
include(CodeCoverage)
set(LCOV_REMOVE_EXTRA "'vendor/*'")
setup_target_for_coverage(code_coverage test/cpp-test coverage)
set(COVERAGE_SRCS app/main.cpp include/lib.hpp)

SET(CMAKE_CXX_FLAGS "-g -O0 -fprofile-arcs -ftest-coverage")
SET(CMAKE_C_FLAGS "-g -O0 -fprofile-arcs -ftest-coverage")
SET(CMAKE_EXE_LINKER_FLAGS "-fprofile-arcs -ftest-coverage")
else()
set(CMAKE_CXX_FLAGS "-Wall -Wextra -Wpedantic -g")
endif()

include(CMakeToolsHelpers OPTIONAL)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
set(CMAKE_CXX_STANDARD 14)

add_subdirectory(app)
add_subdirectory(test)
add_subdirectory(vendor/googletest/googletest)
Binary file added week3/AcceleratedC++3-5/UML/3_5_UML.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading