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

@ -13,6 +13,12 @@ googletest: FORCE
common: FORCE common: FORCE
cd common && env LIB_DIR="${LIB_DIR}" $(MAKE) 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 %: common googltest FORCE
if [ -f "$@/Makefile" ]; then cd "$@"; $(MAKE); fi 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/googlemock/include \
-I${PWD}/../../testing/googletest/googletest/include \ -I${PWD}/../../testing/googletest/googletest/include \
-DARDUINO=10607 \ -DARDUINO=10607 \
-DARDUINO_ARCH_VIRTUAL \
-DARDUINO_AVR_MODEL01 \ -DARDUINO_AVR_MODEL01 \
'-DKALEIDOSCOPE_HARDWARE_H="Kaleidoscope-Hardware-Model01.h"' \ '-DKALEIDOSCOPE_HARDWARE_H="Kaleidoscope-Hardware-Model01.h"' \
-DKALEIDOSCOPE_VIRTUAL_BUILD=1 \ -DKALEIDOSCOPE_VIRTUAL_BUILD=1 \
@ -33,3 +34,6 @@ ${OBJ_DIR}/%.o: %.cpp $(wildcard *.h)
-DARDUINO_ARCH_AVR=1 \ -DARDUINO_ARCH_AVR=1 \
'-DUSB_PRODUCT="Model 01"' \ '-DUSB_PRODUCT="Model 01"' \
$< $<
clean:
rm -rf "${LIB_DIR}" "${OBJ_DIR}"

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

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

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

Loading…
Cancel
Save