mirror of
https://github.com/dalathegreat/Battery-Emulator.git
synced 2025-10-03 17:59:27 +02:00
Some updates, temp disable other Actions
This commit is contained in:
parent
a81133c6c0
commit
4577df094e
6 changed files with 26 additions and 26 deletions
6
.github/workflows/compile-all-batteries.yml
vendored
6
.github/workflows/compile-all-batteries.yml
vendored
|
@ -2,11 +2,7 @@
|
||||||
name: Compile All Batteries
|
name: Compile All Batteries
|
||||||
|
|
||||||
# Here we tell GitHub when to run the workflow.
|
# Here we tell GitHub when to run the workflow.
|
||||||
on:
|
on: [push, pull_request]
|
||||||
# The workflow is run when a commit is pushed or for a
|
|
||||||
# Pull Request.
|
|
||||||
- push
|
|
||||||
- pull_request
|
|
||||||
|
|
||||||
# This is the list of jobs that will be run concurrently.
|
# This is the list of jobs that will be run concurrently.
|
||||||
# Since we use a build matrix, the actual number of jobs
|
# Since we use a build matrix, the actual number of jobs
|
||||||
|
|
6
.github/workflows/compile-all-inverters.yml
vendored
6
.github/workflows/compile-all-inverters.yml
vendored
|
@ -2,11 +2,7 @@
|
||||||
name: Compile All Inverters
|
name: Compile All Inverters
|
||||||
|
|
||||||
# Here we tell GitHub when to run the workflow.
|
# Here we tell GitHub when to run the workflow.
|
||||||
on:
|
on: [push, pull_request]
|
||||||
# The workflow is run when a commit is pushed or for a
|
|
||||||
# Pull Request.
|
|
||||||
- push
|
|
||||||
- pull_request
|
|
||||||
|
|
||||||
# This is the list of jobs that will be run concurrently.
|
# This is the list of jobs that will be run concurrently.
|
||||||
# Since we use a build matrix, the actual number of jobs
|
# Since we use a build matrix, the actual number of jobs
|
||||||
|
|
4
.github/workflows/run-pre-commit.yml
vendored
4
.github/workflows/run-pre-commit.yml
vendored
|
@ -2,9 +2,7 @@
|
||||||
|
|
||||||
name: Run pre-commit
|
name: Run pre-commit
|
||||||
|
|
||||||
on:
|
on: [push, pull_request]
|
||||||
- push
|
|
||||||
- pull_request
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
pre-commit:
|
pre-commit:
|
||||||
|
|
3
.github/workflows/unit-tests.yml
vendored
3
.github/workflows/unit-tests.yml
vendored
|
@ -1,6 +1,6 @@
|
||||||
name: Run Unit Tests
|
name: Run Unit Tests
|
||||||
|
|
||||||
on: [push]
|
on: [push, pull_request]
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
|
@ -19,5 +19,6 @@ jobs:
|
||||||
|
|
||||||
- name: Run unit tests
|
- name: Run unit tests
|
||||||
run: |
|
run: |
|
||||||
|
set -e # Exit immediately on non-zero exit code
|
||||||
cd build/test
|
cd build/test
|
||||||
find . -type f -executable -exec {} \;
|
find . -type f -executable -exec {} \;
|
||||||
|
|
1
Software/src/devboard/utils/CMakeLists.txt
Normal file
1
Software/src/devboard/utils/CMakeLists.txt
Normal file
|
@ -0,0 +1 @@
|
||||||
|
# add_library(utils_library events.cpp)
|
|
@ -9,24 +9,32 @@
|
||||||
|
|
||||||
TEST(timer_test) {
|
TEST(timer_test) {
|
||||||
unsigned long test_interval = 10;
|
unsigned long test_interval = 10;
|
||||||
|
bool result;
|
||||||
|
|
||||||
testlib_millis = 0;
|
testlib_millis = 30;
|
||||||
MyTimer timer(test_interval);
|
MyTimer timer(test_interval);
|
||||||
ASSERT_EQ(timer.elapsed(), false);
|
result = timer.elapsed();
|
||||||
|
ASSERT_EQ(result, false);
|
||||||
|
|
||||||
testlib_millis = test_interval - 1;
|
testlib_millis += test_interval - 1;
|
||||||
ASSERT_EQ(timer.elapsed(), false);
|
result = timer.elapsed();
|
||||||
|
ASSERT_EQ(result, false);
|
||||||
|
|
||||||
testlib_millis = test_interval;
|
testlib_millis += 1;
|
||||||
ASSERT_EQ(timer.elapsed(), true);
|
result = timer.elapsed();
|
||||||
ASSERT_EQ(timer.elapsed(), false);
|
ASSERT_EQ(result, true);
|
||||||
|
result = timer.elapsed();
|
||||||
|
ASSERT_EQ(result, false);
|
||||||
|
|
||||||
testlib_millis = 2 * test_interval - 1;
|
testlib_millis += test_interval - 1;
|
||||||
ASSERT_EQ(timer.elapsed(), false);
|
result = timer.elapsed();
|
||||||
|
ASSERT_EQ(result, false);
|
||||||
|
|
||||||
testlib_millis = 2 * test_interval;
|
testlib_millis += 1;
|
||||||
ASSERT_EQ(timer.elapsed(), true);
|
result = timer.elapsed();
|
||||||
ASSERT_EQ(timer.elapsed(), false);
|
ASSERT_EQ(result, true);
|
||||||
|
result = timer.elapsed();
|
||||||
|
ASSERT_EQ(result, true); // Injected fault to catch unit test errors
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_MAIN();
|
TEST_MAIN();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue