Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: ucunit/ucunit
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: master
Choose a base ref
...
head repository: IncQueryLabs/ucunit
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref
Able to merge. These branches can be automatically merged.

Commits on Aug 31, 2018

  1. Generate JUnit-compatible reports from uCUnit output

    Instead of parsing the normal output, an additional mode is added to
    uCUnit which format the test execution information into a JSON document
    intended for automated processing.
    balazsgrill committed Aug 31, 2018
    Copy the full SHA
    06b9b9c View commit details

Commits on Sep 12, 2018

  1. Copy the full SHA
    7b41fed View commit details

Commits on Sep 17, 2018

  1. Copy the full SHA
    75fabf0 View commit details

Commits on Mar 14, 2019

  1. Copy the full SHA
    6e6389a View commit details

Commits on Mar 15, 2019

  1. Merge pull request #1 from dandrid/master

    Added CheckIsNotEqual and fixed CheckIsInRange
    balazsgrill authored Mar 15, 2019
    Copy the full SHA
    2292791 View commit details

Commits on Aug 28, 2019

  1. Copy the full SHA
    4b738be View commit details
  2. Merge pull request #2 from logicals-gmbh/simplify_json_to_xml

    Starting process in context of conversion script
    balazsgrill authored Aug 28, 2019
    Copy the full SHA
    ab44576 View commit details

Commits on Nov 17, 2020

  1. Copy the full SHA
    783d4a7 View commit details

Commits on Nov 19, 2020

  1. Initial commit for ucunit-xml output

      * Base structures and API for XML test result storage
      * UCUNIT_MODE_XML definition
      * Basic example in the windows integraton
    zolko committed Nov 19, 2020
    Copy the full SHA
    bd5da5e View commit details
  2. makefile changed, gitignore updated

    -moved makefile out of template folder
    -fixed system.h include error
    balinthuszar committed Nov 19, 2020
    Copy the full SHA
    a06702b View commit details
  3. Copy the full SHA
    4013528 View commit details

Commits on Nov 23, 2020

  1. Makefile refactored, most XML methods implemented, XML header file re…

    …factored
    
    - Xml methotds packed into one xml method that is called at the end of the test
    -almost all methods implemented, can be built without errors or warnings, but it does not run --> needs debugging
    - the cause is probably the use of only strcat, will try to use sprintf() and strncat()
    - enum of checktypes removed
    - UCUNIT_XmlCheck struct refactored
    balinthuszar committed Nov 23, 2020
    Copy the full SHA
    4f89843 View commit details

Commits on Nov 25, 2020

  1. corrected mistakes on the implementation of the xml methods

    - building up the xml string not only using strcat
    - xml GET methods working up to the UCUNIT_XML_GetProperties() method
    -  UCUNIT_XML_GetTestcases() needs debugging to find the cause of the error, which place of occurrence is indicated with a TODO
    balinthuszar committed Nov 25, 2020
    Copy the full SHA
    9ac4718 View commit details
  2. Copy the full SHA
    d4411d0 View commit details
  3. Revert "Revert "corrected mistakes on the implementation of the xml m…

    …ethods""
    
    This reverts commit d4411d0.
    balinthuszar committed Nov 25, 2020
    Copy the full SHA
    f246287 View commit details

Commits on Nov 26, 2020

  1. file and line properties corrected

    -header file refactored
    balinthuszar committed Nov 26, 2020
    Copy the full SHA
    b4b5a19 View commit details

Commits on Dec 9, 2020

  1. Xml mode updated

    Header file:
    -macros updated
    -new property integrated into the Teststute structure
    -documentation of existing and new methods updated
    Source file:
    -using new layout template
    -calculating the size of arrays used to store the informations of a testcase in a dynamic form
    TODO:
    -calculate the size of the array which stores the whole xml object
    -implementing I/O
    -validating
    balinthuszar committed Dec 9, 2020
    Copy the full SHA
    688476b View commit details
  2. correcting running malfunction

    - calculating the size of the whole xml object is not yet implemented
    balinthuszar committed Dec 9, 2020
    Copy the full SHA
    ef0e805 View commit details

Commits on Dec 10, 2020

  1. corrected naming conventions

    - variables and properties are lowerCamelCase from now on
    balinthuszar committed Dec 10, 2020
    Copy the full SHA
    ad1bbf8 View commit details

Commits on Dec 14, 2020

  1. xml calculating memory adjustments

    -calculating the whole memory size of the testsuitce implemented
    -but there's a bug where the UCUNIT_XML_GetTestcases(char *xmlString) changes the memory allocation of the buffer which stores the whole xml string
    - this bug needs some debugging
    balinthuszar committed Dec 14, 2020
    Copy the full SHA
    a5942fd View commit details
  2. memory error solved on array

    -introduced an other temporary buffer for the testcases which made it possibly to use the calculated memory size
    -but the calculated memory size is way off (used memory: 778, calculated ~2200)
    balinthuszar committed Dec 14, 2020
    Copy the full SHA
    21bf0b1 View commit details

