12 Dec 2010, 15:38
Generic-user-small

acheese2002 (7 posts)

can anyone explain the makefiles(in jgade-code/code/makefile—i guess this is the one that runs somewhat) or what files i would need to start my own test suite using unity/cppunity.

12 Dec 2010, 16:26
James2009_pragsmall

James Grenning (130 posts)

Here is a copy of the top makefile

CPPUTEST_HOME = $(pwd)

all: CppUTest/lib/libCppUTest.a
make -i -C CppUTest
make -i -C t0
make -i -C t1
make -i -C t2
make -i -C t3
make -i -C SandBox
make -i -f MakefileCppUTest.mk
make -i -f MakefileUnity.mk




clean:
make -i -C t0 clean
make -i -C t1 clean
make -i -C t2 clean
make -i -C t3 clean
make -i -C SandBox clean
make -i -f MakefileCppUTest.mk clean
make -i -f MakefileUnity.mk clean



CppUTest/lib/libCppUTest.a:
pwd
make -i -C CppUTest

It basically runs all the makefiles. The t0, t1, t2, and t3 directories are an evolution of the code base.

To start your own, you can go into the SandBox directory.

I’ll say more in the book about how to use the code.

13 Dec 2010, 05:01
Generic-user-small

acheese2002 (7 posts)

when running the main makefile did you want a missing file to break the build? I’m getting after a several test are run
/bin/sh: ./BookCode_Unity_tests: a No such file or directory

13 Dec 2010, 05:22
James2009_pragsmall

James Grenning (130 posts)

Hi again. Can you tell me the environment you compile in.

do a gcc -v

then, do a make clean, then make all and post the output.

14 Dec 2010, 01:34
Generic-user-small

acheese2002 (7 posts)

compiling LightControllerTest.cpp
compiling LightSchedulerTest.cpp
compiling RandomMinuteTest.cpp
compiling FakeTimeServiceTest.cpp
compiling LightDriverSpyTest.cpp
compiling FakeRandomMinute.c
compiling FakeTimeService.c
compiling LightDriverSpy.c
compiling LightController.c
compiling LightScheduler.c
compiling RandomMinute.c
compiling AcmeWirelessLightDriver.c
compiling MemMappedLightDriver.c
compiling X10LightDriver.c
compiling TimeService.c
compiling TimeService_Helpers.c
compiling common.c
Building archive lib/libt1.a
ar: creating lib/libt1.a
a – objs/src/HomeAutomation/LightController.o
a – objs/src/HomeAutomation/LightScheduler.o
a – objs/src/HomeAutomation/RandomMinute.o
a – objs/src/devices/AcmeWirelessLightDriver.o
a – objs/src/devices/MemMappedLightDriver.o
a – objs/src/devices/X10LightDriver.o
a – objs/src/util/TimeService.o
a – objs/src/util/TimeService_Helpers.o
a – objs/src/util/common.o
Linking t1_tests
Running t1_tests
............................................
OK (44 tests, 44 ran, 210 checks, 0 ignored, 0 filtered out, 6 ms)

make1: Leaving directory `/cygdrive/c/Users/VCOX/Books/Engineering/Embedded/Em
bedded Samples/test_driven_embedded_development/jgade-code/code/t1’
make -i -C t2
make1: Entering directory `/cygdrive/c/Users/VCOX/Books/Engineering/Embedded/E
mbedded Samples/test_driven_embedded_development/jgade-code/code/t2’
compiling AllTests.cpp
compiling TimeTest.cpp
compiling AcmeWirelessLightDriverTest.cpp
compiling MemMappedLightDriverTest.cpp
compiling X10LightDriverTest.cpp
compiling LightControllerTest.cpp
compiling LightSchedulerTest.cpp
compiling RandomMinuteGeneratorTest.cpp
compiling FakeTimeServiceTest.cpp
compiling LightDriverSpyTest.cpp
compiling FakeRandomMinute.c
compiling FakeTimeService.c
compiling LightDriverSpy.c
compiling RuntimeErrorStub.c
compiling LightController.c
compiling LightScheduler.c
compiling RandomMinute.c
compiling AcmeWirelessLightDriver.c
compiling MemMappedLightDriver.c
compiling X10LightDriver.c
compiling Time.c
compiling TimeService.c
compiling common.c
Building archive lib/libt2.a
ar: creating lib/libt2.a
a – objs/src/HomeAutomation/LightController.o
a – objs/src/HomeAutomation/LightScheduler.o
a – objs/src/HomeAutomation/RandomMinute.o
a – objs/src/devices/AcmeWirelessLightDriver.o
a – objs/src/devices/MemMappedLightDriver.o
a – objs/src/devices/X10LightDriver.o
a – objs/src/util/Time.o
a – objs/src/util/TimeService.o
a – objs/src/util/common.o
Linking t2_tests
Running t2_tests
............................................
OK (44 tests, 44 ran, 184 checks, 0 ignored, 0 filtered out, 6 ms)

