]> git.donarmstrong.com Git - qmk_firmware.git/commitdiff
Configure vscode file associations, use hpp instead of h
authorFred Sundvik <fsundvik@gmail.com>
Sun, 2 Jul 2017 18:46:35 +0000 (21:46 +0300)
committerJack Humbert <jack.humb@gmail.com>
Sun, 9 Jul 2017 01:59:51 +0000 (21:59 -0400)
15 files changed:
.vscode/settings.json
tests/basic/test_keypress.cpp
tests/basic/test_macro.cpp
tests/basic/test_tapping.cpp
tests/test_common/keyboard_report_util.cpp
tests/test_common/keyboard_report_util.h [deleted file]
tests/test_common/keyboard_report_util.hpp [new file with mode: 0644]
tests/test_common/test_common.h [deleted file]
tests/test_common/test_common.hpp [new file with mode: 0644]
tests/test_common/test_driver.cpp
tests/test_common/test_driver.h [deleted file]
tests/test_common/test_driver.hpp [new file with mode: 0644]
tests/test_common/test_fixture.cpp
tests/test_common/test_fixture.h [deleted file]
tests/test_common/test_fixture.hpp [new file with mode: 0644]

index f5d7a7602ae9912379cf1cf634d95309ebe92cd9..be0b85b78ffa2713b6610295502a5dc6ee8c8fbc 100644 (file)
@@ -4,5 +4,11 @@
     "files.exclude": {
         "**/.build": true,
         "**/*.hex": true
+    },
+    "files.associations": {
+        "*.h": "c",
+        "*.c": "c",
+        "*.cpp": "cpp",
+        "*.hpp": "cpp"
     }
 }
\ No newline at end of file
index 2323b7cb44b7681fc27002d8c4973cdbe1f9e7ee..460c383856c194c722d010f699519cfae286e75d 100644 (file)
@@ -14,7 +14,7 @@
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 
-#include "test_common.h"
+#include "test_common.hpp"
 
 using testing::_;
 using testing::Return;
index f1990bf6ff67a86298d9a7cabd50f6c727ba81c5..56ee5ad3e8c7e17a619c75ec96e8a6e62336121e 100644 (file)
@@ -14,7 +14,7 @@
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 
-#include "test_common.h"
+#include "test_common.hpp"
 #include "time.h"
 
 using testing::InSequence;
index c158e17189d1039a13bcc0fac645ac0f4f9e07d0..75a1bcafb8836239f2e37d2863b36cc777421a66 100644 (file)
@@ -14,7 +14,7 @@
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 
-#include "test_common.h"
+#include "test_common.hpp"
 #include "action_tapping.h"
 
 using testing::_;
index aa096e4169477c4c3d4aef0890a0a24daea2eda4..bf728b9a2a801bba3c4efcfa84a09ea6e55be4b5 100644 (file)
@@ -14,7 +14,7 @@
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 
- #include "keyboard_report_util.h"
+ #include "keyboard_report_util.hpp"
  #include <vector>
  #include <algorithm>
  using namespace testing;
