[WIP]: Debugging NPE in kaleidoscope/simulator_test.cpp.

Signed-off-by: Eric Paniagua <epaniagua@google.com>
epan/testing/readable
Eric Paniagua 4 years ago
parent eabea8f03c
commit b6d607be62

@ -18,6 +18,14 @@
#include "kaleidoscope/layers.h"
#include "kaleidoscope/keyswitch_state.h"
#undef T
#undef U
#undef min
#undef max
#undef TEST
#include <iostream>
namespace kaleidoscope {
uint32_t Runtime_::millis_at_cycle_start_;
@ -51,18 +59,26 @@ Runtime_::setup(void) {
void
Runtime_::loop(void) {
std::cout << "epan 2.2.1.1" << std::endl;
millis_at_cycle_start_ = millis();
std::cout << "epan 2.2.1.2" << std::endl;
kaleidoscope::Hooks::beforeEachCycle();
std::cout << "epan 2.2.1.3" << std::endl;
device().scanMatrix();
std::cout << "epan 2.2.1.4" << std::endl;
kaleidoscope::Hooks::beforeReportingState();
std::cout << "epan 2.2.1.5" << std::endl;
device().hid().keyboard().sendReport();
std::cout << "epan 2.2.1.6" << std::endl;
device().hid().keyboard().releaseAllKeys();
std::cout << "epan 2.2.1.7" << std::endl;
kaleidoscope::Hooks::afterEachCycle();
std::cout << "epan 2.2.1.8" << std::endl;
}
Runtime_ Runtime;

@ -13,6 +13,12 @@ googletest: FORCE
common: FORCE
cd common && env LIB_DIR="${LIB_DIR}" $(MAKE)
clean: FORCE
rm -rf "${LIB_DIR}"
cd common && make clean
cd hello-simulator && make clean
cd kaleidoscope && make clean
%: common googltest FORCE
if [ -f "$@/Makefile" ]; then cd "$@"; $(MAKE); fi

@ -25,6 +25,7 @@ ${OBJ_DIR}/%.o: %.cpp $(wildcard *.h)
-I${PWD}/../../testing/googletest/googlemock/include \
-I${PWD}/../../testing/googletest/googletest/include \
-DARDUINO=10607 \
-DARDUINO_ARCH_VIRTUAL \
-DARDUINO_AVR_MODEL01 \
'-DKALEIDOSCOPE_HARDWARE_H="Kaleidoscope-Hardware-Model01.h"' \
-DKALEIDOSCOPE_VIRTUAL_BUILD=1 \
@ -33,3 +34,6 @@ ${OBJ_DIR}/%.o: %.cpp $(wildcard *.h)
-DARDUINO_ARCH_AVR=1 \
'-DUSB_PRODUCT="Model 01"' \
$<
clean:
rm -rf "${LIB_DIR}" "${OBJ_DIR}"

@ -36,7 +36,7 @@ class VirtualDeviceTest : public ::testing::Test {
const State& Result() const;
Simulator sim_;
::kaleidoscope::testing::Simulator sim_;
private:
State state_;

@ -31,6 +31,7 @@ ${OBJ_DIR}/%.o: %.cpp
-I../../testing/googletest/googlemock/include \
-I../../testing/googletest/googletest/include \
-DARDUINO=10607 \
-DARDUINO_ARCH_VIRTUAL \
-DARDUINO_AVR_MODEL01 \
'-DKALEIDOSCOPE_HARDWARE_H="Kaleidoscope-Hardware-Model01.h"' \
-DKALEIDOSCOPE_VIRTUAL_BUILD=1 \

@ -23,10 +23,10 @@ ${BIN_DIR}/${BIN_FILE}: ${TEST_OBJS} FORCE
-g \
-w \
${TEST_OBJS} \
"${LIB_DIR}/${LIB_FILE}" \
-L"$(PWD)/../googletest/lib" \
-L"${PWD}/../lib" \
-lcommon \
"${LIB_DIR}/${LIB_FILE}" \
-L"$(PWD)/../googletest/lib" \
-lgtest \
-lgmock \
-lm \
@ -45,6 +45,7 @@ ${OBJ_DIR}/%.o: ${SRC_DIR}/%.cpp
-I${PWD}/../../testing/googletest/googlemock/include \
-I${PWD}/../../testing/googletest/googletest/include \
-DARDUINO=10607 \
-DARDUINO_ARCH_VIRTUAL \
-DARDUINO_AVR_MODEL01 \
'-DKALEIDOSCOPE_HARDWARE_H="Kaleidoscope-Hardware-Model01.h"' \
-DKALEIDOSCOPE_VIRTUAL_BUILD=1 \

Loading…
Cancel
Save