Commit graph

1054 commits

Author SHA1 Message Date
Ravishankar Bhagavandas
e39c34ba7e
Adding unit tests for stream buffer and message buffer (#528)
* Initial commit

* Add more stream buffer tests

* Adding message buffer tests

* Adding tests to cover config assert branches

Co-authored-by: alfred gedeon <28123637+alfred2g@users.noreply.github.com>
2021-03-30 12:56:02 -07:00
Paul Bartell
7020db5403
Force a branch in the definition of configASSERT in the default CMock FreeRTOSConfig.h file (#538)
* Force a branch in the definition of configASSERT in the default CMock FreeRTOSConfig.h file
* Run uncrustify on FreeRTOSConfig.h
2021-03-24 13:08:15 -07:00
Paul Bartell
92aca6e910
Collect initial coverage data so that untagged functions are still included in the lcov report (#537)
Collect initial coverage data with lcov --initial and add this to coverage data to the combined coverage from each test binary.
This ensures that all functions in the target file(s) are included in coverage statistics, even if those functions are not tagged in a _utest.c file.
Note: Functions which are excluded by the preprocessor will not have initial coverage data generated for them.
2021-03-23 18:41:14 -07:00
Paul Bartell
3a48781a03 Skip filtering of coverage if no @coverage tags are found in a _utest.c file 2021-03-22 14:58:52 -07:00
Cobus van Eeden
26478d721f
Add message buffer space available coherency test (#515)
* Introduce tasks that test the coherency of the reported space available in a message buffer from two separate tasks.  Designed to highlight the issue reported in https://github.com/FreeRTOS/FreeRTOS-Kernel/pull/264
Introduce configRUN_ADDITIONAL_TESTS which must be set to 1 to run the new tests.  That is because the new tests got added to an existing standard demo file and smaller platforms may not have the resources to run them.
Set configRUN_ADDITIONAL_TESTS to 1 in the MSVC and IAR/QEMU project so both project run the new test.
Also add missing 'volatile' qualifier in the IAR/QEMU project on some register accesses.

* Update xAreMessageBufferTasksStillRunning() to report errors from the new message buffer size coherency tests.

Co-authored-by: RichardBarry <ribarry@amazon.com>
Co-authored-by: RichardBarry <3073890+RichardBarry@users.noreply.github.com>
2021-03-20 11:50:16 -07:00
Paul Bartell
f39765be22
Kernel UT: Enable preprocessor when running cflow in callgraph.py (#530)
* Add INCLUDE_DIR to the commandline call to cflow in callgraph.py

This removes dependent functions from the list when they are disabled in the FreeRTOS config.

* Add argparse to callgraph.py so that no output file is created on failure.
2021-03-19 17:30:20 -07:00
newbs
270474aed4
Update serial.c for latest microchip DFP (1.6.88 from 1.1.40) (#517)
Update line 58 to make compatible with Microchip DFP 1.6.88


Co-authored-by: Joshua Yan <52796499+yanjos-dev@users.noreply.github.com>
2021-03-18 10:58:15 -07:00
newbs
ee1940bdb9
update configurations.xml to use the latest Microchip AVR DFP 1.6.88 (#518) 2021-03-16 17:16:21 -07:00
Paul Bartell
6257160ee6
Make the address sanitizer optional for CMock kernel unit tests (#526)
* Make the address sanitizer optional

The address sanitizer is now disabled by default for CMock tests because it introduces additional branches into the compiled code. When make is run with the ENABLE_SANITIZER=1 argument, the address sanitizer is enabled and coverage data may not be accurate.

* Change from ifdef to ifeq ($(ENABLE_SANITIZER),1) to address PR comment
2021-03-16 13:55:01 -07:00
alfred gedeon
cbc96ff596
Demo: remove commented code, and unused macros (#525) 2021-03-16 09:52:47 -07:00
Paul Bartell
d7e5f40885
Clean up CMock makefiles and add coverage filtering (#523)
* Cleanup Makefiles

* Add lcovrc configuration file

* Add CMock test build directory to .gitignore

* Add callgraph.py and filtercov.py scripts

* Cleanup list Makefile and update list_utest.c with coverage tags

* Add information about coverage filtering and running single test cases

* Remove -fprofile-exclude-files for compatibility with older versions of gcc.
Fix line endings (change to unix style)

* Lint callgraph.py and filtercov.py. Print and error when no target functions are defined.

* Indent with spaces when possible

* Replace tabs with spaces and enable .RECIPEPREFIX

* Add fake_port.h and related portmacro.h changes

* Fix list makefile when bin directory is not available

* Clean up grouped rules

* Update makesfile.. Add "two_tests" example dir

* Fix memory checker error

* Move common makefile items to subdir.mk and testdir.mk includes

* Update core_checker.py exclusions

* Remove line from portmacro.h that doesn't match core_checker.py
2021-03-15 17:01:29 -07:00
Nathan Chong
5309372245
Minor VeriFast proof changes to match V10.4.3 (#519)
* Minor changes for V10.4.3

* Update license
2021-02-25 14:00:22 -07:00
Carl Lundin
47052bc054
Correct FreeRTOS.org link in main_full.c for: (#510)
* FreeRTOS/Demo/CORTEX_M3_MPS2_QEMU_GCC/main_full.c
* FreeRTOS/Demo/Posix_GCC/main_full.c
2021-02-22 10:37:23 -08:00
RichardBarry
2e4485a0d6
Create Cortex-M3 QEMU project for testing with the IAR compiler (#503)
* Initial version of the CORTEX_MPS2_QEMU_IAR - needs tidying up and so far only contains the comprehensive demo.

* Update the comment block at the top of the source files to match the latest official release.

* Split out the main_full() demo from main().  Still need to add in the main_blinky() demo.

* Add the blinky demo option.

* Tidy up the QEMU/IAR project.

* Configure the QEMU IAR project to only create the blinky demo.

* Delete readme.txt which was in the wrong directory.

* Fix errors in the comments at the top of the file as highlighted by the auto checks.

Co-authored-by: alfred gedeon <28123637+alfred2g@users.noreply.github.com>
2021-02-19 12:19:23 -08:00
Paul Bartell
570ae6bb52
Add unity memory extension, fake_assert, and enable -fsanitize=address (#506)
* Enable libunitymemory extension to track dynamic memory usage during unit tests
* Use UnityMemory in timers_utest.c
* Add fake_assert.h to allow mocking of configASSERT calls
* Add .editorconfig to make github show indentation correctly
* Add unity memory and fake_assert to queue_utest.c
* Add -fsanitize=address CFLAG when running unit tests
* Define mtCOVERAGE_TEST_MARKER macro to include mtCOVERAGE_TEST_MARKER lines in coverage figures
* Add additional memory check / protection CFLAGS for CMock tests
* Fix out of bounds array access in list_utest.c
* Move the fake_assert.h include to the top of FreeRTOSConfig.h
2021-02-18 10:15:01 -08:00
alfred gedeon
c4d8002634
Generate JUnit style report for kernel unit test (#504)
* Add JUnit test report to ut
* Add JUnit test report with make run
* Fix gcc path
2021-02-15 14:09:24 -08:00
David Chalco
63aec3607d
Unit Test/timer[0] (#502)
* define CC/LD iff undef. Add timers suite

* timers_utest[0]
2021-02-14 11:24:55 -08:00
Carl Lundin
f6dff3fea3
Add Litani to run CBMC proofs (#501)
Update to out of source makefile build and add run-cbmc-proofs.py

CBMC proofs can now be run with Litani with the command
"./run-cbmc-proofs.py"

Based on commits:
* 1646301 - Ignore CBMC proof failures, fail the build later (4 months ago) <Kareem Khazem>
* 7e8c91a - Fix Makefile prerequisite symbol for CBMC proofs (4 months ago) <Kareem Khazem>
* bee04be - Enable CBMC proofs to run in CI (4 months ago) <Kareem Khazem>

Found in https://github.com/FreeRTOS/FreeRTOS-Plus-TCP
2021-02-12 10:21:07 -08:00
alfred gedeon
cd92c42b52
Kernel list.c Unit Test (#497)
* Test: List.c Unit Test

* Test: test list.h macros

* Test: Fix UT bug

* Remove unecessary statement from Makefile

* Update list_utest.c

* Update list_utest.c

Co-authored-by: Cobus van Eeden <35851496+cobusve@users.noreply.github.com>
2021-02-11 18:10:49 -08:00
alfred gedeon
c4839ecda3
Comment: Remove tcp echo client from the comments (#500) 2021-02-11 14:56:11 -08:00
alfred gedeon
9b9011917a
Add Kernel Unit Tests Environment (#494)
* Implement Kernel Unit Test Framework with CMock

* Add Readme.md to unit tests

* Add Posix build checker to git actions

* Add Ruby requirement

* Fix file header checks

* Fix header checks

* Add color output to test runs
2021-02-08 15:26:01 -08:00
alfred gedeon
47d37354bc
Add Posix build checker to git actions (#489)
* Add Posix build checker to git actions

* fix checker path

* Fix script, checkout recursively

* fix build check script return value

* clone submodules as well with posix checker

* Add quotes to true for submodules

* Fix Submodules

* Remove pcap dependency from Makefile

* install libpcap for build check

* Add networking build to posix

* Separate network build from normal build

* add libpcap after building normal posix
2021-01-12 20:13:29 -08:00
alfred gedeon
36fd2c8d8c
Update Kernel submodule (#488) 2021-01-09 14:54:47 -08:00
Cobus van Eeden
3781cd9224
Add build dependency (#486) 2020-12-24 09:39:54 -08:00
Cobus van Eeden
68a500bca3
Initial vscode debug configuration (#485) 2020-12-23 19:55:09 -08:00
alfred gedeon
1c99d9f200
Prevent optimization in reset handler for QEMU MPS2 (#484) 2020-12-22 22:39:33 -08:00
Cobus van Eeden
28548e06fe
Update Readme.md 2020-12-20 17:29:32 -08:00
Alfred Gedeon
1f9389c7c4 Fix: Qemu MPS2 Demo build failure 2020-12-20 17:02:32 -08:00
alfred gedeon
208b260f98
Add Full Demo to Qemu mps2 (#481)
* Add Full Demo to Qemu with MPS2

* Increase full demo heap memory

* Add Full Demo to Qemu MPS2

* Fix headers

* Fix header FreeRTOS version

* Remove commented line

* Remove commented line

* Fix header checker version, and corresponding files

* Fix checker version number requirements
2020-12-17 13:05:36 -08:00
Joseph Julicher
da9b9a800d [AUTO][RELEASE]: Bump file header version to "202012.00" 2020-12-15 11:50:37 -07:00
Joseph Julicher
45ba920ad0 [AUTO][RELEASE]: Bump submodules per manifest.yml for V202012.00 2020-12-15 10:22:10 -07:00
Joseph Julicher
2e2ba99a74 [AUTO][RELEASE]: Bump file header version to "202012.00" 2020-12-15 10:20:29 -07:00
Joseph Julicher
66b75ba527
History and manifest updates (#480) 2020-12-15 08:42:06 -07:00
Carl Lundin
b035e0321f
Re-add missing license files caused by PR #471 and fix patches (#477)
* Re-add missing license files caused by PR #471.
* Fix proof patch.
2020-12-14 17:35:36 -08:00
Cobus van Eeden
1caa60d382
Move kernel submodule to latest (#474) 2020-12-13 18:47:18 -08:00
Carl Lundin
cf39a90d6d
Fix CBMC patches. (#471)
* Fix CBMC patches.
2020-12-12 21:00:03 -08:00
Gaurav-Aggarwal-AWS
adbc27f11d
Fix build failure in STM32 Discovery MPU Projects (#449)
* Fix build failure in STM32 Discovery MPU Projects

Privileged data region size needs to be increased because heap is now
placed in this region.

Signed-off-by: Gaurav Aggarwal <aggarg@amazon.com>
2020-12-12 16:33:00 -08:00
alfred gedeon
41237e01d0
Split networking from posix and qemu mps2 demos (#455)
Split networking from posix and qemu mps2 demos
2020-12-12 16:29:23 -08:00
RichardBarry
a503a3a7a0
Add links to the MQTT agent in the non-agent mqtt demos (#470)
Add URL file links to the MQTT agent documentation page.
Add comment blocks into each demo that also point toward the MQTT agent documentation to ensure users are aware the agent method exists.
2020-12-11 21:12:44 -08:00
Ming Yue
639c08ce2a
Remove uIP TCP/IP stack and related demos (#467)
* Remove uIP TCP/IP stack.

* Remove demos that uses uIP.

* Update Demo ReadMe.txt files.
2020-12-11 15:49:56 -08:00
Pascal
d264c1f153
Moved definition of ucBufferStorage out of if macro. (#459)
* Moved definition of ucBufferStorage out of if macro. If ucBufferStorage is only defined when configSUPPORT_STATIC_ALLOCATION ist set to 1, compilation will fail in cases where it is set to 0 or not defined (because it defaults to 0, as described in the documenation).
2020-12-10 20:44:54 -08:00
Ming Yue
9d937aa0ab
Remove duplicate WinBase.h and Windows.h. (#458) 2020-12-09 13:40:20 -08:00
Cobus van Eeden
c6f4284b76
Update kernel submodule pointer to version 47338393f (#456)
* Update kernel submodule pointer to version 47338393f

* Fix patches.

Co-authored-by: Carl Lundin <lundinc@amazon.com>
2020-12-08 15:44:14 -08:00
alfred gedeon
0698f83c3b
Update Kernel head (#444) 2020-12-04 19:13:57 -08:00
alfred gedeon
b7b9ccb099
Qemu mps2 networking (#439)
* Demo: Add Support for netwroking in Qemu for MPS2 AN385
* Add tcp echo client
* Add steps to Readme
2020-12-03 23:44:57 -08:00
Katsuhiro Suzuki
f06330768f
Add Makefile project for RISC-V QEMU virtpc (#266)
* Add Makefile project for RISC-V QEMU virtpc

This patch adds simple demo directory for QEMU virtpc machine.
A demo just prints Tx/Rx message of queue to serial port, use no
other hardware and use only primary core (currently hart0).
Other cores are simply going to wfi state and execute nothing else.

Example command is:
  qemu-system-riscv32 -nographic -machine virt -net none \
    -chardev stdio,id=con,mux=on -serial chardev:con \
    -mon chardev=con,mode=readline -bios none \
    -kernel demo.elf -smp cpus=2 -s

* Fix copyright and URLS of FreeRTOS

* Fix Makefile

* Add Readme.md

* Separate blinky demo from main code

Co-authored-by: alfred gedeon <alfred2g@hotmail.com>
Co-authored-by: Cobus van Eeden <35851496+cobusve@users.noreply.github.com>
Co-authored-by: Carl Lundin <53273776+lundinc2@users.noreply.github.com>
2020-11-11 15:35:21 -08:00
David Chalco
de26f7f2f4 [AUTO][RELEASE]: Bump kernel pointer "V10.4.2" 2020-11-10 14:46:44 -08:00
David Chalco
07f3cbafee [AUTO][RELEASE]: Bump file header version to "202011.00" 2020-11-10 14:45:34 -08:00
David Chalco
9939374379
Update History.txt for 202011.00 (#388) 2020-11-10 08:57:07 -08:00
Carl Lundin
21bbf3ea46
Move kernel submodule forward. (#377)
Co-authored-by: Cobus van Eeden <35851496+cobusve@users.noreply.github.com>
2020-11-03 15:12:28 -08:00