mirror of
https://github.com/esp8266/Arduino.git
synced 2025-06-12 01:53:07 +03:00
Initial batch of mocks for host side testing
This commit is contained in:
29
tests/host/common/Arduino.cpp
Normal file
29
tests/host/common/Arduino.cpp
Normal file
@ -0,0 +1,29 @@
|
||||
//
|
||||
// Arduino.cpp
|
||||
// esp8266-host-tests
|
||||
//
|
||||
// Created by Ivan Grokhotkov on 02/03/16.
|
||||
// Copyright © 2016 esp8266.com. All rights reserved.
|
||||
//
|
||||
#define CATCH_CONFIG_MAIN
|
||||
#include <catch.hpp>
|
||||
#include <sys/time.h>
|
||||
#include "Arduino.h"
|
||||
|
||||
|
||||
extern "C" unsigned long millis()
|
||||
{
|
||||
timeval time;
|
||||
gettimeofday(&time, NULL);
|
||||
return (time.tv_sec * 1000) + (time.tv_usec / 1000);
|
||||
}
|
||||
|
||||
|
||||
extern "C" void yield()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
extern "C" void __panic_func(const char* file, int line, const char* func) {
|
||||
abort();
|
||||
}
|
Reference in New Issue
Block a user