Some updates, temp disable other Actions

This commit is contained in:
Cabooman 2024-02-06 08:17:47 +01:00
parent a81133c6c0
commit 4577df094e
6 changed files with 26 additions and 26 deletions

View file

@ -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

View file

@ -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

View file

@ -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:

View file

@ -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 {} \;

View file

@ -0,0 +1 @@
# add_library(utils_library events.cpp)

View file

@ -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();