Compare commits
No commits in common. "487040e99b4c8d22923e1e6cadf6acb8238b6e70" and "b3d33c2db92a1a238a09f01707052ff24cf86217" have entirely different histories.
487040e99b
...
b3d33c2db9
3 changed files with 8 additions and 70 deletions
|
@ -1,16 +0,0 @@
|
|||
/*
|
||||
* Author: username
|
||||
* Date: todays_date
|
||||
* filename: module_name.cpp
|
||||
* description: module_purpose
|
||||
*/
|
||||
|
||||
#include "module_name.h"
|
||||
|
||||
// dumb test function
|
||||
int add_two(int a)
|
||||
{
|
||||
int b = a;
|
||||
b += 2;
|
||||
return b;
|
||||
}
|
|
@ -12,7 +12,7 @@ extern "C"
|
|||
#include "module_name.h"
|
||||
}
|
||||
|
||||
TEST_GROUP(test_module_name)
|
||||
TEST_GROUP(FirstTestGroup)
|
||||
{
|
||||
void setup()
|
||||
{
|
||||
|
@ -24,12 +24,12 @@ TEST_GROUP(test_module_name)
|
|||
}
|
||||
};
|
||||
|
||||
TEST(test_module_name, FirstTest)
|
||||
TEST(FirstTestGroup, FirstTest)
|
||||
{
|
||||
FAIL("Fail me!");
|
||||
}
|
||||
|
||||
TEST(test_module_name, SecondTest)
|
||||
TEST(FirstTestGroup, SecondTest)
|
||||
{
|
||||
STRCMP_EQUAL("hello", "world");
|
||||
LONGS_EQUAL(1, 2);
|
||||
|
|
56
otto.sh
56
otto.sh
|
@ -117,7 +117,6 @@ git_remove_module () {
|
|||
|
||||
|
||||
add_new_module () {
|
||||
|
||||
read -p "Enter the name of the module:" modname
|
||||
|
||||
result=$(does_module_exist "$modname")
|
||||
|
@ -138,35 +137,7 @@ add_new_module () {
|
|||
|
||||
#copy the template files.
|
||||
echo "copying & customizing template files..."
|
||||
|
||||
echo "Select an option:"
|
||||
echo "1.) Add a C module"
|
||||
echo "2.) Add a C++ module"
|
||||
|
||||
read -P "choice:" lanuage_selection
|
||||
|
||||
case $lanuage_selection in
|
||||
1)
|
||||
echo "You selected Option 1"
|
||||
add_c_mdoule
|
||||
;;
|
||||
2)
|
||||
echo "You selected Option 2"
|
||||
add_cpp_module
|
||||
;;
|
||||
*)
|
||||
echo "Invalid Choice!\nExiting..."
|
||||
;;
|
||||
esac
|
||||
|
||||
# Now we add the new files to the git tracked files
|
||||
git_add_module "${modname}"
|
||||
|
||||
|
||||
}
|
||||
|
||||
add_c_mdoule () {
|
||||
|
||||
|
||||
sed "s/module_name/${modname}/" $MODULE_DIR/module_name.c > $modsrc_dir/${modname}.c
|
||||
sed -i'' "3s/todays_date/$(date +%Y)/" $modsrc_dir/${modname}.c
|
||||
|
||||
|
@ -184,30 +155,13 @@ add_c_mdoule () {
|
|||
echo "Resulting files/dirs:"
|
||||
tree -L 2 $modsrc_dir
|
||||
tree -L 2 $modtest_dir
|
||||
|
||||
# Now we add the new files to the git tracked files
|
||||
git_add_module "${modname}"
|
||||
|
||||
|
||||
}
|
||||
|
||||
add_cpp_module () {
|
||||
|
||||
sed "s/module_name/${modname}/" $MODULE_DIR/module_name.cpp > $modsrc_dir/${modname}.cpp
|
||||
sed -i'' "3s/todays_date/$(date +%Y)/" $modsrc_dir/${modname}.cpp
|
||||
|
||||
sed "s/module_name/${modname_cap}/" $MODULE_DIR/module_name.h > $modsrc_dir/${modname}.h
|
||||
sed -i'' "3s/todays_date/$(date +%Y)/" $modsrc_dir/${modname}.h
|
||||
|
||||
sed "s/module_name/${modname}/" $MODULE_DIR/CMakeLists.txt > $modsrc_dir/CMakeLists.txt
|
||||
|
||||
sed "s/module_name/${modname}/" $MODULE_DIR/test_module_name.cpp > $modtest_dir/test_${modname}.cpp
|
||||
sed "s/module_name/${modname}/" $MODULE_DIR/TestCMakeLists.txt > $modtest_dir/CMakeLists.txt
|
||||
|
||||
# Add the module to the cmake lists files.
|
||||
add_module_to_cmakes "${modname}"
|
||||
|
||||
echo "Resulting files/dirs:"
|
||||
tree -L 2 $modsrc_dir
|
||||
tree -L 2 $modtest_dir
|
||||
|
||||
}
|
||||
|
||||
del_module () {
|
||||
read -p "Enter the name of the module:" modname
|
||||
|
|
Loading…
Add table
Reference in a new issue