Skip to content

Commit

Permalink
Merge pull request #19 from SEAME-pt/jmoreira01
Browse files Browse the repository at this point in the history
  • Loading branch information
zeira42 authored Nov 18, 2024
2 parents ad6958c + dbfd1be commit 6ab72f3
Show file tree
Hide file tree
Showing 44 changed files with 1,163 additions and 129 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: C++ CI with GoogleTest
name: m00ex02

on:
push:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
name: C++ Compilation Check
# Missing tests (check JOURNAL.md)
name: m00ex03

on:
push:
Expand All @@ -23,8 +24,8 @@ jobs:
# Compile the code
- name: Compile
run: |
cd Modules/Module00/ex03
mkdir build
cd build
cmake ..
make
cd Modules/Module00/ex03
mkdir build
cd build
cmake ..
make
31 changes: 31 additions & 0 deletions .github/workflows/m01ex00_test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: m01ex00

on:
push:
branches:
- jmoreira01
pull_request:
branches:
- main

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y cmake g++ make
- name: Build and run tests
run: |
cd Modules/Module01/ex00
mkdir build
cd build
cmake ..
make
ctest --output-on-failure
31 changes: 31 additions & 0 deletions .github/workflows/m01ex01_test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: m01ex01

on:
push:
branches:
- jmoreira01
pull_request:
branches:
- main

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y cmake g++ make
- name: Build and run tests
run: |
cd Modules/Module01/ex01
mkdir build
cd build
cmake ..
make
ctest --output-on-failure
31 changes: 31 additions & 0 deletions .github/workflows/m01ex02_test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: m01ex02

on:
push:
branches:
- jmoreira01
pull_request:
branches:
- main

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y cmake g++ make
- name: Build and run tests
run: |
cd Modules/Module01/ex02
mkdir build
cd build
cmake ..
make
ctest --output-on-failure
2 changes: 1 addition & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,4 +48,4 @@
"streambuf": "cpp",
"typeinfo": "cpp"
}
}
}
Binary file added Members_info/jmoreira.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 12 additions & 0 deletions Members_info/jmoreira.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# José Moreira (jmoreira)
## Profile Pic: ![José Moreira](jmoreira.jpeg "jmoreira")
## Call me by this name: Zé
## Cohort: Nov 2024
## Email ID: jose.moreira@seame.pt
## LinkedIn: [José Moreira](https://linkedin.com/in/zemiguelmoreira)
## Slack ID: jmoreira
## GitHub ID: [zeira42](https://github.com/zeira42)
## About me:
- Whether it's code or boulders, I’m all about cracking tough problems.
## Project Links:
- [warm-up](https://github.com/SEAME-pt/Team06-SEAME-warm-up)
15 changes: 0 additions & 15 deletions Modules/Module00/JOURNAL.md

This file was deleted.

36 changes: 36 additions & 0 deletions Modules/Module00/JOURNAL00.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# JOURNAL (jmoreira)
## Module00
- Learning .md and installing Markdown extension
- Learning about qt and installing it
- Learning how to make proper tests
### GitHub
- Research about mono repos and git submodules
- Setting up github projects and team
- Learning how to manage git pull request and git branch rules
- Experimenting with GitHub Actions
- Linked Project Issues with pull request to be close on approval
- Research GitHub Labeling good practices
- Link Action to Issue
### ex02
- Github action with GTest
- Using CMake for the first time
- Remembering basic C++ like syntax and use of references, lvalues, rvalues
### ex03
- Remembering C++ classes
- Github action for compile check
- Replacing \n with std::endl, avoiding buffer not to flush. std::flush after \n is also an option
- Creating try and catch blocks to do a better job error handling and also makes life easier when using GTest
### Thoughts
- Realizing one advantage of submodules: since filesystem changed in main branch, I will have to take extra steps to ensure the GitHub Action I setup will function
- There might be a need for new GitHub Label for Issues that are tasks and research
- Need to free myself from old 42 rules like using C++98 only
### Todo
- Module01
- Gherkin and Cucumber research and implementation
- Working with Qt
### Difficulties
- When I started coding ex03 I did not manage exceptions the right way and the way the methods are built (very dependent on user input), isn't the best for testing, but still possible with mock user inputs. Think about testing before coding will be a priority from now on.
- Tried creating a friend class for testing in ex03 but still couldn't access private stuff. Will move on to m01 without implementing the test because of the time I've already spent on this. Might be CMake issue with linking or compiler issue...



8 changes: 7 additions & 1 deletion Modules/Module00/ex03/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
cmake_minimum_required(VERSION 3.10)

# Project name and version
project(convert VERSION 1.0)
project(phonebook VERSION 1.0)

# Specify the C++ standard
set(CMAKE_CXX_STANDARD 11)
Expand All @@ -15,3 +15,9 @@ file(GLOB SOURCES ${PROJECT_SOURCE_DIR}/src/*.cpp)

# Add the executable
add_executable(phonebook ${SOURCES})

# # Enable testing
# enable_testing()

# # Include test directory
# add_subdirectory(test)
35 changes: 18 additions & 17 deletions Modules/Module00/ex03/inc/Contact.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,24 +5,25 @@

using std::string;

class Contact {
public:
Contact();
~Contact();
void setName(const string& name);
void setNumber(const string& number);
void setNickname(const string& nickname);
void setBookmarked(bool bookmarked);
string getName() const;
string getNumber() const;
string getNickname() const;
bool getBookmarked() const;
class Contact
{
public:
Contact();
~Contact();
void setName(const string& name);
void setNumber(const string& number);
void setNickname(const string& nickname);
void setBookmarked(bool bookmarked);
string getName() const;
string getNumber() const;
string getNickname() const;
bool getBookmarked() const;

private:
string _name;
string _number;
string _nickname;
bool _bookmarked;
private:
string _name;
string _number;
string _nickname;
bool _bookmarked;
};

#endif
19 changes: 14 additions & 5 deletions Modules/Module00/ex03/inc/Phonebook.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,22 @@

using std::cin;
using std::cout;
using std::endl;
using std::getline;
using std::invalid_argument;
using std::isspace;
using std::out_of_range;
using std::string;
using std::stringstream;
using std::vector;
using std::cerr;
using std::flush;

// class PhonebookTest;

class Phonebook
{
// friend class PhonebookTest;
public:
Phonebook();
~Phonebook();
Expand All @@ -34,12 +42,13 @@ class Phonebook
void removeContactByIndex();
bool hasContacts() const;
void showContact(int &contactIndex);

};

const string add_prompt(const string& s);
const string ft_trim_ws(string s);
bool ft_isspace(const string& s);
void pause();
void clearScreen(const string& header = "");
const string add_prompt(const string& s);
const string ft_trim_ws(string s);
bool ft_isspace(const string& s);
void screenPause();
void clearScreen(const string& header = "");

#endif
Loading

0 comments on commit 6ab72f3

Please sign in to comment.