Skip to content

Commit

Permalink
Merge pull request #78 from lifthrasiir/pie-tests
Browse files Browse the repository at this point in the history
Add tests for PIE support. (Continuation of issue #77)
  • Loading branch information
SimonKagstrom committed Mar 14, 2015
2 parents e9ec4d6 + 3021832 commit 9b27f0c
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 0 deletions.
4 changes: 4 additions & 0 deletions tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,10 @@ add_executable(issue31 daemon/test-issue31.cc)
add_executable(dlopen dlopen/dlopen.cc dlopen/dlopen-main.cc)
add_executable(s short-file.c)

add_executable(pie pie.c)
set_target_properties(pie PROPERTIES COMPILE_FLAGS "-g -fpie -fPIE")
set_target_properties(pie PROPERTIES LINK_FLAGS "-pie")

add_executable(main-tests-gcov ${main_tests_SRCS})
set_target_properties(main-tests-gcov PROPERTIES COMPILE_FLAGS "--coverage")
set_target_properties(main-tests-gcov PROPERTIES LINK_FLAGS "--coverage")
Expand Down
7 changes: 7 additions & 0 deletions tests/pie.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#include <stdio.h>

int main()
{
printf("Hello\n");
}

8 changes: 8 additions & 0 deletions tests/robot-framework/kcov-tests.txt
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,14 @@ short-filename
${rc}= Run and return RC ${kcov} ${out} ./s
Should be equal as integers ${rc} 99

pie
Run rm -rf ${out}/pie
${no_kcov_rc}= Run and return RC ./pie
${rc}= Run and return RC ${kcov} ${out} ./pie
Should be equal as integers ${rc} ${no_kcov_rc}
${output}= Run ${xml_lookup} ${out}/pie/cobertura.xml pie_c 5
Should Contain ${output} 1

global-constructors-test
Run rm -rf ${out}/global-constructors
${no_kcov_rc}= Run and return RC ./global-constructors
Expand Down

0 comments on commit 9b27f0c

Please sign in to comment.