add spec for building with a header file

This commit is contained in:
Josh Holtrop 2013-06-29 20:27:45 -04:00
parent 7983c03a0b
commit e66422f32f
3 changed files with 22 additions and 0 deletions

View File

@ -0,0 +1,7 @@
#include <stdio.h>
#include "header.h"
int main(int argc, char *argv[])
{
printf("The value is %d\n", VALUE);
}

View File

@ -0,0 +1,6 @@
#ifndef HEADER_H
#define HEADER_H
#define VALUE 33
#endif

View File

@ -72,4 +72,13 @@ describe Rscons do
`./simple`.should =~ /This is a modified C program/
end
end
it 'builds a C program with a header file' do
setup_testdir(['header.c', 'header.h']) do
env = Rscons::Environment.new
env.Program('header', 'header.c')
File.exist?('header.o').should be_true
`./header`.should =~ /The value is 33/
end
end
end