diff --git a/tests/test_common/keyboard_report_util.h b/tests/test_common/keyboard_report_util.h
deleted file mode 100644 (file)
index 48543c2..0000000
+++ /dev/null
@@ -1,39 +0,0 @@
-/* Copyright 2017 Fred Sundvik
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program.  If not, see <http://www.gnu.org/licenses/>.
- */
-
-#pragma once
-#include "report.h"
-#include <ostream>
-#include "gmock/gmock.h"
-
-bool operator==(const report_keyboard_t& lhs, const report_keyboard_t& rhs);
-std::ostream& operator<<(std::ostream& stream, const report_keyboard_t& value);
-
-class KeyboardReportMatcher : public testing::MatcherInterface<report_keyboard_t&> {
- public:
-    KeyboardReportMatcher(const std::vector<uint8_t>& keys);
-    virtual bool MatchAndExplain(report_keyboard_t& report, testing::MatchResultListener* listener) const override;
-    virtual void DescribeTo(::std::ostream* os) const override;
-    virtual void DescribeNegationTo(::std::ostream* os) const override;
-private:
-    report_keyboard_t m_report;
-};
-
-
-template<typename... Ts>
-inline testing::Matcher<report_keyboard_t&> KeyboardReport(Ts... keys) {
-    return testing::MakeMatcher(new KeyboardReportMatcher(std::vector<uint8_t>({keys...})));
-}
\ No newline at end of file
diff --git a/tests/test_common/keyboard_report_util.hpp b/tests/test_common/keyboard_report_util.hpp
new file mode 100644 (file)
index 0000000..48543c2
--- /dev/null
@@ -0,0 +1,39 @@
+/* Copyright 2017 Fred Sundvik
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#pragma once
+#include "report.h"
+#include <ostream>
+#include "gmock/gmock.h"
+
+bool operator==(const report_keyboard_t& lhs, const report_keyboard_t& rhs);
+std::ostream& operator<<(std::ostream& stream, const report_keyboard_t& value);
+
+class KeyboardReportMatcher : public testing::MatcherInterface<report_keyboard_t&> {
+ public:
+    KeyboardReportMatcher(const std::vector<uint8_t>& keys);
+    virtual bool MatchAndExplain(report_keyboard_t& report, testing::MatchResultListener* listener) const override;
+    virtual void DescribeTo(::std::ostream* os) const override;
+    virtual void DescribeNegationTo(::std::ostream* os) const override;
+private:
+    report_keyboard_t m_report;
+};
+
+
+template<typename... Ts>
+inline testing::Matcher<report_keyboard_t&> KeyboardReport(Ts... keys) {
+    return testing::MakeMatcher(new KeyboardReportMatcher(std::vector<uint8_t>({keys...})));
+}
\ No newline at end of file
diff --git a/tests/test_common/test_common.h b/tests/test_common/test_common.h
deleted file mode 100644 (file)
index 38eb0ed..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-/* Copyright 2017 Fred Sundvik
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program.  If not, see <http://www.gnu.org/licenses/>.
- */
-
-#include "gtest/gtest.h"
-#include "gmock/gmock.h"
-
-#include "quantum.h"
-#include "test_driver.h"
-#include "test_matrix.h"
-#include "keyboard_report_util.h"
-#include "test_fixture.h"
\ No newline at end of file
diff --git a/tests/test_common/test_common.hpp b/tests/test_common/test_common.hpp
new file mode 100644 (file)
index 0000000..2398446
--- /dev/null
@@ -0,0 +1,24 @@
+/* Copyright 2017 Fred Sundvik
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include "gtest/gtest.h"
+#include "gmock/gmock.h"
+
+#include "quantum.h"
+#include "test_driver.hpp"
+#include "test_matrix.h"
+#include "keyboard_report_util.hpp"
+#include "test_fixture.hpp"
\ No newline at end of file
index feb80563a16b27062d91b179b99630f51e5d4a71..5113099698707fff9dea1ab60a74af73b1222ace 100644 (file)
@@ -14,7 +14,7 @@
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 
-#include "test_driver.h"
+#include "test_driver.hpp"
 
 TestDriver* TestDriver::m_this = nullptr;
 
diff --git a/tests/test_common/test_driver.h b/tests/test_common/test_driver.h
deleted file mode 100644 (file)
index 0123fd5..0000000
+++ /dev/null
@@ -1,48 +0,0 @@
-/* Copyright 2017 Fred Sundvik
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program.  If not, see <http://www.gnu.org/licenses/>.
- */
-
-#ifndef TESTS_TEST_COMMON_TEST_DRIVER_H_
-#define TESTS_TEST_COMMON_TEST_DRIVER_H_
-
-#include "gmock/gmock.h"
-#include <stdint.h>
-#include "host.h"
-#include "keyboard_report_util.h"
-
-
-class TestDriver {
-public:
-    TestDriver();
-    ~TestDriver();
-    void set_leds(uint8_t leds) { m_leds = leds; }
-    
-    MOCK_METHOD1(send_keyboard_mock, void (report_keyboard_t&));
-    MOCK_METHOD1(send_mouse_mock, void (report_mouse_t&));
-    MOCK_METHOD1(send_system_mock, void (uint16_t));
-    MOCK_METHOD1(send_consumer_mock, void (uint16_t));
-private:
-    static uint8_t keyboard_leds(void);
-    static void send_keyboard(report_keyboard_t *report);
-    static void send_mouse(report_mouse_t* report);
-    static void send_system(uint16_t data);
-    static void send_consumer(uint16_t data);
-    host_driver_t m_driver;
-    uint8_t m_leds = 0;
-    static TestDriver* m_this;
-};
-
-
-#endif /* TESTS_TEST_COMMON_TEST_DRIVER_H_ */
diff --git a/tests/test_common/test_driver.hpp b/tests/test_common/test_driver.hpp
new file mode 100644 (file)
index 0000000..c3ae17b
--- /dev/null
@@ -0,0 +1,48 @@
+/* Copyright 2017 Fred Sundvik
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef TESTS_TEST_COMMON_TEST_DRIVER_H_
+#define TESTS_TEST_COMMON_TEST_DRIVER_H_
+
+#include "gmock/gmock.h"
+#include <stdint.h>
+#include "host.h"
+#include "keyboard_report_util.hpp"
+
+
+class TestDriver {
+public:
+    TestDriver();
+    ~TestDriver();
+    void set_leds(uint8_t leds) { m_leds = leds; }
+    
+    MOCK_METHOD1(send_keyboard_mock, void (report_keyboard_t&));
+    MOCK_METHOD1(send_mouse_mock, void (report_mouse_t&));
+    MOCK_METHOD1(send_system_mock, void (uint16_t));
+    MOCK_METHOD1(send_consumer_mock, void (uint16_t));
+private:
+    static uint8_t keyboard_leds(void);
+    static void send_keyboard(report_keyboard_t *report);
+    static void send_mouse(report_mouse_t* report);
+    static void send_system(uint16_t data);
+    static void send_consumer(uint16_t data);
+    host_driver_t m_driver;
+    uint8_t m_leds = 0;
+    static TestDriver* m_this;
+};
+
+
+#endif /* TESTS_TEST_COMMON_TEST_DRIVER_H_ */
index 5ca5247dbf5fe567d90603614179084af90b45da..df57338dfc09d77f8416e5acc847b64fed6b0e1b 100644 (file)
@@ -1,6 +1,6 @@
-#include "test_fixture.h"
+#include "test_fixture.hpp"
 #include "gmock/gmock.h"