make1: Leaving directory `/cygdrive/c/Users/VCOX/Books/Engineering/Embedded/Em
bedded Samples/test_driven_embedded_development/jgade-code/code/t2’
make -i -C t3
make1: Entering directory `/cygdrive/c/Users/VCOX/Books/Engineering/Embedded/E
mbedded Samples/test_driven_embedded_development/jgade-code/code/t3’
compiling AllTests.cpp
compiling AcmeWirelessLightDriverTest.cpp
compiling LightDriverTest.cpp
compiling MemMappedLightDriverTest.cpp
compiling X10LightDriverTest.cpp
compiling LightControllerTest.cpp
compiling LightSchedulerTest.cpp
compiling RandomMinuteGeneratorTest.cpp
compiling FakeTimeServiceTest.cpp
compiling LightDriverSpyTest.cpp
compiling FakeRandomMinute.c
compiling FakeTimeService.c
compiling LightDriverSpy.c
compiling LightController.c
compiling LightScheduler.c
compiling RandomMinuteGenerator.c
compiling AcmeWirelessLightDriver.c
compiling LightDriver.c
compiling MemMappedLightDriver.c
compiling X10LightDriver.c
compiling TimeService.c
compiling TimeService_Helpers.c
compiling common.c
Building archive lib/libt3.a
ar: creating lib/libt3.a
a – objs/src/HomeAutomation/LightController.o
a – objs/src/HomeAutomation/LightScheduler.o
a – objs/src/HomeAutomation/RandomMinuteGenerator.o
a – objs/src/devices/AcmeWirelessLightDriver.o
a – objs/src/devices/LightDriver.o
a – objs/src/devices/MemMappedLightDriver.o
a – objs/src/devices/X10LightDriver.o
a – objs/src/util/TimeService.o
a – objs/src/util/TimeService_Helpers.o
a – objs/src/util/common.o
Linking t3_tests
Running t3_tests
...............................................
OK (47 tests, 47 ran, 176 checks, 0 ignored, 0 filtered out, 6 ms)

