Skip to content

Commit

Permalink
Applied -DTEST to compilation of test and test support files in order…
Browse files Browse the repository at this point in the history
… to apply test build-specific stuff, if needed.
  • Loading branch information
barneywilliams committed Apr 13, 2015
1 parent 08364c9 commit 964a9bf
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions scripts/create_makefile.rb
Expand Up @@ -34,6 +34,7 @@
mkfile.puts "BUILD_DIR ?= ./build"
mkfile.puts "SRC_DIR ?= ./src"
mkfile.puts "TEST_DIR ?= ./test"
mkfile.puts "TEST_CFLAGS ?= -DTEST"
mkfile.puts "CMOCK_DIR ?= #{CMOCK_DIR}"
mkfile.puts "UNITY_DIR ?= #{UNITY_DIR}"
mkfile.puts "TEST_BUILD_DIR ?= ${BUILD_DIR}/test"
Expand Down Expand Up @@ -80,7 +81,7 @@

# Build runner
mkfile.puts "#{runner_obj}: #{runner_source}"
mkfile.puts "\t${CC} -o $@ -c $< -I #{SRC_DIR} -I #{MOCKS_DIR} -I #{UNITY_SRC} -I #{CMOCK_SRC}"
mkfile.puts "\t${CC} -o $@ -c $< ${TEST_CFLAGS} -I #{SRC_DIR} -I #{MOCKS_DIR} -I #{UNITY_SRC} -I #{CMOCK_SRC}"
mkfile.puts ""

# Collect mocks to generate
Expand Down Expand Up @@ -113,7 +114,7 @@

# Build test suite
mkfile.puts "#{test_obj}: #{test} #{module_obj} #{mock_objs.join(' ')}"
mkfile.puts "\t${CC} -o $@ -c $< -I #{SRC_DIR} -I #{UNITY_SRC} -I #{CMOCK_SRC} -I #{MOCKS_DIR}"
mkfile.puts "\t${CC} -o $@ -c $< ${TEST_CFLAGS} -I #{SRC_DIR} -I #{UNITY_SRC} -I #{CMOCK_SRC} -I #{MOCKS_DIR}"
mkfile.puts ""

# Build test suite executable
Expand Down Expand Up @@ -142,7 +143,7 @@
mkfile.puts ""

mkfile.puts "#{mock_obj}: #{mock_src} #{mock_header}"
mkfile.puts "\t${CC} -o $@ -c $< -I #{MOCKS_DIR} -I #{SRC_DIR} -I #{UNITY_SRC} -I #{CMOCK_SRC}"
mkfile.puts "\t${CC} -o $@ -c $< ${TEST_CFLAGS} -I #{MOCKS_DIR} -I #{SRC_DIR} -I #{UNITY_SRC} -I #{CMOCK_SRC}"
mkfile.puts ""
end

Expand Down

0 comments on commit 964a9bf

Please sign in to comment.