102 lines
2.0 KiB
C++
102 lines
2.0 KiB
C++
/**
|
||
* \file main.cpp
|
||
* \project EFC_PlatformC28x
|
||
* \Author leonidTitov
|
||
* \date 10 маÑ<C2B0> 2024 г.
|
||
*
|
||
*/
|
||
#define _DUAL_HEADERS // íå âëåçàé óáúåò
|
||
|
||
#include "UnitTestInterface.hh"
|
||
#include "AsyncRunnerInterface.hh"
|
||
|
||
#include "AsyncRunner.hh"
|
||
|
||
struct BaseResult : public umlib::tests::TestResult {
|
||
|
||
void assert_false( bool, std::string description );
|
||
void assert_true( bool, std::string description );
|
||
|
||
};
|
||
|
||
#include <sysctl.h>
|
||
#include <interrupt.h>
|
||
|
||
void init() {
|
||
|
||
Interrupt_disableGlobal();
|
||
Interrupt_disablePIE();
|
||
|
||
Interrupt_initModule();
|
||
Interrupt_initVectorTable();
|
||
|
||
Interrupt_enablePIE();
|
||
Interrupt_enableGlobal();
|
||
|
||
EINT;
|
||
ERTM;
|
||
|
||
}
|
||
|
||
#include <AsyncRunnerTest.hh>
|
||
|
||
#include <Atomic.hpp>
|
||
#include <AtomicTest.hpp>
|
||
|
||
#include <SdfmTest.hpp>//Êëàññ òåñòèðóþùèé SDFM
|
||
#include <VoltageMonitoring\SDFM.hpp>//Èñõîäíûé êëàññ â êîòîðûé ïîäêëþ÷åí ôàéë
|
||
|
||
|
||
|
||
/**
|
||
* \function run()
|
||
*/
|
||
int run()
|
||
{
|
||
|
||
BaseResult result;
|
||
|
||
umlib::tests::AsyncRunnerTest async_runner_test( platform::AsyncRunner::getInstance() );
|
||
|
||
async_runner_test.run(result);
|
||
|
||
umlib::tests::AtomicFlagTest<umlib::imp::AtomicFlag> atomic_flag_tests( platform::AsyncRunner::getInstance() );
|
||
|
||
atomic_flag_tests.run(result);
|
||
|
||
// ñîçäàåì ýêçåìïëÿ Sdfm_tests
|
||
umlib::tests::SdfmTest<umlib::imp::Sdfm> Sdfm_tests;
|
||
Sdfm_tests.run(result);
|
||
return 0;
|
||
|
||
}
|
||
|
||
#include <stdio.h>
|
||
|
||
/*!
|
||
* \brief Ð’Ñ<E28099>Ñ<EFBFBD> инициализациÑ<C2B8> должна быть произведена в Ñ<>крипте отладчика.
|
||
* \function main()
|
||
*
|
||
*/
|
||
int main(int argc, char * argv[]) {
|
||
|
||
printf("\n");
|
||
printf("Run PlatformC28x Tests:\n");
|
||
|
||
init();
|
||
|
||
return run();
|
||
}
|
||
|
||
void BaseResult::assert_false( bool check, std::string description ) {
|
||
|
||
printf("\"%s\": %s\n", description.c_str(), check ? "False" : "True");
|
||
|
||
}
|
||
|
||
void BaseResult::assert_true( bool check, std::string description ) {
|
||
|
||
printf("\"%s\": %s\n", description.c_str(), check ? "True" : "False");
|
||
|
||
}
|