make1: Leaving directory `/cygdrive/c/Users/VCOX/Books/Engineering/Embedded/Em
bedded Samples/test_driven_embedded_development/jgade-code/code/t3’
make -i -C SandBox
make1: Entering directory `/cygdrive/c/Users/VCOX/Books/Engineering/Embedded/E
mbedded Samples/test_driven_embedded_development/jgade-code/code/SandBox’
make -i -C tests
make2: Entering directory `/cygdrive/c/Users/VCOX/Books/Engineering/Embedded/E
mbedded Samples/test_driven_embedded_development/jgade-code/code/SandBox/tests’
compiling AllTests.cpp
compiling LedDriverTest.cpp
compiling LedDriver.c
Building archive lib/libSandBox_CppUTest.a
ar: creating lib/libSandBox_CppUTest.a
a – objs/../src/LedDriver/LedDriver.o
Linking SandBox_CppUTest_tests
Running SandBox_CppUTest_tests
.
OK (1 tests, 1 ran, 0 checks, 0 ignored, 0 filtered out, 1 ms)

make2: Leaving directory `/cygdrive/c/Users/VCOX/Books/Engineering/Embedded/Em
bedded Samples/test_driven_embedded_development/jgade-code/code/SandBox/tests’
make -i -C unity
make2: Entering directory `/cygdrive/c/Users/VCOX/Books/Engineering/Embedded/E
mbedded Samples/test_driven_embedded_development/jgade-code/code/SandBox/unity’
compiling AllTests.c
compiling LedDriverTest.c
compiling LedDriverTestRunner.c
compiling unity.c
compiling unity_fixture.c
compiling unity_output_Spy.c
compiling testunity.c
cc1: warnings being treated as errors
../../unity/harness/tests/testunity.c: In function `testUIntsNotWithinDelta’:
../../unity/harness/tests/testunity.c:693: error: this decimal constant is unsig
ned only in ISO C90
../../unity/harness/tests/testunity.c: In function `testHEX32sNotWithinDelta’:
../../unity/harness/tests/testunity.c:742: error: this decimal constant is unsig
ned only in ISO C90
make2: [objs/../../unity/harness/tests/testunity.o] Error 1 (ignored)
compiling testunity_fixture.c
compiling testunity_runner.c
compiling unity_fixture_Test.c
compiling unity_fixture_TestRunner.c
compiling unity_output_SpyTest.c
compiling unity_output_SpyTestRunner.c
compiling LedDriver.c
Building archive lib/libSandBox_Unity.a
ar: creating lib/libSandBox_Unity.a
a – objs/../src/LedDriver/LedDriver.o
Linking SandBox_Unity_tests
cc: objs/../../unity/harness/tests/testunity.o: No such file or directory
make2: [SandBox_Unity_tests] Error 1 (ignored)
Running SandBox_Unity_tests
/bin/sh: ./SandBox_Unity_tests: No such file or directory
make2: [all] Error 127 (ignored)
make2: Leaving directory `/cygdrive/c/Users/VCOX/Books/Engineering/Embedded/Em
bedded Samples/test_driven_embedded_development/jgade-code/code/SandBox/unity’
make1: Leaving directory `/cygdrive/c/Users/VCOX/Books/Engineering/Embedded/Em
bedded Samples/test_driven_embedded_development/jgade-code/code/SandBox’
make -i -f MakefileCppUTest.mk
make1: Entering directory `/cygdrive/c/Users/VCOX/Books/Engineering/Embedded/E
mbedded Samples/test_driven_embedded_development/jgade-code/code’
compiling FakeMicroTimeTest.cpp
compiling FormatOutputSpyTest.cpp
compiling MockIOTest.cpp
compiling FakeMicroTime.c
compiling FormatOutputSpy.c
compiling MockIO.c
compiling RuntimeErrorStub.c
compiling LedDriverTest.cpp
compiling SprintfTest.cpp
compiling CircularBufferPrintTest.cpp
compiling CircularBufferTest.cpp
compiling FlashTest.cpp
compiling LegacyFlashTest.cpp
compiling RtcTimeTest.cpp
compiling FakeLightControllerTest.cpp
compiling FakeTimeServiceTest.cpp
compiling LightSchedulerTest.cpp
compiling RandomMinuteGeneratorTest.cpp
compiling FakeLightController.c
compiling FakeTimeService.c
compiling DvRecorderTest.cpp
compiling AllTests.cpp
compiling LightScheduler.c
compiling RandomMinute.c
compiling CircularBuffer.c
compiling Utils.c
compiling LedDriver.c
compiling DvRecorder.c
compiling Flash.c
compiling IO.c
compiling RtcTime.c
Building archive lib/libBookCode_CppUTest.a
ar: creating lib/libBookCode_CppUTest.a
a – objs/src/HomeAutomation/LightScheduler.o
a – objs/src/HomeAutomation/RandomMinute.o
a – objs/src/util/CircularBuffer.o
a – objs/src/util/Utils.o
a – objs/src/LedDriver/LedDriver.o
a – objs/src/dvr/DvRecorder.o
a – objs/src/IO/Flash.o
a – objs/src/IO/IO.o
a – objs/src/zune/RtcTime.o
Linking BookCode_CppUTest_tests
Running BookCode_CppUTest_tests
...........................!......................
..................................................
..........................
OK (126 tests, 125 ran, 544 checks, 1 ignored, 0 filtered out, 12 ms)

