Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.c > #67983

Re: Use m4 and make to compose C programs

From Ian Collins <ian-news@hotmail.com>
Newsgroups comp.lang.c
Subject Re: Use m4 and make to compose C programs
Date 2015-08-22 18:01 +1200
Message-ID <d3qhhaFed1gU1@mid.individual.net> (permalink)
References <ff7f0b6d-56e9-47a7-898f-b5fec727fc70@googlegroups.com>

Show all headers | View raw


luser droog wrote:
> I'm trying to build my new project in a very modular fashion,
> with unit tests for each module.
> https://github.com/luser-dr00g/inca/tree/master/olmec
>
> Starting with the minimal unit-testing framework from here:
> http://www.jera.com/techinfo/jtns/jtn002.html
> I've add main() functions to my 2 modules io.c and st.c
> guarded by #ifdef TESTMODULE.
>
> Without TESTMODULE defined, the module will compile to a .o
> file and link normally with the rest of the application
> (once that's written). A testing program of a single unit
> is coordinated by a short "test" source file. The io_test.c
> program looks like this
>
> #define TESTMODULE
> #include "io.c"

I'll snip here and ask the obvious question: why can't you just unit 
test the code as is?

Everything I write has unit tests (I use TDD) and I never have anything 
conditionally compiled.

-- 
Ian Collins

Back to comp.lang.c | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Use m4 and make to compose C programs luser droog <luser.droog@gmail.com> - 2015-08-21 22:53 -0700
  Re: Use m4 and make to compose C programs Ian Collins <ian-news@hotmail.com> - 2015-08-22 18:01 +1200
    Re: Use m4 and make to compose C programs luser droog <luser.droog@gmail.com> - 2015-08-21 23:43 -0700
      Re: Use m4 and make to compose C programs Ian Collins <ian-news@hotmail.com> - 2015-08-22 19:22 +1200
        Re: Use m4 and make to compose C programs luser droog <luser.droog@gmail.com> - 2015-08-23 13:13 -0700
          Re: Use m4 and make to compose C programs Ian Collins <ian-news@hotmail.com> - 2015-08-24 11:15 +1200
            Re: Use m4 and make to compose C programs Malcolm McLean <malcolm.mclean5@btinternet.com> - 2015-08-23 16:52 -0700
              Re: Use m4 and make to compose C programs Richard Damon <Richard@Damon-Family.org> - 2015-08-23 21:27 -0400
                Re: Use m4 and make to compose C programs Malcolm McLean <malcolm.mclean5@btinternet.com> - 2015-08-24 00:43 -0700
                Re: Use m4 and make to compose C programs <william@wilbur.25thandClement.com> - 2015-08-27 12:20 -0700
            Re: Use m4 and make to compose C programs luser droog <luser.droog@gmail.com> - 2015-08-26 23:22 -0700
              Re: Use m4 and make to compose C programs luser droog <luser.droog@gmail.com> - 2015-08-26 23:40 -0700

csiph-web