Explorar o código

Added dummy testcases to integrate all source files into coverage meassurement

stefan %!s(int64=4) %!d(string=hai) anos
pai
achega
fe3c1e3a43

+ 14 - 10
makefile

@@ -20,16 +20,20 @@ SOURCES :=  src/shellmatta.c                \
             
 INCLUDES    := api .
 
-UNITTEST_SOURCES := test/unittest/test_main.cpp                                    \
-                    test/unittest/shellmatta_utils/test_utils_writeEcho.cpp        \
-                    test/unittest/shellmatta_utils/test_utils_shellItoa.cpp        \
-                    test/unittest/shellmatta_utils/test_utils_saveCursorPos.cpp    \
-                    test/unittest/shellmatta_utils/test_utils_restoreCursorPos.cpp \
-                    test/unittest/shellmatta_utils/test_utils_eraseLine.cpp        \
-                    test/unittest/shellmatta_utils/test_utils_rewindCursor.cpp     \
-                    test/unittest/shellmatta_utils/test_utils_forwardCursor.cpp    \
-                    test/unittest/shellmatta_utils/test_utils_clearInput.cpp       \
-                    test/unittest/shellmatta_utils/test_utils_insertChars.cpp
+UNITTEST_SOURCES := test/unittest/test_main.cpp                                         \
+                    test/unittest/shellmatta_utils/test_utils_writeEcho.cpp             \
+                    test/unittest/shellmatta_utils/test_utils_shellItoa.cpp             \
+                    test/unittest/shellmatta_utils/test_utils_saveCursorPos.cpp         \
+                    test/unittest/shellmatta_utils/test_utils_restoreCursorPos.cpp      \
+                    test/unittest/shellmatta_utils/test_utils_eraseLine.cpp             \
+                    test/unittest/shellmatta_utils/test_utils_rewindCursor.cpp          \
+                    test/unittest/shellmatta_utils/test_utils_forwardCursor.cpp         \
+                    test/unittest/shellmatta_utils/test_utils_clearInput.cpp            \
+                    test/unittest/shellmatta_utils/test_utils_insertChars.cpp           \
+                    test/unittest/shellmatta_autocomplete/test_autocomplete_run.cpp	    \
+                    test/unittest/shellmatta_escape/test_escape_processArrowKeys.cpp    \
+                    test/unittest/shellmatta_history/test_appendHistoryByte.cpp         \
+                    test/unittest/shellmatta/test_shellmatta_doInit.cpp
 
 INTEGRATIONTEST_SOURCES :=  test/integrationtest/test_main.cpp          \
                             test/integrationtest/test_integration.cpp

+ 14 - 0
test/unittest/shellmatta/test_shellmatta_doInit.cpp

@@ -0,0 +1,14 @@
+#include "test/framework/catch.hpp"
+#include "src/shellmatta.c"
+#include <string.h>
+
+TEST_CASE( "shellmatta dummy" ) {
+
+    shellmatta_instance_t inst;
+    //shellmatta_handle_t handle;
+    inst.inputCount = 0u;
+
+    //shellmatta_doInit(&inst, &handle, )
+
+    REQUIRE( inst.inputCount == 0u);
+}

+ 13 - 0
test/unittest/shellmatta_autocomplete/test_autocomplete_run.cpp

@@ -0,0 +1,13 @@
+#include "test/framework/catch.hpp"
+#include "src/shellmatta_autocomplete.c"
+#include <string.h>
+
+TEST_CASE( "shellmatta_autocomplete_run dummy" ) {
+
+    shellmatta_instance_t inst;
+    inst.inputCount = 0u;
+
+    autocomplete_run(&inst);
+
+    REQUIRE( inst.inputCount == 0u);
+}

+ 13 - 0
test/unittest/shellmatta_escape/test_escape_processArrowKeys.cpp

@@ -0,0 +1,13 @@
+#include "test/framework/catch.hpp"
+#include "src/shellmatta_escape.c"
+#include <string.h>
+
+TEST_CASE( "shellmatta_escape dummy" ) {
+
+    shellmatta_instance_t inst;
+    inst.inputCount = 0u;
+
+    escape_processArrowKeys(&inst);
+
+    REQUIRE( inst.inputCount == 0u);
+}

+ 13 - 0
test/unittest/shellmatta_history/test_appendHistoryByte.cpp

@@ -0,0 +1,13 @@
+#include "test/framework/catch.hpp"
+#include "src/shellmatta_history.c"
+#include <string.h>
+
+TEST_CASE( "shellmatta_history dummy" ) {
+
+    shellmatta_instance_t inst;
+    inst.inputCount = 0u;
+
+    //appendHistoryByte(&inst, 'a');
+
+    REQUIRE( inst.inputCount == 0u);
+}