New button template
This commit is contained in:
31
templates/button/test/test_system.cpp.tmpl
Normal file
31
templates/button/test/test_system.cpp.tmpl
Normal file
@@ -0,0 +1,31 @@
|
||||
/*
|
||||
* test_system.cpp -- Your system tests go here.
|
||||
*
|
||||
* This file is YOURS. Anvil will never overwrite it.
|
||||
* The button example tests are in test_button_app.cpp.
|
||||
*
|
||||
* System tests use SimHal and ButtonSim to exercise real application
|
||||
* logic against simulated hardware. See test_button_app.cpp for examples.
|
||||
*/
|
||||
|
||||
#include <gtest/gtest.h>
|
||||
|
||||
#include "mock_arduino.h"
|
||||
#include "hal.h"
|
||||
#include "sim_hal.h"
|
||||
#include "button_sim.h"
|
||||
#include "{{PROJECT_NAME}}_app.h"
|
||||
|
||||
// Example: add your own system tests below
|
||||
// TEST(MySystemTests, DescribeWhatItTests) {
|
||||
// mock_arduino_reset();
|
||||
// SimHal sim;
|
||||
// ButtonSim btn(0); // 0 = no bounce
|
||||
//
|
||||
// ButtonApp app(&sim, &btn);
|
||||
// app.begin();
|
||||
//
|
||||
// btn.press();
|
||||
// app.update();
|
||||
// EXPECT_EQ(app.pressCount(), 1);
|
||||
// }
|
||||
Reference in New Issue
Block a user