spl-core 4.0.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- spl_core/__init__.py +1 -0
- spl_core/common/__init__.py +0 -0
- spl_core/common/cmake.py +52 -0
- spl_core/common/path.py +17 -0
- spl_core/gcov_maid/__init__.py +0 -0
- spl_core/gcov_maid/gcov_maid.py +48 -0
- spl_core/kconfig/__init__.py +0 -0
- spl_core/kconfig/kconfig.py +271 -0
- spl_core/project_creator/__init__.py +0 -0
- spl_core/project_creator/creator.py +133 -0
- spl_core/project_creator/templates/project/cookiecutter.json +14 -0
- spl_core/project_creator/templates/project/{{cookiecutter.name}}/.flake8 +2 -0
- spl_core/project_creator/templates/project/{{cookiecutter.name}}/.gitignore +33 -0
- spl_core/project_creator/templates/project/{{cookiecutter.name}}/.vscode/cmake-kits.json +11 -0
- spl_core/project_creator/templates/project/{{cookiecutter.name}}/.vscode/cmake-variants.json +18 -0
- spl_core/project_creator/templates/project/{{cookiecutter.name}}/.vscode/extensions.json +18 -0
- spl_core/project_creator/templates/project/{{cookiecutter.name}}/.vscode/launch.json +37 -0
- spl_core/project_creator/templates/project/{{cookiecutter.name}}/.vscode/settings.json +45 -0
- spl_core/project_creator/templates/project/{{cookiecutter.name}}/.vscode/tasks.json +93 -0
- spl_core/project_creator/templates/project/{{cookiecutter.name}}/CMakeLists.txt +43 -0
- spl_core/project_creator/templates/project/{{cookiecutter.name}}/KConfig +23 -0
- spl_core/project_creator/templates/project/{{cookiecutter.name}}/LICENSE +21 -0
- spl_core/project_creator/templates/project/{{cookiecutter.name}}/Pipfile +33 -0
- spl_core/project_creator/templates/project/{{cookiecutter.name}}/README.md +7 -0
- spl_core/project_creator/templates/project/{{cookiecutter.name}}/build.bat +1 -0
- spl_core/project_creator/templates/project/{{cookiecutter.name}}/build.ps1 +245 -0
- spl_core/project_creator/templates/project/{{cookiecutter.name}}/conf.py +200 -0
- spl_core/project_creator/templates/project/{{cookiecutter.name}}/doc/Doxyfile.in +2774 -0
- spl_core/project_creator/templates/project/{{cookiecutter.name}}/doc/common/index.rst +5 -0
- spl_core/project_creator/templates/project/{{cookiecutter.name}}/doc/components/index.rst +23 -0
- spl_core/project_creator/templates/project/{{cookiecutter.name}}/doc/doxygen-awesome/LICENSE +21 -0
- spl_core/project_creator/templates/project/{{cookiecutter.name}}/doc/doxygen-awesome/doxygen-awesome.css +2530 -0
- spl_core/project_creator/templates/project/{{cookiecutter.name}}/doc/software_architecture/index.rst +2 -0
- spl_core/project_creator/templates/project/{{cookiecutter.name}}/doc/software_requirements/index.rst +7 -0
- spl_core/project_creator/templates/project/{{cookiecutter.name}}/doc/test_report_template.txt +46 -0
- spl_core/project_creator/templates/project/{{cookiecutter.name}}/index.rst +38 -0
- spl_core/project_creator/templates/project/{{cookiecutter.name}}/install-mandatory.bat +1 -0
- spl_core/project_creator/templates/project/{{cookiecutter.name}}/pytest.ini +9 -0
- spl_core/project_creator/templates/project/{{cookiecutter.name}}/scoopfile.json +47 -0
- spl_core/project_creator/templates/project/{{cookiecutter.name}}/test/test_build.py +39 -0
- spl_core/project_creator/templates/project/{{cookiecutter.name}}/test/test_unittests.py +28 -0
- spl_core/project_creator/templates/project/{{cookiecutter.name}}/test/utils.py +26 -0
- spl_core/project_creator/templates/project/{{cookiecutter.name}}/tools/setup/git-config.ps1 +8 -0
- spl_core/project_creator/templates/project/{{cookiecutter.name}}/{% if cookiecutter.touch_components -%} components {%- endif %}/component/CMakeLists.txt +3 -0
- spl_core/project_creator/templates/project/{{cookiecutter.name}}/{% if cookiecutter.touch_components -%} components {%- endif %}/component/doc/_images/screenshot.png +0 -0
- spl_core/project_creator/templates/project/{{cookiecutter.name}}/{% if cookiecutter.touch_components -%} components {%- endif %}/component/doc/design.rst +25 -0
- spl_core/project_creator/templates/project/{{cookiecutter.name}}/{% if cookiecutter.touch_components -%} components {%- endif %}/component/doc/index.rst +8 -0
- spl_core/project_creator/templates/project/{{cookiecutter.name}}/{% if cookiecutter.touch_components -%} components {%- endif %}/component/src/component.c +31 -0
- spl_core/project_creator/templates/project/{{cookiecutter.name}}/{% if cookiecutter.touch_components -%} components {%- endif %}/component/src/component.h +1 -0
- spl_core/project_creator/templates/project/{{cookiecutter.name}}/{% if cookiecutter.touch_components -%} components {%- endif %}/component/test/test_component.cc +60 -0
- spl_core/project_creator/templates/project/{{cookiecutter.name}}/{% if cookiecutter.touch_components -%} components {%- endif %}/main/CMakeLists.txt +2 -0
- spl_core/project_creator/templates/project/{{cookiecutter.name}}/{% if cookiecutter.touch_components -%} components {%- endif %}/main/doc/index.rst +14 -0
- spl_core/project_creator/templates/project/{{cookiecutter.name}}/{% if cookiecutter.touch_components -%} components {%- endif %}/main/src/main.c +17 -0
- spl_core/project_creator/templates/project/{{cookiecutter.name}}/{% if cookiecutter.touch_tools -%} tools {%- endif %}/toolchains/clang/toolchain.cmake +8 -0
- spl_core/project_creator/templates/project/{{cookiecutter.name}}/{% if cookiecutter.touch_tools -%} tools {%- endif %}/toolchains/gcc/toolchain.cmake +3 -0
- spl_core/project_creator/templates/variant/cookiecutter.json +4 -0
- spl_core/project_creator/templates/variant/{{cookiecutter.flavor}}/{{cookiecutter.subsystem}}/config.cmake +1 -0
- spl_core/project_creator/templates/variant/{{cookiecutter.flavor}}/{{cookiecutter.subsystem}}/config.txt +1 -0
- spl_core/project_creator/templates/variant/{{cookiecutter.flavor}}/{{cookiecutter.subsystem}}/parts.cmake +2 -0
- spl_core/project_creator/variant.py +23 -0
- spl_core/project_creator/workspace_artifacts.py +36 -0
- spl_core-4.0.0.dist-info/LICENSE +22 -0
- spl_core-4.0.0.dist-info/METADATA +62 -0
- spl_core-4.0.0.dist-info/RECORD +65 -0
- spl_core-4.0.0.dist-info/WHEEL +4 -0
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
Passed test cases
|
|
2
|
+
-----------------
|
|
3
|
+
|
|
4
|
+
.. needtable::
|
|
5
|
+
:filter: '{id}' in tags and type == '{case_need}' and 'passed' == result
|
|
6
|
+
:columns: id, title, is resulted from
|
|
7
|
+
:style: table
|
|
8
|
+
|
|
9
|
+
Failed test cases
|
|
10
|
+
-----------------
|
|
11
|
+
|
|
12
|
+
.. needtable::
|
|
13
|
+
:filter: '{id}' in tags and type == '{case_need}' and 'failure' == result
|
|
14
|
+
:columns: id, title, is resulted from
|
|
15
|
+
:style: table
|
|
16
|
+
|
|
17
|
+
Skipped test cases
|
|
18
|
+
------------------
|
|
19
|
+
|
|
20
|
+
.. needtable::
|
|
21
|
+
:filter: '{id}' in tags and type == '{case_need}' and 'skipped' == result
|
|
22
|
+
:columns: id, title, is resulted from
|
|
23
|
+
:style: table
|
|
24
|
+
|
|
25
|
+
Statistics
|
|
26
|
+
----------
|
|
27
|
+
|
|
28
|
+
| Test cases: :need_count:`'{id}' in tags and type=='{case_need}'`
|
|
29
|
+
| Failed test cases: :need_count:`'{id}' in tags and 'failure' == result and type=='{case_need}'`
|
|
30
|
+
| Passed test cases: :need_count:`'{id}' in tags and 'passed' == result and type=='{case_need}'`
|
|
31
|
+
| Skipped test cases: :need_count:`'{id}' in tags and 'skipped' == result and type=='{case_need}'`
|
|
32
|
+
| Test suites: :need_count:`'{id}' in tags and type=='{suite_need}'`
|
|
33
|
+
|
|
34
|
+
Details
|
|
35
|
+
-------
|
|
36
|
+
|
|
37
|
+
.. {file_type}:: {title}
|
|
38
|
+
:id: {id}{links_string}
|
|
39
|
+
:tags: {tags}
|
|
40
|
+
:file: {file}
|
|
41
|
+
:auto_suites:
|
|
42
|
+
:auto_cases:
|
|
43
|
+
|
|
44
|
+
{content}
|
|
45
|
+
|
|
46
|
+
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
{% if build_config.component_info %}
|
|
2
|
+
|
|
3
|
+
Software Component Report
|
|
4
|
+
#########################
|
|
5
|
+
|
|
6
|
+
| **Variant:** {{ build_config.variant }}
|
|
7
|
+
| **Component:** {{ build_config.component_info.long_name }}
|
|
8
|
+
|
|
9
|
+
.. toctree::
|
|
10
|
+
:maxdepth: 2
|
|
11
|
+
|
|
12
|
+
{{ build_config.component_info.path }}/doc/index
|
|
13
|
+
{% if build_config.component_info.has_reports %}
|
|
14
|
+
{{ build_config.component_info.reports_output_dir }}/unit_test_spec
|
|
15
|
+
{{ build_config.component_info.reports_output_dir }}/unit_test_results
|
|
16
|
+
{{ build_config.component_info.reports_output_dir }}/doxygen/html/index
|
|
17
|
+
{{ build_config.component_info.reports_output_dir }}/coverage
|
|
18
|
+
{% endif %}
|
|
19
|
+
|
|
20
|
+
{% else %}
|
|
21
|
+
|
|
22
|
+
Variant Report
|
|
23
|
+
##############
|
|
24
|
+
|
|
25
|
+
**Variant:** {{ build_config.variant }}
|
|
26
|
+
|
|
27
|
+
.. toctree::
|
|
28
|
+
:maxdepth: 1
|
|
29
|
+
:caption: Contents
|
|
30
|
+
|
|
31
|
+
doc/software_requirements/index
|
|
32
|
+
doc/software_architecture/index
|
|
33
|
+
doc/components/index
|
|
34
|
+
{% if build_config.target == 'reports' %}
|
|
35
|
+
{{ build_config.reports_output_dir }}/coverage
|
|
36
|
+
{% endif %}
|
|
37
|
+
|
|
38
|
+
{% endif %}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
call %~dp0build.bat -install %* || exit /b 1
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
{
|
|
2
|
+
"buckets": [
|
|
3
|
+
{
|
|
4
|
+
"Name": "main",
|
|
5
|
+
"Source": "https://github.com/ScoopInstaller/Main"
|
|
6
|
+
},
|
|
7
|
+
{
|
|
8
|
+
"Name": "extras",
|
|
9
|
+
"Source": "https://github.com/ScoopInstaller/Extras"
|
|
10
|
+
},
|
|
11
|
+
{
|
|
12
|
+
"Name": "versions",
|
|
13
|
+
"Source": "https://github.com/ScoopInstaller/Versions"
|
|
14
|
+
}
|
|
15
|
+
],
|
|
16
|
+
"apps": [
|
|
17
|
+
{
|
|
18
|
+
"Source": "main",
|
|
19
|
+
"Name": "lessmsi"
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
"Source": "main",
|
|
23
|
+
"Name": "7zip"
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
"Source": "main",
|
|
27
|
+
"Name": "innounp"
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
"Source": "main",
|
|
31
|
+
"Name": "dark"
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
"Source": "main",
|
|
35
|
+
"Name": "graphviz"
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
"Source": "versions",
|
|
39
|
+
"Name": "python311"
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
"Source": "versions",
|
|
43
|
+
"Name": "mingw-winlibs-llvm-ucrt",
|
|
44
|
+
"Version": "13.2.0-16.0.6-11.0.0-r1"
|
|
45
|
+
}
|
|
46
|
+
]
|
|
47
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
|
|
3
|
+
import unittest
|
|
4
|
+
import os.path
|
|
5
|
+
from pathlib import Path
|
|
6
|
+
from utils import run_process
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
class TestBuild(unittest.TestCase):
|
|
10
|
+
{% for variant in cookiecutter.variants.values() %}
|
|
11
|
+
def test_build_{{ variant["flavor"] }}__{{ variant["subsystem"] }}(self):
|
|
12
|
+
variant = '{{ variant["flavor"] }}/{{ variant["subsystem"] }}'
|
|
13
|
+
self.build_and_expect_default(variant)
|
|
14
|
+
{% endfor %}
|
|
15
|
+
def build_and_expect_default(self, variant, target='all'):
|
|
16
|
+
"""build wrapper shall build the default target and related outputs."""
|
|
17
|
+
|
|
18
|
+
exit_code = run_process([
|
|
19
|
+
'build.bat',
|
|
20
|
+
'-variants', variant,
|
|
21
|
+
'-target', target,
|
|
22
|
+
'-reconfigure'
|
|
23
|
+
])
|
|
24
|
+
|
|
25
|
+
self.assertEqual(0, exit_code)
|
|
26
|
+
self.expect_binary(variant, file_name="my_main.exe")
|
|
27
|
+
|
|
28
|
+
def expect_binary(self, variant, bin_type='elf', suffix='', file_name=''):
|
|
29
|
+
"""Hex file of given configuration shall exist."""
|
|
30
|
+
self.assert_expected_file_exists(self.get_artifact_name(variant, bin_type, suffix, file_name))
|
|
31
|
+
|
|
32
|
+
def assert_expected_file_exists(self, expected_file):
|
|
33
|
+
self.assertTrue(os.path.isfile(expected_file), f"File {expected_file} shall exist.")
|
|
34
|
+
|
|
35
|
+
@staticmethod
|
|
36
|
+
def get_artifact_name(variant, bin_type='elf', suffix='', file_name='') -> Path:
|
|
37
|
+
"""Hex file of given configuration shall exist."""
|
|
38
|
+
file = file_name if file_name else f"{variant.replace('/', '_')}{suffix}.{bin_type}"
|
|
39
|
+
return Path(f"build/{variant}/prod/{file}")
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
|
|
3
|
+
import unittest
|
|
4
|
+
import os.path
|
|
5
|
+
import json
|
|
6
|
+
from utils import run_process
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
class TestUnitTests(unittest.TestCase):
|
|
10
|
+
{% for variant in cookiecutter.variants.values() %}
|
|
11
|
+
def test_unit_tests_{{ variant["flavor"] }}__{{ variant["subsystem"] }}(self):
|
|
12
|
+
variant = '{{ variant["flavor"] }}/{{ variant["subsystem"] }}'
|
|
13
|
+
self.build_unittests_and_expect_files(variant)
|
|
14
|
+
{% endfor %}
|
|
15
|
+
def build_unittests_and_expect_files(self, variant):
|
|
16
|
+
exit_code = run_process([
|
|
17
|
+
'build.bat',
|
|
18
|
+
'-variants', variant,
|
|
19
|
+
'-target', 'unittests',
|
|
20
|
+
'-reconfigure'
|
|
21
|
+
])
|
|
22
|
+
|
|
23
|
+
"""Unit tests execution shall pass."""
|
|
24
|
+
self.assertEqual(0, exit_code)
|
|
25
|
+
|
|
26
|
+
"""Coverage report shall be created"""
|
|
27
|
+
expected_file = f"build/{variant}/test/reports/coverage/index.html"
|
|
28
|
+
self.assertTrue(os.path.isfile(expected_file), f"File {expected_file} shall exist.")
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
#!/usr/bin/env python
|
|
2
|
+
import os
|
|
3
|
+
from subprocess import Popen, PIPE, CalledProcessError
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
"""
|
|
7
|
+
Utility functions needed by all test scripts.
|
|
8
|
+
"""
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
def get_test_data(filename=""):
|
|
12
|
+
return os.path.dirname(__file__) + "/data/" + filename
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
def get_output_folder():
|
|
16
|
+
return os.path.dirname(__file__) + "/output"
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
def run_process(command_list):
|
|
20
|
+
with Popen(command_list, stdout=PIPE, stderr=PIPE, bufsize=1, universal_newlines=True) as p:
|
|
21
|
+
for line in p.stdout:
|
|
22
|
+
print(line, end='')
|
|
23
|
+
for line in p.stderr:
|
|
24
|
+
print(line, end='')
|
|
25
|
+
|
|
26
|
+
return p.returncode
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
if (Test-Path -Path .git) {
|
|
2
|
+
git config --local pull.rebase true
|
|
3
|
+
Write-Host "git config --local pull.rebase was set to 'true'"
|
|
4
|
+
git config --local fetch.prune true
|
|
5
|
+
Write-Host "git config --local fetch.prune was set to 'true'"
|
|
6
|
+
} else {
|
|
7
|
+
Write-Output "This is not a git repository, therefore no configuration was changed."
|
|
8
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
Design
|
|
2
|
+
######
|
|
3
|
+
|
|
4
|
+
.. figure:: _images/screenshot.png
|
|
5
|
+
|
|
6
|
+
Requirements
|
|
7
|
+
------------
|
|
8
|
+
|
|
9
|
+
.. needtable::
|
|
10
|
+
:filter: type == 'spec'
|
|
11
|
+
:columns: id, title, tested by, is implemented by
|
|
12
|
+
:style: table
|
|
13
|
+
|
|
14
|
+
.. spec:: First design ID for my component
|
|
15
|
+
:id: S_001
|
|
16
|
+
:version: 1.0
|
|
17
|
+
|
|
18
|
+
This is the first design element of my component.
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
.. spec:: Second design ID for my component
|
|
22
|
+
:id: S_002
|
|
23
|
+
:version: 1.0
|
|
24
|
+
|
|
25
|
+
This is the second design element of my component.
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/** @file */
|
|
2
|
+
|
|
3
|
+
#include "component.h"
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
/*!
|
|
7
|
+
* @rst
|
|
8
|
+
*
|
|
9
|
+
* .. impl:: someInterfaceOfComponent
|
|
10
|
+
* :id: I_001
|
|
11
|
+
* :implements: S_001
|
|
12
|
+
*
|
|
13
|
+
* This function returns the magical number
|
|
14
|
+
*
|
|
15
|
+
* @endrst
|
|
16
|
+
*/
|
|
17
|
+
|
|
18
|
+
int someInterfaceOfComponent()
|
|
19
|
+
{
|
|
20
|
+
int result = 7; /* The most magical number. */
|
|
21
|
+
|
|
22
|
+
#ifdef THE_ANSWER
|
|
23
|
+
result = THE_ANSWER;
|
|
24
|
+
#endif
|
|
25
|
+
|
|
26
|
+
#ifdef THE_OFFSET
|
|
27
|
+
result += THE_OFFSET;
|
|
28
|
+
#endif
|
|
29
|
+
|
|
30
|
+
return result;
|
|
31
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
extern int someInterfaceOfComponent();
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
/** @file */
|
|
2
|
+
|
|
3
|
+
#include <gtest/gtest.h>
|
|
4
|
+
using namespace testing;
|
|
5
|
+
|
|
6
|
+
extern "C"
|
|
7
|
+
{
|
|
8
|
+
#include "component.h"
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
#include "mockup_components_component.h"
|
|
12
|
+
|
|
13
|
+
/*! \mainpage
|
|
14
|
+
*
|
|
15
|
+
* TODO: table of tests
|
|
16
|
+
*/
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
/*!
|
|
20
|
+
* @rst
|
|
21
|
+
*
|
|
22
|
+
* .. test:: component.test_someInterfaceOfComponent
|
|
23
|
+
* :id: T_001
|
|
24
|
+
* :tests: S_001, S_002
|
|
25
|
+
* :results: [[tr_link('title', 'case')]]
|
|
26
|
+
*
|
|
27
|
+
* Some test specification
|
|
28
|
+
*
|
|
29
|
+
* @endrst
|
|
30
|
+
*/
|
|
31
|
+
TEST(component, test_someInterfaceOfComponent)
|
|
32
|
+
{
|
|
33
|
+
/* mock all external dependencies of component */
|
|
34
|
+
CREATE_MOCK(mymock);
|
|
35
|
+
|
|
36
|
+
/* test interface */
|
|
37
|
+
EXPECT_EQ(7, someInterfaceOfComponent());
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
/*!
|
|
42
|
+
* @rst
|
|
43
|
+
*
|
|
44
|
+
* .. test:: component.test_someInterfaceOfComponent2
|
|
45
|
+
* :id: T_002
|
|
46
|
+
* :tests: S_001
|
|
47
|
+
* :results: [[tr_link('title', 'case')]]
|
|
48
|
+
*
|
|
49
|
+
* Some test specification 2
|
|
50
|
+
*
|
|
51
|
+
* @endrst
|
|
52
|
+
*/
|
|
53
|
+
TEST(component, test_someInterfaceOfComponent2)
|
|
54
|
+
{
|
|
55
|
+
/* mock all external dependencies of component */
|
|
56
|
+
CREATE_MOCK(mymock);
|
|
57
|
+
|
|
58
|
+
/* test interface */
|
|
59
|
+
EXPECT_EQ(7, someInterfaceOfComponent());
|
|
60
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
Software Detailed Design
|
|
2
|
+
========================
|
|
3
|
+
|
|
4
|
+
.. contents:: Table of Contents
|
|
5
|
+
:depth: 2
|
|
6
|
+
|
|
7
|
+
Introduction
|
|
8
|
+
------------
|
|
9
|
+
|
|
10
|
+
This is the documentation for the ``Main`` component.
|
|
11
|
+
|
|
12
|
+
{% if config.USE_COMPONENT %}
|
|
13
|
+
``USE_COMPONENT`` is enabled. Therefore ``Main`` shall call ``Component``.
|
|
14
|
+
{% endif %}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
#include "autoconf.h"
|
|
2
|
+
|
|
3
|
+
#if CONFIG_USE_COMPONENT
|
|
4
|
+
#include "component.h"
|
|
5
|
+
#endif
|
|
6
|
+
|
|
7
|
+
#include <stdio.h>
|
|
8
|
+
|
|
9
|
+
int main(void)
|
|
10
|
+
{
|
|
11
|
+
printf("Main program calculating ...\n");
|
|
12
|
+
#if CONFIG_USE_COMPONENT
|
|
13
|
+
return someInterfaceOfComponent();
|
|
14
|
+
#else
|
|
15
|
+
return 0;
|
|
16
|
+
#endif
|
|
17
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
# TODO: caching required due to cmake tools extension issue: https://github.com/microsoft/vscode-cmake-tools/issues/1188
|
|
2
|
+
# TODO: get debugging running (lldb-mi not found in any current package, switching back to gcc)
|
|
3
|
+
set(CMAKE_C_COMPILER clang CACHE STRING "C Compiler")
|
|
4
|
+
# TODO: clarify why llvm-cov produces invalid gcov files (contain blank lines), releated GCOVR issue: https://github.com/gcovr/gcovr/issues/331
|
|
5
|
+
set(GCOVR_ADDITIONAL_OPTIONS --gcov-executable \"llvm-cov gcov\" --gcov-ignore-parse-errors --html-title \"Code Coverage Report \(tool suite: LLVM Clang\)\")
|
|
6
|
+
|
|
7
|
+
set(CMAKE_CXX_COMPILER clang++ CACHE STRING "CXX Compiler")
|
|
8
|
+
set(CMAKE_ASM_COMPILER ${CMAKE_C_COMPILER} CACHE STRING "ASM Compiler")
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
set(CMAKE_TOOLCHAIN_FILE tools/toolchains/clang/toolchain.cmake CACHE PATH "toolchain file")
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
CONFIG_USE_COMPONENT=y
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import dataclasses
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
@dataclasses.dataclass
|
|
5
|
+
class Variant:
|
|
6
|
+
flavor: str
|
|
7
|
+
subsystem: str
|
|
8
|
+
|
|
9
|
+
@classmethod
|
|
10
|
+
def from_string(cls, variant: str) -> "Variant":
|
|
11
|
+
return cls(*variant.split("/"))
|
|
12
|
+
|
|
13
|
+
def __str__(self) -> str:
|
|
14
|
+
return self.to_string()
|
|
15
|
+
|
|
16
|
+
def to_string(self, delimiter: str = "/") -> str:
|
|
17
|
+
return f"{self.flavor}{delimiter}{self.subsystem}"
|
|
18
|
+
|
|
19
|
+
def __lt__(self, other: "Variant") -> bool:
|
|
20
|
+
return f"{self}" < f"{other}"
|
|
21
|
+
|
|
22
|
+
def __hash__(self) -> int:
|
|
23
|
+
return hash(f"{self}")
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
from pathlib import Path
|
|
2
|
+
|
|
3
|
+
from spl_core.project_creator.variant import Variant
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
class WorkspaceArtifacts:
|
|
7
|
+
def __init__(self, project_root_dir: Path):
|
|
8
|
+
self.workspace_root_dir = project_root_dir
|
|
9
|
+
self.variants_dir = self.root_dir.joinpath("variants")
|
|
10
|
+
self.src_dir = self.root_dir.joinpath("src")
|
|
11
|
+
self.test_dir = self.root_dir.joinpath("test")
|
|
12
|
+
self.components_dir = self.root_dir.joinpath("components")
|
|
13
|
+
|
|
14
|
+
@property
|
|
15
|
+
def root_dir(self) -> Path:
|
|
16
|
+
return self.workspace_root_dir
|
|
17
|
+
|
|
18
|
+
@property
|
|
19
|
+
def build_script(self) -> Path:
|
|
20
|
+
return self.root_dir.joinpath("build.bat")
|
|
21
|
+
|
|
22
|
+
@property
|
|
23
|
+
def kconfig_model_file(self) -> Path:
|
|
24
|
+
return self.root_dir.joinpath("KConfig")
|
|
25
|
+
|
|
26
|
+
def get_build_dir(self, variant: Variant, build_kit: str) -> Path:
|
|
27
|
+
return self.root_dir.joinpath(f"build/{variant}/{build_kit}")
|
|
28
|
+
|
|
29
|
+
def get_variant_dir(self, variant: Variant) -> Path:
|
|
30
|
+
return self.variants_dir.joinpath(f"{variant.flavor}/{variant.subsystem}")
|
|
31
|
+
|
|
32
|
+
def get_component_path(self, component_name: str) -> Path:
|
|
33
|
+
return self.components_dir.joinpath(component_name)
|
|
34
|
+
|
|
35
|
+
def get_kconfig_config_file(self, variant: Variant) -> Path:
|
|
36
|
+
return self.get_variant_dir(variant).joinpath("config.txt")
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
|
|
2
|
+
MIT License
|
|
3
|
+
|
|
4
|
+
Copyright (c) 2024 Marquardt GmbH and members of AVENGINEERS
|
|
5
|
+
|
|
6
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
7
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
8
|
+
in the Software without restriction, including without limitation the rights
|
|
9
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
10
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
11
|
+
furnished to do so, subject to the following conditions:
|
|
12
|
+
|
|
13
|
+
The above copyright notice and this permission notice shall be included in all
|
|
14
|
+
copies or substantial portions of the Software.
|
|
15
|
+
|
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
17
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
18
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
19
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
20
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
21
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
22
|
+
SOFTWARE.
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
Metadata-Version: 2.1
|
|
2
|
+
Name: spl-core
|
|
3
|
+
Version: 4.0.0
|
|
4
|
+
Summary: Software Product Line Support for CMake
|
|
5
|
+
Home-page: https://github.com/avengineers/spl-core
|
|
6
|
+
License: MIT
|
|
7
|
+
Author: Avengineers
|
|
8
|
+
Author-email: karsten.guenther@kamg.de
|
|
9
|
+
Requires-Python: >=3.10,<3.12
|
|
10
|
+
Classifier: Development Status :: 2 - Pre-Alpha
|
|
11
|
+
Classifier: Intended Audience :: Developers
|
|
12
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
13
|
+
Classifier: Natural Language :: English
|
|
14
|
+
Classifier: Operating System :: OS Independent
|
|
15
|
+
Classifier: Programming Language :: Python :: 3
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
18
|
+
Classifier: Topic :: Software Development :: Libraries
|
|
19
|
+
Requires-Dist: cookiecutter (==2.1.1)
|
|
20
|
+
Requires-Dist: gcovr
|
|
21
|
+
Requires-Dist: hammocking
|
|
22
|
+
Requires-Dist: kconfiglib
|
|
23
|
+
Requires-Dist: py-app-dev (>=2.1.0,<3.0.0)
|
|
24
|
+
Project-URL: Bug Tracker, https://github.com/avengineers/spl-core/issues
|
|
25
|
+
Project-URL: Changelog, https://github.com/avengineers/spl-core/blob/develop/CHANGELOG.md
|
|
26
|
+
Project-URL: Documentation, https://spl-core.readthedocs.io
|
|
27
|
+
Project-URL: Repository, https://github.com/avengineers/spl-core
|
|
28
|
+
Description-Content-Type: text/markdown
|
|
29
|
+
|
|
30
|
+
# SPL (Software Product Line) Core
|
|
31
|
+
|
|
32
|
+
_SPL Core_ is our CMake module to support multiple projects as variants of one SPL repository.
|
|
33
|
+
|
|
34
|
+
## CI (Continuous Integration)
|
|
35
|
+
|
|
36
|
+
- [](https://github.com/avengineers/spl/actions/workflows/test.yml)
|
|
37
|
+
|
|
38
|
+
## Installation of Dependencies
|
|
39
|
+
|
|
40
|
+
```powershell
|
|
41
|
+
.\build.ps1 -install
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
## Building
|
|
45
|
+
|
|
46
|
+
- Execution of all tests
|
|
47
|
+
- Building documentation
|
|
48
|
+
|
|
49
|
+
```powershell
|
|
50
|
+
.\build.ps1
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
## Project Creator
|
|
54
|
+
|
|
55
|
+
With the integrated project creator you can create a new SPL workspace, e.g.:
|
|
56
|
+
|
|
57
|
+
```powershell
|
|
58
|
+
pipenv run python src/project_creator/creator.py workspace --name MyProject --variant FLV1/SYS1 --out_dir C:\dev
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
Note: one can use the `--variant` argument several times to create a project with multiple variants.
|
|
62
|
+
|