Commits on Dec 15, 2020

  1. xml memory calculation corrected, code structure refactored

    -using dynamic memory calculation
    -the memory calculation is very close to the exact value(2399 -> 2419)
    -restructured a few methods to be easier to understand
    -started using the sizeof operator instead of strlen on integers
    balinthuszar committed Dec 15, 2020
    Copy the full SHA
    246d08e View commit details

Commits on Dec 18, 2020

  1. xml refactoring

    - the methods which are responsible for calculating the size of the xml string array are now static methods and can't be called from outside of the source file
    balinthuszar committed Dec 18, 2020
    Copy the full SHA
    32c0028 View commit details
  2. xml write to file function implemented

    - introduced a new property to UCUNIT_XmlTestSuites which helps me to name the outputfile
    - this new property is assigned when the UCUNIT_XML_TestBegin method is called
    - basic write to file method implemented
    balinthuszar committed Dec 18, 2020
    Copy the full SHA
    9d725c9 View commit details

Commits on Dec 22, 2020

  1. xml format and I/O updated

    - the generated xml file is written to the currently open directory
    - xml format changed according to a xml validation file
    balinthuszar committed Dec 22, 2020
    Copy the full SHA
    0db00e8 View commit details
  2. xml format corrected

    - changed failure element to system-err element
    balinthuszar committed Dec 22, 2020
    Copy the full SHA
    b194c29 View commit details
  3. dynamic memory calculation updated

    - removed unnecessary use of strlen
    balinthuszar committed Dec 22, 2020
    Copy the full SHA
    9ba8995 View commit details

Commits on Jan 2, 2021

  1. Copy the full SHA
    26e3c17 View commit details
  2. updated memory calculation for xml string

    removed unnecessary usage of sizeof
    balinthuszar committed Jan 2, 2021
    Copy the full SHA
    204b689 View commit details
  3. refactoring, checking number of testaces and checks

    - removed method containing only one line of code
    - checking conditions of number of testcases and number of checks within a testcase
    balinthuszar committed Jan 2, 2021
    Copy the full SHA
    1dad5cc View commit details
  4. header file update

    - updated method descriptions
    - removed duplicates, not implemented methods
    balinthuszar committed Jan 2, 2021
    Copy the full SHA
    6eb29e7 View commit details
  5. refactoring

    - removed TODOs and a  not implemented method
    balinthuszar committed Jan 2, 2021
    Copy the full SHA
    920297a View commit details
  6. corrected compile error

    balinthuszar committed Jan 2, 2021
    Copy the full SHA
    b9973e1 View commit details

Commits on Jan 4, 2021

  1. fixed loop

    balinthuszar committed Jan 4, 2021
    Copy the full SHA
    d1266c0 View commit details
  2. fixed duplicate save of filepath

    - removed filepath attribute from check structure
    balinthuszar committed Jan 4, 2021
    Copy the full SHA
    75aab6f View commit details

Commits on Jan 5, 2021

  1. xml mode update

    - makefile flags updated
    - unused implementations, macros removed
    - empty implementations corrected, added new ones
    - changing location of file output method
    balinthuszar committed Jan 5, 2021
    Copy the full SHA
    37acaec View commit details
  2. updating according to code review

    - using stdint header types instead of unsigned ints
    - determining length of filepath only once and passing it as paramater instead of calculating it every time
    - removed unused parameters
    balinthuszar committed Jan 5, 2021
    Copy the full SHA
    3370716 View commit details
  3. I/O update

    - creating xml file from System.c and removed xml creating method from the xml mode's header and source file
    balinthuszar committed Jan 5, 2021
    Copy the full SHA
    d5e08e3 View commit details

Commits on Jan 8, 2021

  1. checking number of testcases and checks implemented

    - number of failures do not match with xml
    - todo: determine number of errors
    balinthuszar committed Jan 8, 2021
    Copy the full SHA
    f89cb8b View commit details

Commits on Jan 11, 2021

  1. review tasks completed 100%

    - no warnings given to unused parameters
    - calculating system-err memory size updated
    - determining number of errors implemented (getNumberOfErros)
    - using the other modes causes no error
    - documentation of methods updated
    balinthuszar committed Jan 11, 2021
    Copy the full SHA
    8e7458e View commit details