make1: Leaving directory `/cygdrive/c/Users/VCOX/Books/Engineering/Embedded/Em
bedded Samples/test_driven_embedded_development/jgade-code/code’
make -i -f MakefileUnity.mk
make1: Entering directory `/cygdrive/c/Users/VCOX/Books/Engineering/Embedded/E
mbedded Samples/test_driven_embedded_development/jgade-code/code’
compiling AllTests.c
compiling LedDriverTest.c
compiling LedDriverTestRunner.c
compiling SprintfTest.c
compiling SprintfTestRunner.c
compiling unity.c
compiling unity_fixture.c
compiling unity_output_Spy.c
compiling testunity.c
cc1: warnings being treated as errors
unity/harness/tests/testunity.c: In function `testUIntsNotWithinDelta’:
unity/harness/tests/testunity.c:693: error: this decimal constant is unsigned on
ly in ISO C90
unity/harness/tests/testunity.c: In function `testHEX32sNotWithinDelta’:
unity/harness/tests/testunity.c:742: error: this decimal constant is unsigned on
ly in ISO C90
make1: [objs/unity/harness/tests/testunity.o] Error 1 (ignored)
compiling testunity_fixture.c
compiling testunity_runner.c
compiling unity_fixture_Test.c

VCOX@VCOX-PC /cygdrive/c/Users/VCOX/Books/Engineering/Embedded/Embedded Samples/
test_driven_embedded_development/jgade-code/code
$ gcc v
Using built-in specs.
Target: i686-pc-cygwin
Configured with: /gnu/gcc/releases/respins/4.3.4-3a/gcc4-4.3.4-3/src/gcc-4.3.4/c
onfigure—srcdir=/gnu/gcc/releases/respins/4.3.4-3a/gcc4-4.3.4-3/src/gcc-4.3.4
-prefix=/usr -exec-prefix=/usr—bindir=/usr/bin—sbindir=/usr/sbin—libexec
dir=/usr/lib—datadir=/usr/share—localstatedir=/var—sysconfdir=/etc—infod
ir=/usr/share/info—mandir=/usr/share/man—datadir=/usr/share—infodir=/usr/s
hare/info—mandir=/usr/share/man -v—with-gmp=/usr—with-mpfr=/usr—enable-b
ootstrap—enable-version-specific-runtime-libs—with-slibdir=/usr/bin—libexe
cdir=/usr/lib—enable-static—enable-shared—enable-shared-libgcc—disable-_
_cxa_atexit—with-gnu-ld—with-gnu-as—with-dwarf2—disable-sjlj-exceptions
-enable-languages=ada,c,c+,fortran,java,objc,obj-c+—disable-symvers—enabl
e-libjava—program-suffix=-4—enable-libgomp—enable-libssp—enable-libada -
-enable-threads=posix—with-arch=i686—with-tune=generic—enable-libgcj-subli
bs CC=gcc-4 CXX=g+-4 CC_FOR_TARGET=gcc-4 CXX_FOR_TARGET=g+-4 GNATMAKE_FOR_TARG
ET=gnatmake GNATBIND_FOR_TARGET=gnatbind—with-ecj-jar=/usr/share/java/ecj.jar
Thread model: posix
gcc version 4.3.4 20090804 (release) 1 (GCC)

VCOX@VCOX-PC /cygdrive/c/Users/VCOX/Books/Engineering/Embedded/Embedded Samples/
test_driven_embedded_development/jgade-code/code

expected < 3 0x00000003>
but was  <-1 0xffffffff>

.......
tests/HomeAutomation/RandomMinuteTest.cpp:71: error: Failure in TEST(RandomMinut
e, AllValuesPossible) CHECK failed

