Skip to content

Commit 4b50ca2

Browse files
committed
add missing ceedling files
1 parent 91d5fa5 commit 4b50ca2

File tree

23 files changed

+1909
-0
lines changed

23 files changed

+1909
-0
lines changed
Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
ceedling-bullseye
2+
=================
3+
4+
# Plugin Overview
5+
6+
Plugin for integrating Bullseye code coverage tool into Ceedling projects.
7+
This plugin requires a working license to Bullseye code coverage tools. The tools
8+
must be within the path or the path should be added to the environment in the
9+
`project.yml file`.
10+
11+
## Configuration
12+
13+
The bullseye plugin supports configuration options via your `project.yml` provided
14+
by Ceedling. The following is a typical configuration example:
15+
16+
```
17+
:bullseye:
18+
:auto_license: TRUE
19+
:plugins:
20+
:bullseye_lib_path: []
21+
:paths:
22+
:bullseye_toolchain_include: []
23+
24+
:tools:
25+
:bullseye_instrumentation:
26+
:executable: covc
27+
:arguments:
28+
- '--file $': ENVIRONMENT_COVFILE
29+
- -q
30+
- ${1}
31+
:bullseye_compiler:
32+
:executable: gcc
33+
:arguments:
34+
- -g
35+
- -I"$": COLLECTION_PATHS_TEST_SUPPORT_SOURCE_INCLUDE_VENDOR
36+
- -I"$": COLLECTION_PATHS_BULLSEYE_TOOLCHAIN_INCLUDE
37+
- -D$: COLLECTION_DEFINES_TEST_AND_VENDOR
38+
- -DBULLSEYE_COMPILER
39+
- -c "${1}"
40+
- -o "${2}"
41+
:bullseye_linker:
42+
:executable: gcc
43+
:arguments:
44+
- ${1}
45+
- -o ${2}
46+
- -L$: PLUGINS_BULLSEYE_LIB_PATH
47+
- -lcov
48+
:bullseye_fixture:
49+
:executable: ${1}
50+
:bullseye_report_covsrc:
51+
:executable: covsrc
52+
:arguments:
53+
- '--file $': ENVIRONMENT_COVFILE
54+
- -q
55+
- -w140
56+
:bullseye_report_covfn:
57+
:executable: covfn
58+
:stderr_redirect: :auto
59+
:arguments:
60+
- '--file $': ENVIRONMENT_COVFILE
61+
- --width 120
62+
- --no-source
63+
- '"${1}"'
64+
:bullseye_browser:
65+
:executable: CoverageBrowser
66+
:background_exec: :auto
67+
:optional: TRUE
68+
:arguments:
69+
- '"$"': ENVIRONMENT_COVFILE
70+
```
71+
72+
## Example Usage
73+
74+
```sh
75+
ceedling bullseye:all utils:bullseye
76+
```
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
ceedling-colour-report
2+
======================
3+
4+
## Overview
5+
6+
The colour_report replaces the normal ceedling "pretty" output with
7+
a colorized variant, in order to make the results easier to read from
8+
a standard command line. This is very useful on developer machines, but
9+
can occasionally cause problems with parsing on CI servers.
10+
11+
## Setup
12+
13+
Enable the plugin in your project.yml by adding `colour_report`
14+
to the list of enabled plugins.
15+
16+
``` YAML
17+
:plugins:
18+
:enabled:
19+
- colour_report
20+
```
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
compile_commands_json
2+
=====================
3+
4+
## Overview
5+
6+
Syntax highlighting and code completion are hard. Historically each editor or IDE has implemented their own and then competed amongst themselves to offer the best experience for developers. Often developers would still to an IDE that felt cumbersome and slow just because it had the best syntax highlighting on the market. If doing it for one language is hard (and it is) imagine doing it for dozens of them. Imagine a full stack developer who has to work with CSS, HTML, JavaScript and some Ruby - they need excellent support in all those languages which just made things even harder.
7+
8+
In June of 2016, Microsoft with Red Hat and Codenvy got together to create a standard called the Language Server Protocol (LSP). The idea was simple, by standardising on one protocol, all the IDEs and editors out there would only have to support LSP, and not have custom plugins for each language. In turn, the backend code that actually does the highlighting can be written once and used by any IDE that supports LSP. Many editors already support it such as Sublime Text, vim and emacs. This means that if you're using a crufty old IDE or worse, you're using a shiny new editor without code completion, then this could be just the upgrade you're looking for!
9+
10+
For C and C++ projects, many people use the `clangd` backend. So that it can do things like "go to definition", `clangd` needs to know how to build the project so that it can figure out all the pieces to the puzzle. There are manual tools such as `bear` which can be run with `gcc` or `clang` to extract this information it has a big limitation in that if run with `ceedling release` you won't get any auto completion for Unity and you'll also get error messages reported by your IDE because of what it perceives as missing headers. If you do the same with `ceedling test` now you get Unity but you might miss things that are only seen in the release build.
11+
12+
This plugin resolves that issue. As it is run by Ceedling, it has access to all the build information it needs to create the perfect `compile_commands.json`. Once enabled, this plugin will generate that file and place it in `./build/artifacts/compile_commands.json`. `clangd` will search your project for this file, but it is easier to symlink it into the root directory (for example `ln -s ./build/artifacts/compile_commands.json`.
13+
14+
For more information on LSP and to find out if your editor supports it, check out https://langserver.org/
15+
16+
## Setup
17+
18+
Enable the plugin in your project.yml by adding `compile_commands_json` to the list
19+
of enabled plugins.
20+
21+
``` YAML
22+
:plugins:
23+
:enabled:
24+
- compile_commands_json
25+
```
26+
27+
## Configuration
28+
29+
There is no additional configuration necessary to run this plugin.
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
require 'ceedling/plugin'
2+
require 'ceedling/constants'
3+
require 'json'
4+
5+
class CompileCommandsJson < Plugin
6+
def setup
7+
@fullpath = File.join(PROJECT_BUILD_ARTIFACTS_ROOT, "compile_commands.json")
8+
@database = if (File.exists?(@fullpath))
9+
JSON.parse( File.read(@fullpath) )
10+
else
11+
[]
12+
end
13+
end
14+
15+
def post_compile_execute(arg_hash)
16+
17+
# Create the new Entry
18+
value = {
19+
"directory" => Dir.pwd,
20+
"command" => arg_hash[:shell_command],
21+
"file" => arg_hash[:source]
22+
}
23+
24+
# Determine if we're updating an existing file description or adding a new one
25+
index = @database.index {|h| h["file"] == arg_hash[:source]}
26+
if index
27+
@database[index] = value
28+
else
29+
@database << value
30+
end
31+
32+
# Update the Actual compile_commands.json file
33+
File.open(@fullpath,'w') {|f| f << JSON.pretty_generate(@database)}
34+
end
35+
end

0 commit comments

Comments
 (0)