Commits on Jan 12, 2021

  1. modifications according to review

    - using GetModuleFileNameA to get the filepath when creating the output xml file
    - fixed wrong condition check when adding testchecks
    - refactored layout
    - increased the size of the char array which contains the testsuite system-err string
    - updated the documentation of the newly altered methods
    balinthuszar committed Jan 12, 2021
    Copy the full SHA
    f547cb1 View commit details
  2. filename length updated

    balinthuszar committed Jan 12, 2021
    Copy the full SHA
    bcd4228 View commit details
  3. little array size

    - increased the size of the array which contains the error message when there are too many checks
    balinthuszar committed Jan 12, 2021
    Copy the full SHA
    19c32d3 View commit details
  4. testing other modes

    - updated the empty implementations
    balinthuszar committed Jan 12, 2021
    Copy the full SHA
    c917609 View commit details

Commits on Jan 14, 2021

  1. update on swapping between methods and using in large scale testsuites

    - using uint16_t for the possibility of having a large scale of checks or testcases
    - using #ifdef preprocessor in System.c for the xml mode
    - fixed bug which occured when there were more checks than allowed, and the skipped checks were added to the last testcase
    balinthuszar committed Jan 14, 2021
    Copy the full SHA
    4819f40 View commit details

Commits on Jan 15, 2021

  1. default values set

    balinthuszar committed Jan 15, 2021
    Copy the full SHA
    a2992a8 View commit details

Commits on Feb 1, 2021

  1. structure, storing tests, handling errors updated

    - removed arrays from structure,  having 2 arrays in the source file which contains the checks and testcases
    - "system-err" element replaced with "error"
    - removed not used methods
    - updated documentation
    - code structure rearranged
    balinthuszar committed Feb 1, 2021
    Copy the full SHA
    b1b705f View commit details
  2. warning solved

    - conversion warning solved by casting uint16_t type
    balinthuszar committed Feb 1, 2021
    Copy the full SHA
    6f49423 View commit details

Commits on Feb 2, 2021

  1. refactoring, correcting issue accoording to review

    - usubg [number]u format for usigned int variables and function return types
    - checking if any error occured the same way
    - created enum type for errors, but not yet used
    - refactoring
    balinthuszar committed Feb 2, 2021
    Copy the full SHA
    b937b3c View commit details

Commits on Feb 4, 2021

  1. enum errortype implemented

    - also fixed a bug that occured when  the limit of check numbers was reached just when a testcases ended which caused the xml to have an empty testcase
    balinthuszar committed Feb 4, 2021
    Copy the full SHA
    49b6b6b View commit details
Showing with 1,489 additions and 196 deletions.
  1. +13 −0 .gitignore
  2. +1 −10 v1.0.1/Testsuite.c
  3. +17 −10 v1.0.1/template/Makefile
  4. +57 −25 v1.0.1/template/System.c
  5. +209 −0 v1.0.1/uCUnit-hr.h
  6. +160 −0 v1.0.1/uCUnit-json.h
  7. +45 −151 v1.0.1/uCUnit-v1.0.h
  8. +509 −0 v1.0.1/uCUnit-xml.c
  9. +370 −0 v1.0.1/uCUnit-xml.h
  10. +108 −0 v1.0.1/ucunit_json_to_xml.py