...........
Errors (17 failures, 49 tests, 49 ran, 338 checks, 0 ignored, 0 filtered out, 34 ms)

make1: [all] Error 17 (ignored)
make1: Leaving directory `/cygdrive/c/Users/VCOX/Books/Engineering/Embedded/Em
bedded Samples/test_driven_embedded_development/jgade-code/code/t0’
make -i -C t1
make1: Entering directory `/cygdrive/c/Users/VCOX/Books/Engineering/Embedded/E
mbedded Samples/test_driven_embedded_development/jgade-code/code/t1’
compiling AllTests.cpp
compiling TimeServiceHelpersTest.cpp
compiling AcmeWirelessLightDriverTest.cpp
compiling MemMappedLightDriverTest.cpp
compiling X10LightDriverTest.cpp
compiling LightControllerTest.cpp
compiling LightSchedulerTest.cpp
compiling RandomMinuteTest.cpp
compiling FakeTimeServiceTest.cpp
compiling LightDriverSpyTest.cpp
compiling FakeRandomMinute.c
compiling FakeTimeService.c
compiling LightDriverSpy.c
compiling LightController.c
compiling LightScheduler.c
compiling RandomMinute.c
compiling AcmeWirelessLightDriver.c
compiling MemMappedLightDriver.c
compiling X10LightDriver.c
compiling TimeService.c
compiling TimeService_Helpers.c
compiling common.c
Building archive lib/libt1.a
ar: creating lib/libt1.a
a – objs/src/HomeAutomation/LightController.o
a – objs/src/HomeAutomation/LightScheduler.o
a – objs/src/HomeAutomation/RandomMinute.o
a – objs/src/devices/AcmeWirelessLightDriver.o
a – objs/src/devices/MemMappedLightDriver.o
a – objs/src/devices/X10LightDriver.o
a – objs/src/util/TimeService.o
a – objs/src/util/TimeService_Helpers.o
a – objs/src/util/common.o
Linking t1_tests
Running t1_tests
............................................
OK (44 tests, 44 ran, 210 checks, 0 ignored, 0 filtered out, 5 ms)

make1: Leaving directory `/cygdrive/c/Users/VCOX/Books/Engineering/Embedded/Em
bedded Samples/test_driven_embedded_development/jgade-code/code/t1’
make -i -C t2
make1: Entering directory `/cygdrive/c/Users/VCOX/Books/Engineering/Embedded/E
mbedded Samples/test_driven_embedded_development/jgade-code/code/t2’
compiling AllTests.cpp
compiling TimeTest.cpp
compiling AcmeWirelessLightDriverTest.cpp
compiling MemMappedLightDriverTest.cpp
compiling X10LightDriverTest.cpp
compiling LightControllerTest.cpp
compiling LightSchedulerTest.cpp
compiling RandomMinuteGeneratorTest.cpp
compiling FakeTimeServiceTest.cpp
compiling LightDriverSpyTest.cpp
compiling FakeRandomMinute.c
compiling FakeTimeService.c
compiling LightDriverSpy.c
compiling RuntimeErrorStub.c
compiling LightController.c
compiling LightScheduler.c
compiling RandomMinute.c
compiling AcmeWirelessLightDriver.c
compiling MemMappedLightDriver.c
compiling X10LightDriver.c
compiling Time.c
compiling TimeService.c
compiling common.c
Building archive lib/libt2.a
ar: creating lib/libt2.a
a – objs/src/HomeAutomation/LightController.o
a – objs/src/HomeAutomation/LightScheduler.o
a – objs/src/HomeAutomation/RandomMinute.o
a – objs/src/devices/AcmeWirelessLightDriver.o
a – objs/src/devices/MemMappedLightDriver.o
a – objs/src/devices/X10LightDriver.o
a – objs/src/util/Time.o
a – objs/src/util/TimeService.o
a – objs/src/util/common.o
Linking t2_tests
Running t2_tests
............................................
OK (44 tests, 44 ran, 184 checks, 0 ignored, 0 filtered out, 5 ms)

