diff --git a/ci-test.sh b/ci-test.sh index c79ad9703580d64f4db35e914c7d5c2eb7134fb6..2b8060ce46483f7f59862936c1f69ff30e6c68bc 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 b5527481519cb1d1c611395e7202833bdbdb042a..f27a39d37141e31878c324788ef9c141db241be5 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 f4e6904955db2d2fd99a220c6c79257e4ed4956a..4d81d3372be084e874b1112b22ccdf56a0238e9f 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) @@ -132,7 +136,7 @@ begin puts("Check that the LED turns on when gear is flipped on") # (motors should still be off because our throttle is low) File.write(GEAR, GEAR_ON) - sleep 0.020 + sleep 0.050 check_led 1 check_motors_are_off @@ -146,7 +150,7 @@ begin # Check that gear switch kills the motors # (and that light goes off) File.write(GEAR, GEAR_OFF) - sleep 0.040 + sleep 0.050 check_motors_are_off check_led 0 @@ -155,7 +159,7 @@ begin # Check that we can resume flight File.write(GEAR, GEAR_ON) - sleep 0.040 + sleep 0.050 check_led 1 sleep 1 diff --git a/quad/scripts/tests/test_unix_uart.rb b/quad/scripts/tests/test_unix_uart.rb index 6621744e33f2a789bf191b33a58586b769f533f4..cca364d9343416e31e0b15ef8d65a4b73bcd4b6c 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