add spec for building with a header file
This commit is contained in:
parent
7983c03a0b
commit
e66422f32f
7
spec/build_items/header.c
Normal file
7
spec/build_items/header.c
Normal 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
spec/build_items/header.h
Normal file
6
spec/build_items/header.h
Normal file
@ -0,0 +1,6 @@
|
||||
#ifndef HEADER_H
|
||||
#define HEADER_H
|
||||
|
||||
#define VALUE 33
|
||||
|
||||
#endif
|
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user