-#include "test_driver.h"
+#include "test_driver.hpp"
 #include "test_matrix.h"
 #include "keyboard.h"
 #include "action.h"
diff --git a/tests/test_common/test_fixture.h b/tests/test_common/test_fixture.h
deleted file mode 100644 (file)
index 4146b68..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-/* Copyright 2017 Fred Sundvik
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program.  If not, see <http://www.gnu.org/licenses/>.
- */
-
- #pragma once
-
-#include "gtest/gtest.h"
-
-class TestFixture : public testing::Test {
-public:
-    TestFixture();
-    ~TestFixture();
-    static void SetUpTestCase();
-    static void TearDownTestCase();
-
-    void run_one_scan_loop();
-    void idle_for(uint ms);
-};
\ No newline at end of file
diff --git a/tests/test_common/test_fixture.hpp b/tests/test_common/test_fixture.hpp
new file mode 100644 (file)
index 0000000..4146b68
--- /dev/null
@@ -0,0 +1,30 @@
+/* Copyright 2017 Fred Sundvik
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+ #pragma once
+
+#include "gtest/gtest.h"
+
+class TestFixture : public testing::Test {
+public:
+    TestFixture();
+    ~TestFixture();
+    static void SetUpTestCase();
+    static void TearDownTestCase();
+
+    void run_one_scan_loop();
+    void idle_for(uint ms);
+};
\ No newline at end of file