13 changes: 13 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
.cproject
*.o
*.exe
v1.0.1/.project
jenkins-junit.xsd
v1.0.1/.settings/language.settings.xml
*.xml
.project
.settings
.cproject
.project
.cproject
.settings/language.settings.xml
11 changes: 1 addition & 10 deletions v1.0.1/Testsuite.c
Original file line number Diff line number Diff line change
@@ -182,16 +182,7 @@ void Testsuite_RunTests(void)
int main(void)
{
UCUNIT_Init();
UCUNIT_WriteString("\n**************************************");
UCUNIT_WriteString("\nName: ");
UCUNIT_WriteString("uCUnit demo application");
UCUNIT_WriteString("\nCompiled: ");
UCUNIT_WriteString(__DATE__);
UCUNIT_WriteString("\nTime: ");
UCUNIT_WriteString(__TIME__);
UCUNIT_WriteString("\nVersion: ");
UCUNIT_WriteString(UCUNIT_VERSION);
UCUNIT_WriteString("\n**************************************");
UCUNIT_TestBegin("uCUnit demo application");
Testsuite_RunTests();
UCUNIT_Shutdown();

27 changes: 17 additions & 10 deletions v1.0.1/template/Makefile
Original file line number Diff line number Diff line change
@@ -7,7 +7,7 @@
#----------------------------------------------------
# Compiler
CC:=gcc
CFLAGS:=-g
CFLAGS:= -std='c99' -g -Wall -Wextra -pedantic -Wconversion

#Linker
LD:=gcc
@@ -17,23 +17,29 @@ LDFLAGS:=-g
RUN:=cmd /C

# Clean up
RM:=del
RM:=rm -f

#----------------------------------------------------
# Files
#----------------------------------------------------
# Name of target file
TARGET:=Testsuite.exe
TARGET:=Testsuite

# Sourcefiles
SRCS:= \
./System.c \
../Testsuite.c \
./System.c \
../uCUnit-xml.c \

# Objectfiles
OBJS:= \
./System.obj \
../Testsuite.obj \
./System.o \
../Testsuite.o \
../uCUnit-xml.o \

# Dependencies

DEPS:= \

#----------------------------------------------------
# Build all
@@ -49,22 +55,23 @@ run: $(TARGET)
#----------------------------------------------------
$(TARGET): $(OBJS)
echo 'Linking...'
$(LD) $(LDFLAGS) -o $(notdir $@) $(notdir $(OBJS))
$(CC) -o $(TARGET) $^ $(LDFLAGS)

#----------------------------------------------------
# Compiler
#----------------------------------------------------
%.obj: %.c
echo 'Compiling...'
$(CC) $(CFLAGS) -o $(notdir $@) -c $<
$(CC) -o $(notdir $@) -c $< $(CFLAGS)

#----------------------------------------------------
# Clean Project
#----------------------------------------------------
clean:
echo 'Running clean...'
$(RM) $(TARGET)
$(RM) System.obj
$(RM) Testsuite.obj
$(RM) ../**/*.o core
$(RM) ../*.o core
$(RM) *.xml core
echo 'Clean finished.'

82 changes: 57 additions & 25 deletions v1.0.1/template/System.c
Original file line number Diff line number Diff line change
@@ -4,11 +4,13 @@
* *
* (C) 2007 - 2008 Sven Stefan Krauss *
* https://www.ucunit.org *
* (C) 2020 - 2021 Balint Huszar - IncQuery Labs cPlc. *
* (C) 2020 - 2021 Zoltan Selmeczi - IncQuery Labs cPlc. *
* *
* File : System.c *
* Description : System dependent functions used by uCUnit. *
* This file has to be customized for your hardware. *
* Author : Sven Stefan Krauss *
* This file has to be customized for your hardware. *
* Author : Sven Stefan Krauss, Zoltan Selmeczi, Balint Huszar *
* Contact : www.ucunit.org *
* *
*****************************************************************************/
@@ -38,56 +40,86 @@
#include <stdio.h>
#include <stdlib.h>
#include "../System.h"
#include "../uCUnit-xml.h"
#include "../uCUnit-v1.0.h"

#ifdef UCUNIT_MODE_XML
static void System_WriteXMLStringToFile(char *xmlString)
{
char filename[MAX_PATH] = { 0 };

GetModuleFileNameA(NULL, filename, MAX_PATH);
char outputfile[strlen(filename) + 1];
memset(outputfile, 0, sizeof(outputfile));
strncat(outputfile, filename, strlen(filename) - 3);
strcat(outputfile, "xml");

FILE *fp;

fp = fopen(outputfile, "w+");
fprintf(fp, xmlString);
fclose(fp);
}
#endif

/* Stub: Initialize your hardware here */
void System_Init(void)
{

printf("Init of hardware finished.\n");
printf("Init of hardware finished.\n");
}

/* Stub: Shutdown your hardware here */
void System_Shutdown(void)
{

/* asm("\tSTOP"); */
printf("System shutdown.\n");
exit(0);
/* asm("\tSTOP"); */
#ifdef UCUNIT_MODE_XML
size_t bufferSize = 0;
UCUNIT_XML_GetSizeOfTestsuite(&bufferSize);
char buffer[bufferSize];
memset(buffer, 0, sizeof(buffer));
UCUNIT_XML_GetXmlObject(buffer);
printf(buffer);
System_WriteXMLStringToFile(buffer);
#endif
printf("System shutdown.\n");
//exit(0);
}

/* Stub: Recover your system from a safe state. */
void System_Recover(void)
{
/* Stub: Recover the hardware */
/* asm("\tRESET"); */
printf("System recover.\n");
exit(0);
/* Stub: Recover the hardware */
/* asm("\tRESET"); */
printf("System recover.\n");
exit(0);
}

/* Stub: Put system in a safe state */
void System_Safestate(void)
{
/* Disable all port pins */
/* PORTA = 0x0000; */
/* PORTB = 0x0000; */
/* PORTC = 0x0000; */

/* Disable interrupts */
/* DIE(); */

/* Put processor into idle state */
/* asm("\tIDLE"); */
printf("System safe state.\n");
exit(0);
/* Disable all port pins */
/* PORTA = 0x0000; */
/* PORTB = 0x0000; */
/* PORTC = 0x0000; */

/* Disable interrupts */
/* DIE(); */

/* Put processor into idle state */
/* asm("\tIDLE"); */
printf("System safe state.\n");
exit(0);
}

/* Stub: Write a string to the host/debugger/simulator */
void System_WriteString(char * msg)
void System_WriteString(char *msg)
{
printf(msg);
printf(msg);
}

void System_WriteInt(int n)
{
printf("%i", n);
printf("%i", n);
}
Loading