summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDawsyn Schraiber <[email protected]>2023-09-02 09:55:10 -0400
committerDawsyn Schraiber <[email protected]>2023-09-02 09:55:10 -0400
commit1b8af4198f7f18ccbfb336709f20a88e26e2b195 (patch)
tree90a474cfd7085355e4e1d7ae9831da7d65e9e693
parentf76e1efbe420af14078eb1a98551804b830c99c1 (diff)
downloadactive-drag-system-1b8af4198f7f18ccbfb336709f20a88e26e2b195.tar.gz
active-drag-system-1b8af4198f7f18ccbfb336709f20a88e26e2b195.tar.bz2
active-drag-system-1b8af4198f7f18ccbfb336709f20a88e26e2b195.zip
Project Structure and Build System
-rw-r--r--.gitignore2
-rw-r--r--CMakeLists.txt23
-rw-r--r--README.md13
-rw-r--r--src/CMakeLists.txt1
-rw-r--r--src/active-drag-system.cpp7
-rw-r--r--test/CMakeLists.txt14
-rw-r--r--test/hello_test.cc9
7 files changed, 69 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..3c243f0
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,2 @@
+build/*
+Testing/*
diff --git a/CMakeLists.txt b/CMakeLists.txt
new file mode 100644
index 0000000..afe6539
--- /dev/null
+++ b/CMakeLists.txt
@@ -0,0 +1,23 @@
+cmake_minimum_required(VERSION 3.14)
+project(Active-Drag-System CXX)
+
+set(CMAKE_CXX_STANDARD 14)
+set(CMAKE_CXX_STANDARD_REQUIRED ON)
+set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Werror")
+include(CTest)
+
+add_subdirectory(src)
+if(BUILD_TESTING)
+ add_subdirectory(test)
+endif()
+
+include(FetchContent)
+FetchContent_Declare(
+ googletest
+ URL https://github.com/google/googletest/archive/03597a01ee50ed33e9dfd640b249b4be3799d395.zip
+)
+
+# For Windows: Prevent overriding the parent project's compiler/linker settings
+set(gtest_force_shared_crt ON CACHE BOOL "" FORCE)
+FetchContent_MakeAvailable(googletest)
+
diff --git a/README.md b/README.md
new file mode 100644
index 0000000..eb36387
--- /dev/null
+++ b/README.md
@@ -0,0 +1,13 @@
+# Active Drag System (ADS)
+This is the main codebase for Rocketry at Virginia Tech's Active Drag System, also known coloquially as the ADS, for the 2023-2024 competition year. It runs primarily on a BeagleBone Black, and its goal is to autonomously control the ADS' deployment during flight.
+
+## BUILD
+cmake -B build
+cmake --build build/
+
+## RUN
+cd build && src/ads
+
+## TEST
+cd build && ctest
+
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
new file mode 100644
index 0000000..95d2f15
--- /dev/null
+++ b/src/CMakeLists.txt
@@ -0,0 +1 @@
+add_executable (ads active-drag-system.cpp)
diff --git a/src/active-drag-system.cpp b/src/active-drag-system.cpp
new file mode 100644
index 0000000..2b76215
--- /dev/null
+++ b/src/active-drag-system.cpp
@@ -0,0 +1,7 @@
+#include <cstdlib>
+#include <iostream>
+
+int main() {
+ std::cout << "ADS Deployed!" << std::endl;
+ return EXIT_SUCCESS;
+}
diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt
new file mode 100644
index 0000000..9aef78e
--- /dev/null
+++ b/test/CMakeLists.txt
@@ -0,0 +1,14 @@
+enable_testing()
+
+add_executable(
+ hello_test
+ hello_test.cc
+)
+target_link_libraries(
+ hello_test
+ GTest::gtest_main
+)
+
+include(GoogleTest)
+gtest_discover_tests(hello_test)
+
diff --git a/test/hello_test.cc b/test/hello_test.cc
new file mode 100644
index 0000000..5a57e13
--- /dev/null
+++ b/test/hello_test.cc
@@ -0,0 +1,9 @@
+#include <gtest/gtest.h>
+
+// Demonstrate some basic assertions.
+TEST(HelloTest, BasicAssertions) {
+ // Expect two strings not to be equal.
+ EXPECT_STRNE("hello", "world");
+ // Expect equality.
+ EXPECT_EQ(7 * 6, 42);
+}