From 728b2523169c7fc907e6f9e2fb309d4c8b0f5f60 Mon Sep 17 00:00:00 2001
From: Brendan Bartels <bbartels@iastate.edu>
Date: Sat, 1 Apr 2017 09:39:23 -0500
Subject: [PATCH] quad: run make deep-clean on ci test

- Add some prints to scripts to help with debugging
- Add sleep statements to ensure process spanws correctly
---
 ci-test.sh                               | 2 +-
 quad/Makefile                            | 4 ++--
 quad/scripts/tests/test_safety_checks.rb | 8 ++++++--
 quad/scripts/tests/test_unix_uart.rb     | 6 ++++++
 4 files changed, 15 insertions(+), 5 deletions(-)

diff --git a/ci-test.sh b/ci-test.sh
index c79ad9703..2b8060ce4 100644
--- a/ci-test.sh
+++ b/ci-test.sh
@@ -4,4 +4,4 @@ set -e
 export PATH=/usr/local/bin:$PATH
 
 # Quad
-(cd quad && make test)
+(cd quad && make deep-clean && make && make test)
diff --git a/quad/Makefile b/quad/Makefile
index b55274815..f27a39d37 100644
--- a/quad/Makefile
+++ b/quad/Makefile
@@ -38,8 +38,8 @@ test: all
 	$(MAKE) -C src/queue test
 	$(MAKE) -C src/computation_graph test
 	$(MAKE) -C src/quad_app test
-	#ruby scripts/tests/test_safety_checks.rb
-	#ruby scripts/tests/test_unix_uart.rb
+	ruby scripts/tests/test_safety_checks.rb
+	ruby scripts/tests/test_unix_uart.rb
 
 clean:
 	rm -rf $(INCDIR) $(LIBDIR) $(OUTDIR) $(EXEDIR)
diff --git a/quad/scripts/tests/test_safety_checks.rb b/quad/scripts/tests/test_safety_checks.rb
index f4e690495..76cf66b07 100644
--- a/quad/scripts/tests/test_safety_checks.rb
+++ b/quad/scripts/tests/test_safety_checks.rb
@@ -78,10 +78,14 @@ def check_led(on)
   assert_equal(led, on)
 end
 
+puts("Setting up...")
+
 script_dir = File.expand_path(File.dirname(__FILE__))
 bin_dir = script_dir + "/../../bin/"
 Dir.chdir(bin_dir)
 
+sleep 1
+
 # Start virtual quad
 quad = Process.spawn("./virt-quad")
 
@@ -92,8 +96,8 @@ sleep 1
 #################
 
 begin
-  puts("beginning tests")
-  
+  puts("Beginning tests...")
+
   # Set gravity
   File.write(I2C_MPU_ACCEL_Z, -1 * GRAVITY)
 
diff --git a/quad/scripts/tests/test_unix_uart.rb b/quad/scripts/tests/test_unix_uart.rb
index 6621744e3..cca364d93 100644
--- a/quad/scripts/tests/test_unix_uart.rb
+++ b/quad/scripts/tests/test_unix_uart.rb
@@ -17,10 +17,14 @@ require 'test/unit/assertions'
 require 'thread'
 include Test::Unit::Assertions
 
+puts("Setting up...")
+
 script_dir = File.expand_path(File.dirname(__FILE__))
 bin_dir = script_dir + "/../../bin/"
 Dir.chdir(bin_dir)
 
+sleep 1
+
 # Start virtual quad
 quad = Process.spawn("./virt-quad")
 
@@ -32,6 +36,8 @@ sleep 1
 
 begin
 
+  puts("Beginning tests...")
+
   # Flip gear on
   File.write(GEAR, GEAR_ON)
   sleep 0.015
-- 
GitLab