make1: Leaving directory `/cygdrive/c/Users/VCOX/Books/Engineering/Embedded/Em
bedded Samples/test_driven_embedded_development/jgade-code/code/t2’
make -i -C t3
make1: Entering directory `/cygdrive/c/Users/VCOX/Books/Engineering/Embedded/E
mbedded Samples/test_driven_embedded_development/jgade-code/code/t3’
compiling AllTests.cpp
compiling AcmeWirelessLightDriverTest.cpp
compiling LightDriverTest.cpp
compiling MemMappedLightDriverTest.cpp
compiling X10LightDriverTest.cpp
compiling LightControllerTest.cpp
compiling LightSchedulerTest.cpp
compiling RandomMinuteGeneratorTest.cpp
compiling FakeTimeServiceTest.cpp
compiling LightDriverSpyTest.cpp
compiling FakeRandomMinute.c
compiling FakeTimeService.c
compiling LightDriverSpy.c
compiling LightController.c
compiling LightScheduler.c
compiling RandomMinuteGenerator.c
compiling AcmeWirelessLightDriver.c
compiling LightDriver.c
compiling MemMappedLightDriver.c
compiling X10LightDriver.c
compiling TimeService.c
compiling TimeService_Helpers.c
compiling common.c
Building archive lib/libt3.a
ar: creating lib/libt3.a
a – objs/src/HomeAutomation/LightController.o
a – objs/src/HomeAutomation/LightScheduler.o
a – objs/src/HomeAutomation/RandomMinuteGenerator.o
a – objs/src/devices/AcmeWirelessLightDriver.o
a – objs/src/devices/LightDriver.o
a – objs/src/devices/MemMappedLightDriver.o
a – objs/src/devices/X10LightDriver.o
a – objs/src/util/TimeService.o
a – objs/src/util/TimeService_Helpers.o
a – objs/src/util/common.o
Linking t3_tests
Running t3_tests
...............................................
OK (47 tests, 47 ran, 176 checks, 0 ignored, 0 filtered out, 7 ms)

