-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
333 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
.PHONY: clean | ||
clean: | ||
rm -rf ./build | ||
|
||
.PHONY: test | ||
test: clean | ||
mkdir -pv ./build | ||
|
||
@printf "\n" | ||
@# each line is executed in a subshell, we have to daisy chain them so they | ||
@# run in the build directory | ||
cd ./build; export LDFLAGS="-lgcov --coverage" CXXFLAGS="--coverage"; cmake -DEXERCISM_RUN_ALL_TESTS=1 -DCMAKE_EXPORT_COMPILE_COMMANDS=1 -G 'Unix Makefiles' ../; if make; then printf "\n=== All Tests Passed ===\n"; else printf "\n=== Test Failure ===\n"; false; fi | ||
|
||
.PHONY: coverage | ||
coverage: test | ||
@printf "\n" | ||
find . -regextype posix-egrep -regex "^.*(tests-main|CompilerId).*[.](gcda|gcno)$$" -print -delete | ||
|
||
@printf "\n" | ||
find . -regextype posix-egrep -regex "^.*[.](gcda|gcno)22390" | ||
|
||
@printf "\n" | ||
gcovr --print-summary |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
[ | ||
{ | ||
"directory": "/home/vpayno/git_vpayno/exercism-workspace/cpp/reverse-string/build", | ||
"command": "/usr/bin/c++ -DEXERCISM_RUN_ALL_TESTS -g -Wall -Wextra -Wpedantic -Werror -std=c++17 -o CMakeFiles/reverse-string.dir/reverse_string_test.cpp.o -c /home/vpayno/git_vpayno/exercism-workspace/cpp/reverse-string/reverse_string_test.cpp", | ||
"file": "/home/vpayno/git_vpayno/exercism-workspace/cpp/reverse-string/reverse_string_test.cpp" | ||
}, | ||
{ | ||
"directory": "/home/vpayno/git_vpayno/exercism-workspace/cpp/reverse-string/build", | ||
"command": "/usr/bin/c++ -DEXERCISM_RUN_ALL_TESTS -g -Wall -Wextra -Wpedantic -Werror -std=c++17 -o CMakeFiles/reverse-string.dir/reverse_string.cpp.o -c /home/vpayno/git_vpayno/exercism-workspace/cpp/reverse-string/reverse_string.cpp", | ||
"file": "/home/vpayno/git_vpayno/exercism-workspace/cpp/reverse-string/reverse_string.cpp" | ||
}, | ||
{ | ||
"directory": "/home/vpayno/git_vpayno/exercism-workspace/cpp/reverse-string/build", | ||
"command": "/usr/bin/c++ -DEXERCISM_RUN_ALL_TESTS -g -Wall -Wextra -Wpedantic -Werror -std=c++17 -o CMakeFiles/reverse-string.dir/test/tests-main.cpp.o -c /home/vpayno/git_vpayno/exercism-workspace/cpp/reverse-string/test/tests-main.cpp", | ||
"file": "/home/vpayno/git_vpayno/exercism-workspace/cpp/reverse-string/test/tests-main.cpp" | ||
} | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
-std=c++17 | ||
-stdlib=libstdc++ | ||
-g | ||
-Wall | ||
-Wextra | ||
-Wpedantic | ||
-Werror | ||
-Wno-unused-parameter |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,20 @@ | ||
#include "reverse_string.h" | ||
|
||
#include <iterator> | ||
#include <string> | ||
|
||
namespace reverse_string { | ||
|
||
} // namespace reverse_string | ||
std::string reverse_string(std::string text) { | ||
std::string reversed; | ||
|
||
if (text.empty()) { | ||
return reversed; | ||
} | ||
|
||
std::copy(text.rbegin(), text.rend(), std::back_inserter(reversed)); | ||
|
||
return reversed; | ||
} | ||
|
||
} // namespace reverse_string |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,15 @@ | ||
#if !defined(REVERSE_STRING_H) | ||
#define REVERSE_STRING_H | ||
|
||
// Stop using C headers in C++ projects that have no C code!!!!!! | ||
|
||
#include <iterator> | ||
#include <string> | ||
|
||
namespace reverse_string { | ||
|
||
} // namespace reverse_string | ||
std::string reverse_string(std::string text); | ||
|
||
} // namespace reverse_string | ||
|
||
#endif // REVERSE_STRING_H | ||
#endif // REVERSE_STRING_H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | ||
<plist version="1.0"> | ||
<dict> | ||
<key>clang_version</key> | ||
<string>Debian clang version 16.0.6 (++20230610113348+7cbf1a259152-1~exp1~20230610233446.99)</string> | ||
<key>diagnostics</key> | ||
<array> | ||
</array> | ||
<key>files</key> | ||
<array> | ||
</array> | ||
</dict> | ||
</plist> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | ||
<plist version="1.0"> | ||
<dict> | ||
<key>clang_version</key> | ||
<string>Debian clang version 16.0.6 (++20230610113348+7cbf1a259152-1~exp1~20230610233446.99)</string> | ||
<key>diagnostics</key> | ||
<array> | ||
</array> | ||
<key>files</key> | ||
<array> | ||
</array> | ||
</dict> | ||
</plist> |
Oops, something went wrong.