diff --git a/spec/build_items/header.c b/spec/build_items/header.c new file mode 100644 index 0000000..fb2cef8 --- /dev/null +++ b/spec/build_items/header.c @@ -0,0 +1,7 @@ +#include +#include "header.h" + +int main(int argc, char *argv[]) +{ + printf("The value is %d\n", VALUE); +} diff --git a/spec/build_items/header.h b/spec/build_items/header.h new file mode 100644 index 0000000..4ed5196 --- /dev/null +++ b/spec/build_items/header.h @@ -0,0 +1,6 @@ +#ifndef HEADER_H +#define HEADER_H + +#define VALUE 33 + +#endif diff --git a/spec/build_tests_spec.rb b/spec/build_tests_spec.rb index 02cdaea..b06ccab 100644 --- a/spec/build_tests_spec.rb +++ b/spec/build_tests_spec.rb @@ -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