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
# Here we tell GitHub when to run the workflow.
on:
# The workflow is run when a commit is pushed or for a
# Pull Request.
- push
- pull_request
on: [push, pull_request]
# This is the list of jobs that will be run concurrently.
# Since we use a build matrix, the actual number of jobs

View file

@ -2,11 +2,7 @@
name: Compile All Inverters
# Here we tell GitHub when to run the workflow.
on:
# The workflow is run when a commit is pushed or for a
# Pull Request.
- push
- pull_request
on: [push, pull_request]
# This is the list of jobs that will be run concurrently.
# Since we use a build matrix, the actual number of jobs

View file

@ -2,9 +2,7 @@
name: Run pre-commit
on:
- push
- pull_request
on: [push, pull_request]
jobs:
pre-commit:

View file

@ -1,6 +1,6 @@
name: Run Unit Tests
on: [push]
on: [push, pull_request]
jobs:
build:
@ -19,5 +19,6 @@ jobs:
- name: Run unit tests
run: |
set -e # Exit immediately on non-zero exit code
cd build/test
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) {
unsigned long test_interval = 10;
bool result;
testlib_millis = 0;
testlib_millis = 30;
MyTimer timer(test_interval);
ASSERT_EQ(timer.elapsed(), false);
result = timer.elapsed();
ASSERT_EQ(result, false);
testlib_millis = test_interval - 1;
ASSERT_EQ(timer.elapsed(), false);
testlib_millis += test_interval - 1;
result = timer.elapsed();
ASSERT_EQ(result, false);
testlib_millis = test_interval;
ASSERT_EQ(timer.elapsed(), true);
ASSERT_EQ(timer.elapsed(), false);
testlib_millis += 1;
result = timer.elapsed();
ASSERT_EQ(result, true);
result = timer.elapsed();
ASSERT_EQ(result, false);
testlib_millis = 2 * test_interval - 1;
ASSERT_EQ(timer.elapsed(), false);
testlib_millis += test_interval - 1;
result = timer.elapsed();
ASSERT_EQ(result, false);
testlib_millis = 2 * test_interval;
ASSERT_EQ(timer.elapsed(), true);
ASSERT_EQ(timer.elapsed(), false);
testlib_millis += 1;
result = timer.elapsed();
ASSERT_EQ(result, true);
result = timer.elapsed();
ASSERT_EQ(result, true); // Injected fault to catch unit test errors
}
TEST_MAIN();