make1: Leaving directory `/cygdrive/c/Users/VCOX/Books/Engineering/Embedded/Em
bedded Samples/test_driven_embedded_development/jgade-code/code/t3’
make -i -C SandBox
make1: Entering directory `/cygdrive/c/Users/VCOX/Books/Engineering/Embedded/E
mbedded Samples/test_driven_embedded_development/jgade-code/code/SandBox’
make -i -C tests
make2: Entering directory `/cygdrive/c/Users/VCOX/Books/Engineering/Embedded/E
mbedded Samples/test_driven_embedded_development/jgade-code/code/SandBox/tests’
compiling AllTests.cpp
compiling LedDriverTest.cpp
compiling LedDriver.c
Building archive lib/libSandBox_CppUTest.a
ar: creating lib/libSandBox_CppUTest.a
a – objs/../src/LedDriver/LedDriver.o
Linking SandBox_CppUTest_tests
Running SandBox_CppUTest_tests
.
OK (1 tests, 1 ran, 0 checks, 0 ignored, 0 filtered out, 1 ms)

make2: Leaving directory `/cygdrive/c/Users/VCOX/Books/Engineering/Embedded/Em
bedded Samples/test_driven_embedded_development/jgade-code/code/SandBox/tests’
make -i -C unity
make2: Entering directory `/cygdrive/c/Users/VCOX/Books/Engineering/Embedded/E
mbedded Samples/test_driven_embedded_development/jgade-code/code/SandBox/unity’
compiling AllTests.c
compiling LedDriverTest.c
compiling LedDriverTestRunner.c
compiling unity.c
compiling unity_fixture.c
compiling unity_output_Spy.c
compiling testunity.c
cc1: warnings being treated as errors
../../unity/harness/tests/testunity.c: In function `testUIntsNotWithinDelta’:
../../unity/harness/tests/testunity.c:693: error: this decimal constant is unsig
ned only in ISO C90
../../unity/harness/tests/testunity.c: In function `testHEX32sNotWithinDelta’:
../../unity/harness/tests/testunity.c:742: error: this decimal constant is unsig
ned only in ISO C90
make2: [objs/../../unity/harness/tests/testunity.o] Error 1 (ignored)
compiling testunity_fixture.c
compiling testunity_runner.c
compiling unity_fixture_Test.c
compiling unity_fixture_TestRunner.c
compiling unity_output_SpyTest.c
compiling unity_output_SpyTestRunner.c
compiling LedDriver.c
Building archive lib/libSandBox_Unity.a
ar: creating lib/libSandBox_Unity.a
a – objs/../src/LedDriver/LedDriver.o
Linking SandBox_Unity_tests
cc: objs/../../unity/harness/tests/testunity.o: No such file or directory
make2: [SandBox_Unity_tests] Error 1 (ignored)
Running SandBox_Unity_tests
/bin/sh: ./SandBox_Unity_tests: No such file or directory
make2: [all] Error 127 (ignored)
make2: Leaving directory `/cygdrive/c/Users/VCOX/Books/Engineering/Embedded/Em
bedded Samples/test_driven_embedded_development/jgade-code/code/SandBox/unity’
make1: Leaving directory `/cygdrive/c/Users/VCOX/Books/Engineering/Embedded/Em
bedded Samples/test_driven_embedded_development/jgade-code/code/SandBox’
make -i -f MakefileCppUTest.mk
make1: Entering directory `/cygdrive/c/Users/VCOX/Books/Engineering/Embedded/E
mbedded Samples/test_driven_embedded_development/jgade-code/code’
compiling FakeMicroTimeTest.cpp
compiling FormatOutputSpyTest.cpp
compiling MockIOTest.cpp
compiling FakeMicroTime.c
compiling FormatOutputSpy.c
compiling MockIO.c
compiling RuntimeErrorStub.c
compiling LedDriverTest.cpp
compiling SprintfTest.cpp
compiling CircularBufferPrintTest.cpp
compiling CircularBufferTest.cpp
compiling FlashTest.cpp
compiling LegacyFlashTest.cpp
compiling RtcTimeTest.cpp
compiling FakeLightControllerTest.cpp
compiling FakeTimeServiceTest.cpp
compiling LightSchedulerTest.cpp
compiling RandomMinuteGeneratorTest.cpp
compiling FakeLightController.c
compiling FakeTimeService.c
compiling DvRecorderTest.cpp
compiling AllTests.cpp
compiling LightScheduler.c
compiling RandomMinute.c
compiling CircularBuffer.c
compiling Utils.c
compiling LedDriver.c
compiling DvRecorder.c
compiling Flash.c
compiling IO.c
compiling RtcTime.c
Building archive lib/libBookCode_CppUTest.a
ar: creating lib/libBookCode_CppUTest.a
a – objs/src/HomeAutomation/LightScheduler.o
a – objs/src/HomeAutomation/RandomMinute.o
a – objs/src/util/CircularBuffer.o
a – objs/src/util/Utils.o
a – objs/src/LedDriver/LedDriver.o
a – objs/src/dvr/DvRecorder.o
a – objs/src/IO/Flash.o
a – objs/src/IO/IO.o
a – objs/src/zune/RtcTime.o
Linking BookCode_CppUTest_tests
Running BookCode_CppUTest_tests
...........................!......................
..................................................
..........................
OK (126 tests, 125 ran, 544 checks, 1 ignored, 0 filtered out, 11 ms)

