I love SCons so much

Feb 26, 2009 23:46

Here's the "makefile" for an example unit test:

# -*- python -*-
# test/unit/example

Import( 'testEnv' )

testEnv.UnitTest( 'example', ['factorial.cpp', 'fixture.cpp'] )
testEnv.UnitTest( 'example2.py' )
This is sufficient to compile the C program, and run both unit tests. If there was an install step, it wouldn't require any additional code in ( Read more... )

work, software, python, programming

Leave a comment

Comments 3

Import? freelikebeer February 27 2009, 21:26:53 UTC
with a capital 'i' ?

More substantively [because everyone around here is half-a$$ed] does fixture.cpp contain the unit tests for factorial.cpp? Where are the tests for example2.py spec'ed?

Reply

Re: Import? markgritter February 27 2009, 21:57:42 UTC
Import() is a SCons function.

example is a unit test program with two files: factorial.cpp and fixture.cpp. (I didn't link in a library with an external implementation, but a non-example case would. In this case both are unit test code, factorial.cpp just happens to have the factorial implementation as well)

example2.py is a separate unit test.

Reply

Re: Import? freelikebeer February 27 2009, 22:05:42 UTC
Import() is a SCons function.

Ooohh! Ahhh! I'm reading the SCons wiki now. Nice.

Reply


Leave a comment

Up