add spec for building with a header file

This commit is contained in:
josh committed 2013-06-29 20:27:45 -04:00
1 parent 7983c03a0b
commit e66422f32f
3 files changed
+22

No files matched your search

+7
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);
}
+6
View File
@@ -0,0 +1,6 @@
#ifndef HEADER_H
#define HEADER_H
#define VALUE 33
#endif
+9
View File
@@ -72,4 +72,13 @@ describe Rscons do
`./simple`.should =~ /This is a modified C program/ `./simple`.should =~ /This is a modified C program/
end end
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 end