How can build systems to be unittested?

When you're tinkering with e.g. Make, or ant, or any other build tool, you're actually writing code.

Why is there no 'MUnit' or 'ANTUnit' to test these pieces of code? It makes sense to do so, for any bug in your project build system causes huge delays and frustration to the people who use it.

An example (note: this will probably not even work - untested, and that's not my focus either here):

#makefile v0
all: main.out

main.out: main.o x.o y.o
    g++ $^ -o main.out

%.o: %.cpp
    g++ -Wall $?

But now I want my object files in a separate build folder:

#makefile v1
all: main.out

main.out: $(addprefix build/,main.o x.o y.o)
    g++ $^ -o main.out

build/%o: %.cpp
    g++ Wall $< -o $@

Oh yes! that works! Commit! Commit!

(but... the Continuous Integration server has no 'build' folder yet...)

Oh noooo... the team's build failed... I'm to blame... Stupid!

It would be great to be able to specify a mock project, a mock folder-structure, and then call make all, and verify that main.out is there (and can be run)

So here the question:

What are my options to 'unittest' my make scripts? Am I doomed to write a gazillion test-shell-scripts, or does something exist already?


If you are using Ant, then there is AntUnit. I use it and it works.

I'm not aware of and cannot find a unit testing framework for Make. You could consider creating your own.

Need Your Help

GWT - Oracle JDBC Connection problems

java oracle gwt jdbc

I am having great difficulty making a connection to an Oracle Database OJDBC.

Newline (\n) not working in swift

ios string swift

I am working on my first iOS application with swift. I need to show some details in UILabel with Newline(\n). Its working good when I assign directly like below