make1: Leaving directory `/cygdrive/c/Users/VCOX/Books/Engineering/Embedded/Em
bedded Samples/test_driven_embedded_development/jgade-code/code’
make -i -f MakefileUnity.mk
make1: Entering directory `/cygdrive/c/Users/VCOX/Books/Engineering/Embedded/E
mbedded Samples/test_driven_embedded_development/jgade-code/code’
compiling AllTests.c
compiling LedDriverTest.c
compiling LedDriverTestRunner.c
compiling SprintfTest.c
compiling SprintfTestRunner.c
compiling unity.c
compiling unity_fixture.c
compiling unity_output_Spy.c
compiling testunity.c
cc1: warnings being treated as errors
unity/harness/tests/testunity.c: In function `testUIntsNotWithinDelta’:
unity/harness/tests/testunity.c:693: error: this decimal constant is unsigned on
ly in ISO C90
unity/harness/tests/testunity.c: In function `testHEX32sNotWithinDelta’:
unity/harness/tests/testunity.c:742: error: this decimal constant is unsigned on
ly in ISO C90
make1: [objs/unity/harness/tests/testunity.o] Error 1 (ignored)
compiling testunity_fixture.c
compiling testunity_runner.c
compiling unity_fixture_Test.c
compiling unity_fixture_TestRunner.c
compiling unity_output_SpyTest.c
compiling unity_output_SpyTestRunner.c
compiling RuntimeErrorStub.c
Building archive lib/libBookCode_Unity.a
ar: creating lib/libBookCode_Unity.a
a – objs/./src/LedDriver/LedDriver.o
Linking BookCode_Unity_tests
cc: objs/unity/harness/tests/testunity.o: No such file or directory
make1: [BookCode_Unity_tests] Error 1 (ignored)
Running BookCode_Unity_tests
/bin/sh: ./BookCode_Unity_tests: No such file or directory
make1: [all] Error 127 (ignored)
make1: Leaving directory `/cygdrive/c/Users/VCOX/Books/Engineering/Embedded/Em
bedded Samples/test_driven_embedded_development/jgade-code/code’

VCOX@VCOX-PC /cygdrive/c/Users/VCOX/Books/Engineering/Embedded/Embedded Samples/
test_driven_embedded_development/jgade-code/code
$

14 Dec 2010, 16:19
James2009_pragsmall

James Grenning (130 posts)

You can get the unit stuff to build by adding this to the MakefileUnity.mk
UNITY_WARNINGFLAGS = -Wall

Warnings won’t kill the compile.

For the make -C t0 test failures…

The tests found an initialization problem in t0/src/HomeAutomation/LightScheduler.c

1) add the following to the loops in LightScheduler.c functions: LightScheduler_ScheduleTurnOff, LightScheduler_ScheduleTurnOn

eventList[i].randomMinutes = 0;

2) In t0/tests/HomeAutomation/RandomMinuteTest.cpp change 255 to 500.

I’ve made the changes in the code base. But it might be a while before it is updated.

15 Dec 2010, 09:00
Generic-user-small

acheese2002 (7 posts)

im assuming the complex makefile(MakefileWorker) is for re-usability so the only file i would have to modify would be 2 the Makefiles

(1)COMPONENT_NAME , SRC_DIRS, TEST_SRC_DIRS, INCLUDE_DIRS
(2) remove all make options from (all:) except for my specific test directory and chose unity or cppunit as my testing suite

15 Dec 2010, 20:27
James2009_pragsmall

James Grenning (130 posts)

I’m not sure if I completely understand your statement. So sorry if I miss the target.

MakefileWorker.mk’s job is to make create a new test project easy. Note that there is a MakefileWorker.mk in the Unity/build directory and the CppUTest/build directory.

The Unity build problem has to do with some code that won’t compile on a 32 bit host machine because of -Werror (treat warnings as errors). Setting UNITY_WARNINGFLAGS gets rid of the default.

James

17 Dec 2010, 03:44
Generic-user-small

acheese2002 (7 posts)

Im trying to see how to modify the makefile to run my own test in my own directory.

17 Dec 2010, 12:51
James2009_pragsmall

James Grenning (130 posts)

Here are a few suggestions to getting started with your own code.



SandBox/unity or Sandbox/tests are probably the best places to start.



Put that directory next to the root of your source directory.



Put Unity or CppUTest in some directory… like /tools/CppUTest or tools/Unity



Build them using the makefile in their own directory.



Point your makefile at them using

UNITY_HOME = /tools/unity/harness

or

CPPUTEST_HOME = /tools/CppUTest

  You must be logged in to comment