Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
76 changes: 68 additions & 8 deletions .github/workflows/verifier.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,76 @@
name: verifier
name: verifyer
on: [pull_request, workflow_dispatch]
jobs:
multi_test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: ruby/setup-ruby@v1
- uses: actions/checkout@main

- name: Install cpputest and lcov ...
run: |
sudo apt install --no-install-recommends -y cpputest lcov
sudo pip install junit2html

- name: Directory test
run: |
echo ${HOME}
echo ${PWD}
mkdir -p ${HOME}/work/umm_malloc/src
find ${HOME}/work/umm_malloc -type d

- name: Link umm_malloc to src
run: |
ln -s ${HOME}/work/umm_malloc/umm_malloc ${HOME}/work/umm_malloc/src/umm_malloc
ls -al ${HOME}/work/umm_malloc/src/umm_malloc

- name: Link unittest to src
run: |
ln -s ${HOME}/work/umm_malloc/umm_malloc/unittest ${HOME}/work/umm_malloc/src/unittest
ls -al ${HOME}/work/umm_malloc/src/unittest

- name: Copy adaptabuild config files
run: |
cp ${HOME}/work/umm_malloc/umm_malloc/adaptabuild/* ${HOME}/work/umm_malloc
ls -al ${HOME}/work/umm_malloc

- name: Clone adaptabuild
run: |
git clone https://github.com/rhempel/adaptabuild.git ${HOME}/work/umm_malloc/adaptabuild
ls -al ${HOME}/work/umm_malloc

- name: Run the unit tests
run: |
make -f ${HOME}/work/umm_malloc/adaptabuild.mak MCU=host PRODUCT=unittest unittest
ls -al ${HOME}/work/umm_malloc/artifacts
find ${HOME}/work/umm_malloc/artifacts

- name: Archive test and coverage results
uses: actions/upload-artifact@main
with:
ruby-version: 3.0.2
name: Test and Coverage Results
path: ~/work/umm_malloc/artifacts/unittest/host/umm_malloc


# ls -al unittest
# ls -al unittest/artifacts/unittest/host/umm_malloc/
# ls -al ~
# ls -al ${PWD}/unittest/artifacts/unittest/host/umm_malloc
# echo ${PWD}
# echo ${HOME}
# find ${HOME} -type d

# - name: Archive test and coverage results
# uses: actions/upload-artifact@main
# with:
# name: Test and Coverage Results
# path: ${HOME}/work/unittest/artifacts/unittest/host/umm_malloc

# cd unittest && cp src/umm_malloc/adaptabuild/* .
# cd unittest && make -f adaptabuild.mak MCU=host PRODUCT=unittest unittest
# ls -al unittest

- name: Install ceedling
run: gem install ceedling
# - name: Link unittest source up one level
# run: sudo apt install --no-install-recommends -y cpputest

- name: Run multi-configuration tests
run: ./multitest.sh
# - name: Run multi-configuration tests
# run: ./multitest.sh
50 changes: 21 additions & 29 deletions adaptabuild.mak
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# ----------------------------------------------------------------------------
# umm_malloc makefile
# (c)2006-2023 by Ralph Hempel, Owen Sound, Canada
# rhempel@hempeldesigngroup.com
# umm_malloc makefile for adaptabuild
#
# This is designed to be included as part of a make system designed
# to be expandable and maintainable using techniques found in:
Expand All @@ -12,10 +10,10 @@
MODULE := umm_malloc

MODULE_PATH := $(call make_current_module_path)
$(info MODULE_PATH is $(MODULE_PATH))
$(call log_debug,MODULE_PATH is $(MODULE_PATH))

$(MODULE)_PATH := $(MODULE_PATH)
$(info $(MODULE)_PATH is $($(MODULE)_PATH))
$(call log_debug,$(MODULE)_PATH is $($(MODULE)_PATH))

# ----------------------------------------------------------------------------
# Source file lists go here, C dependencies are automatically generated
Expand All @@ -36,42 +34,36 @@ SRC_TEST :=

SRC_C += src/umm_malloc.c

SRC_TEST += unittest/test_FirstMalloc.c
SRC_TEST += unittest/test_TooBigMalloc.c
SRC_TEST += unittest/test_Free.c
SRC_TEST += unittest/test_Realloc.c
SRC_TEST += unittest/test_MultiMalloc.c
SRC_TEST += unittest/test_Metrics.c
SRC_TEST += unittest/test_Poison.c
SRC_TEST += unittest/test_Stress.c
SRC_TEST += unittest/support_umm_malloc.c
SRC_TEST += unittest/main.c
SRC_TEST += cpputest/test_FirstMalloc.c
SRC_TEST += cpputest/test_TooBigMalloc.c
SRC_TEST += cpputest/test_Free.c
SRC_TEST += cpputest/test_Realloc.c
SRC_TEST += cpputest/test_MultiMalloc.c
SRC_TEST += cpputest/test_Metrics.c
SRC_TEST += cpputest/test_Poison.c
SRC_TEST += cpputest/test_Stress.c
SRC_TEST += cpputest/support_umm_malloc.c
SRC_TEST += cpputest/main.c

# ----------------------------------------------------------------------------
# Set up the module level specifics for the source, include, and object paths

$(MODULE)_SRCPATH :=
$(MODULE)_SRCPATH += $(MODULE_PATH)/src
# Set up the module level include path

$(MODULE)_INCPATH :=
$(MODULE)_INCPATH += $(umm_libc_PATH)/include

ifeq (unittest,$(MAKECMDGOALS))
$(MODULE)_SRCPATH += $(MODULE_PATH)/unittest

$(MODULE)_INCPATH += $(MODULE_PATH)/src
$(MODULE)_INCPATH += $(MODULE_PATH)/unittest
$(MODULE)_INCPATH += $(MODULE_PATH)/cpputest
endif

# ----------------------------------------------------------------------------
# NOTE: The default config file must be created somehow - it is normally
# up to the developer to specify which defines are needed and how they
# are to be configured.
#
# By convention we place config files in product/$(PRODUCT)/config/$(MCU) because
# By convention we place config files in $(PRODUCT)/config/$(MCU) because
# that's an easy pace to leave things like HAL config, linker scripts etc

$(MODULE)_INCPATH += product/$(PRODUCT)/config/$(MCU)
$(MODULE)_INCPATH += $(PRODUCT)/config/$(MCU)

# ----------------------------------------------------------------------------
# Set any module level compile time defaults here
Expand All @@ -80,7 +72,7 @@ $(MODULE)_CDEFS :=
$(MODULE)_CDEFS +=

$(MODULE)_CFLAGS :=
$(MODULE)_CFLAGS += -Wno-builtin-declaration-mismatch
$(MODULE)_CFLAGS +=

ifeq (unittest,$(MAKECMDGOALS))
$(MODULE)_CDEFS +=
Expand All @@ -93,11 +85,11 @@ include $(ADAPTABUILD_PATH)/make/library.mak

# ----------------------------------------------------------------------------
# Include the unit test framework makefile that works for this module
# if the target is unittest
# if the target is cpputest

ifeq (unittest,$(MAKECMDGOALS))
TESTABLE_MODULES += $(MODULE)
$(MODULE)_test_main = $(MODULE)/unittest/main.o
TESTABLE_MODULES += $(MODULE)_UNITTEST
$(MODULE)_test_main := cpputest/main.o
include $(ADAPTABUILD_PATH)/make/test/cpputest.mak
endif

Expand Down
24 changes: 24 additions & 0 deletions adaptabuild/adaptabuild.mak
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# ----------------------------------------------------------------------------
# Do NOT move these functions - they must live in the top level makefile
#
ABS_PATH := $(patsubst %/,%,$(dir $(realpath $(firstword $(MAKEFILE_LIST)))))
$(call log_info,ABS_PATH is $(ABS_PATH))

ROOT_PATH := $(patsubst %/,%,$(dir $(firstword $(MAKEFILE_LIST))))
$(call log_info,ROOT_PATH is $(ROOT_PATH))

# The adaptabuild path MUST be at the root level
#
ADAPTABUILD_PATH := $(ROOT_PATH)/adaptabuild

LOG_ERROR ?=
LOG_WARNING ?=
LOG_NOTICE ?= x
LOG_INFO ?=
LOG_DEBUG ?= x

# Add any top level definitions for adaptabuild here:
#
GCC_VERSION := 10.3.1

include $(ADAPTABUILD_PATH)/make/adaptabuild.mak
14 changes: 14 additions & 0 deletions adaptabuild/adaptabuild_artifacts.mak
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# ----------------------------------------------------------------------------
# adaptabuild_artifacts.mak - product specific libraries file
#
# Here is where you specify the libraries or other artifacts your product
# needs to have built.
# ----------------------------------------------------------------------------

ifeq (host,$(MCU))
# Do nothing - we want the standard library for host builds
else
# Do nothing
endif

include $(SRC_PATH)/umm_malloc/adaptabuild.mak
16 changes: 16 additions & 0 deletions adaptabuild/adaptabuild_product.mak
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# ----------------------------------------------------------------------------
# adaptabuild_product.mak - product specific include file
#
# Here is where you specify your product options
# ----------------------------------------------------------------------------

PRODUCT_LIST := unittest

ifneq ($(filter $(PRODUCT),$(PRODUCT_LIST)),)
# Set PRODUCT_MAIN here based on $(PRODUCT)
# The unittest product typically does not need PRODUCT_MAIN
else
$(error PRODUCT must be one of $(PRODUCT_LIST))
endif


1 change: 0 additions & 1 deletion ceedling.cmd

This file was deleted.

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
99 changes: 0 additions & 99 deletions project.yml

This file was deleted.

11 changes: 0 additions & 11 deletions test/options/default.yml

This file was deleted.

12 changes: 0 additions & 12 deletions test/options/enable_critical_depth_check.yml

This file was deleted.

12 changes: 0 additions & 12 deletions test/options/enable_info.yml

This file was deleted.

12 changes: 0 additions & 12 deletions test/options/enable_inline_metrics.yml

This file was deleted.

Loading