Skip to content

Commit

Permalink
Added more examples
Browse files Browse the repository at this point in the history
  • Loading branch information
soumeh01 committed Apr 10, 2024
1 parent bb8131e commit b100163
Show file tree
Hide file tree
Showing 11 changed files with 59 additions and 32 deletions.
33 changes: 22 additions & 11 deletions .github/workflows/robot-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ concurrency:
cancel-in-progress: true

jobs:

robot-tests:
runs-on: ubuntu-latest
env:
Expand Down Expand Up @@ -55,12 +54,17 @@ jobs:
vcpkg activate
armlm activate --server https://mdk-preview.keil.arm.com --product KEMDK-COM0
- name: Run Test
working-directory: ./test
run: |
. /home/runner/.vcpkg/vcpkg-init
vcpkg activate
python -m robot --outputdir reports src/test.robot
# - name: Run Test
# working-directory: ./test
# run: |
# . /home/runner/.vcpkg/vcpkg-init
# vcpkg activate
# python -m robot --outputdir reports -x junit-report.xml src/test.robot

- name: Run tests
uses: joonvena/robotframework-docker-action@v1.0
with:
robot_tests_dir: ./test/src

# - name: Run Test and create report
# working-directory: ./test
Expand All @@ -72,22 +76,29 @@ jobs:
run: |
echo "ROBOT_RC=$?" >> "$GITHUB_ENV"
- name: Publish test results
- name: Archieve test results
if: always()
uses: actions/upload-artifact@v4
with:
name: reports
path: ./test/reports
path: reports

# - name: Publish Test Results
# uses: EnricoMi/publish-unit-test-result-action/linux@v2.16.1
# if: always()
# with:
# files: |
# ./test/reports/junit-report.xml

generate_report:
runs-on: ubuntu-latest
needs: robot-tests
steps:
- uses: actions/checkout@v4
- name: Download reports
uses: actions/download-artifact@v4
uses: actions/download-artifact@v1
with:
name: reports
path: reports

- name: Send report to commit
uses: joonvena/robotframework-reporter-action@v2.4
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
build
**/run
4 changes: 2 additions & 2 deletions test/data/build-asm/solution.csolution.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ solution:
- type: GCC
compiler: GCC

- type: IAR
compiler: IAR
# - type: IAR
# compiler: IAR

- type: CLANG
compiler: CLANG
Expand Down
4 changes: 2 additions & 2 deletions test/data/build-c/solution.csolution.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ solution:
- -lm
- -lc

- type: IAR
compiler: IAR
# - type: IAR
# compiler: IAR

- type: CLANG
compiler: CLANG
Expand Down
4 changes: 2 additions & 2 deletions test/data/build-cpp/solution.csolution.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ solution:
- type: GCC
compiler: GCC

- type: IAR
compiler: IAR
# - type: IAR
# compiler: IAR

- type: CLANG
compiler: CLANG
Expand Down
4 changes: 2 additions & 2 deletions test/data/include-define/solution.csolution.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ solution:
- type: GCC
compiler: GCC

- type: IAR
compiler: IAR
# - type: IAR
# compiler: IAR

- type: CLANG
compiler: CLANG
Expand Down
4 changes: 2 additions & 2 deletions test/data/linker-pre-processing/solution.csolution.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ solution:
- type: GCC
compiler: GCC

- type: IAR
compiler: IAR
# - type: IAR
# compiler: IAR

- type: CLANG
compiler: CLANG
Expand Down
4 changes: 2 additions & 2 deletions test/data/pre-include/solution.csolution.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ solution:
- type: GCC
compiler: GCC

- type: IAR
compiler: IAR
# - type: IAR
# compiler: IAR

- type: CLANG
compiler: CLANG
Expand Down
10 changes: 8 additions & 2 deletions test/resources/utils.resource
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
*** Settings ***
Documentation A resource file with reusable keywords and variables.
Library Process
Library OperatingSystem

*** Keywords ***
Run Program
Expand All @@ -10,7 +11,12 @@ Run Program
Run Keyword If '${result.rc}' != '${expected_ret_code}' Log Many Output: ${result.stdout} Return Code: ${result.rc}
Should Be Equal '${result.rc}' '${expected_ret_code}'

Run csolution
Run cbuild
[Documentation] Run csolution example with specified arguments
[Arguments] ${input_file} @{args}
Run Program cbuild ${input_file} @{args}
Run Program cbuild ${input_file} @{args} -p -r --update-rte

Copy Directory
[Documentation] Recursively copy context from source to destination
[Arguments] ${src_dir} @{dst_dir}
Copy Directory ${src_dir} ${dst_dir}
17 changes: 12 additions & 5 deletions test/src/test.robot
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,29 @@
Documentation Test to execute csolution example
Suite Setup Suite Setup
Resource ${RESOURCES}/utils.resource
Library Process
Test Template Run csolution examples
*** Variables ***
${RESOURCES} ../resources
*** Test Cases *** ${input_file} ${args}
Run Hello example ${testDataDir}/Hello${/}Hello.csolution.yml -p -r --update-rte
*** Test Cases *** ${input_file} ${args}
Run Hello ${testDataDir}/Hello${/}Hello.csolution.yml
# Run build-asm ${testDataDir}/build-asm${/}solution.csolution.yml
# Run build-c ${testDataDir}/build-c${/}solution.csolution.yml
# Run build-cpp ${testDataDir}/build-cpp${/}solution.csolution.yml
# Run include-define ${testDataDir}/include-define${/}solution.csolution.yml
# Run linker-pre-processing ${testDataDir}/linker-pre-processing${/}solution.csolution.yml
Run pre-include ${testDataDir}/pre-include${/}solution.csolution.yml
*** Keywords ***
Run csolution examples
[Arguments] ${input_file} @{args}
Run csolution ${input_file} @{args}
Run cbuild ${input_file} @{args}
Suite Setup
Set Global Variable ${testDataDir} ${CURDIR}${/}..${/}data${/}
${source_directory} Set Variable ${CURDIR}${/}..${/}data
Set Global Variable ${testDataDir} ${source_directory}${/}..${/}run
Copy Directory ${source_directory} ${testDataDir}
6 changes: 4 additions & 2 deletions test/vcpkg-configuration.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@
"requires": {
"microsoft:cmake": "^3.25.2",
"microsoft:ninja": "^1.10.2",
"arm:compilers/arm/armclang":"^6.20.0",
"arm:tools/open-cmsis-pack/cmsis-toolbox": "^2.0.0-0",
"arm:compilers/arm/armclang":"^6.21.0",
"arm:compilers/arm/arm-none-eabi-gcc": "^13.2.1",
"arm:tools/open-cmsis-pack/cmsis-toolbox": "^2.3.0",
"arm:compilers/arm/llvm-embedded": "^17.0.1"
}
}

0 comments on commit b100163

Please sign in to comment.