Gentoo Archives: gentoo-commits

From: "Anthony G. Basile" <blueness@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/elfix:master commit in: /, tests/
Date: Thu, 05 May 2011 15:19:59
Message-Id: 262d707f2014950979f722f7e79a35904d3b08a4.blueness@gentoo
1 commit: 262d707f2014950979f722f7e79a35904d3b08a4
2 Author: Anthony G. Basile <basile <AT> opensource <DOT> dyc <DOT> edu>
3 AuthorDate: Thu May 5 15:19:25 2011 +0000
4 Commit: Anthony G. Basile <blueness <AT> gentoo <DOT> org>
5 CommitDate: Thu May 5 15:19:25 2011 +0000
6 URL: http://git.overlays.gentoo.org/gitweb/?p=proj/elfix.git;a=commit;h=262d707f
7
8 tests: renaming to be more specific
9
10 ---
11 Makefile.am | 5 ++---
12 configure.ac | 5 +++--
13 tests/Makefile.am | 33 +++++++++++++--------------------
14 tests/{bad.c => bad-gnustack.c} | 0
15 tests/{test-bad32.asm => bad32.asm} | 0
16 tests/{test-bad64.asm => bad64.asm} | 0
17 tests/good.c | 23 -----------------------
18 7 files changed, 18 insertions(+), 48 deletions(-)
19
20 diff --git a/Makefile.am b/Makefile.am
21 index afff66d..1027f2e 100644
22 --- a/Makefile.am
23 +++ b/Makefile.am
24 @@ -1,5 +1,4 @@
25 if TEST
26 -SUBDIRS = src doc tests
27 -else
28 -SUBDIRS = src doc
29 +SUBDIRS_TESTS = tests
30 endif
31 +SUBDIRS = src doc $(SUBDIRS_TESTS)
32
33 diff --git a/configure.ac b/configure.ac
34 index fe326ec..140ae6e 100644
35 --- a/configure.ac
36 +++ b/configure.ac
37 @@ -7,8 +7,6 @@ AC_CONFIG_SRCDIR([src/fix-gnustack.c])
38 #AC_CONFIG_HEADERS([config.h])
39 AM_INIT_AUTOMAKE([1.11 foreign])
40
41 -# Checks for programs.
42 -AC_PROG_CC
43 AC_ARG_ENABLE(
44 [tests],
45 AS_HELP_STRING(
46 @@ -27,6 +25,9 @@ AC_ARG_ENABLE(
47 )
48 AM_CONDITIONAL([TEST],[test "x$has_yasm" = "xyes"])
49
50 +# Checks for programs.
51 +AC_PROG_CC
52 +
53 # Checks for libraries.
54 AC_CHECK_LIB([elf], [elf_begin])
55
56
57 diff --git a/tests/Makefile.am b/tests/Makefile.am
58 index a7fafde..ab23520 100644
59 --- a/tests/Makefile.am
60 +++ b/tests/Makefile.am
61 @@ -1,14 +1,13 @@
62 -noinst_PROGRAMS = good bad
63 -good_SOURCES = good.c
64 -bad_SOURCES = bad.c
65 -bad_DEPENDENCIES = test-bad.o
66 -bad_LDADD = test-bad.o
67 +noinst_PROGRAMS = bad-gnustack
68 +bad_gnustack_SOURCES = bad-gnustack.c
69 +bad_gnustack_DEPENDENCIES = bad-asm.o
70 +bad_gnustack_LDADD = bad-asm.o
71
72 ARCH = $(shell uname -m | sed -e 's/i./x/')
73
74 -test-bad.o: test-bad64.asm test-bad32.asm
75 - [[ "$(ARCH)" == "x86" ]] && yasm -f elf -m x86 test-bad32.asm && mv test-bad32.o test-bad.o || true
76 - [[ "$(ARCH)" == "x86_64" ]] && yasm -f elf -m amd64 test-bad64.asm && mv test-bad64.o test-bad.o || true
77 +bad-asm.o: bad64.asm bad32.asm
78 + [[ "$(ARCH)" == "x86" ]] && yasm -f elf -m x86 bad32.asm && mv bad32.o bad-asm.o || true
79 + [[ "$(ARCH)" == "x86_64" ]] && yasm -f elf -m amd64 bad64.asm && mv bad64.o bad-asm.o || true
80
81 check_SCRIPTS = test.sh
82 TEST = $(check_SCRIPTS)
83 @@ -16,19 +15,13 @@ TEST = $(check_SCRIPTS)
84 test.sh:
85 @echo "================================================================================"
86 @echo
87 - @echo "Good Elf"
88 - @../src/fix-gnustack good
89 + @echo "Fixing Bad GNU_STACK Elf"
90 + @../src/fix-gnustack -f bad-gnustack
91 @echo
92 - @echo "Bad Elf"
93 - @../src/fix-gnustack bad
94 - @echo
95 - @echo "Fixing Bad Elf"
96 - @../src/fix-gnustack -f bad
97 - @echo
98 - @echo "Fixed Bad Elf"
99 - @../src/fix-gnustack bad
100 - @rm -f good bad
101 + @echo "Fixed Bad GNU_STACK Elf"
102 + @../src/fix-gnustack bad-gnustack
103 + @rm -f good
104 @echo
105 @echo "================================================================================"
106
107 -CLEANFILES = test-bad.o test.sh
108 +CLEANFILES = bad-asm.o test.sh
109
110 diff --git a/tests/bad.c b/tests/bad-gnustack.c
111 similarity index 100%
112 rename from tests/bad.c
113 rename to tests/bad-gnustack.c
114
115 diff --git a/tests/test-bad32.asm b/tests/bad32.asm
116 similarity index 100%
117 rename from tests/test-bad32.asm
118 rename to tests/bad32.asm
119
120 diff --git a/tests/test-bad64.asm b/tests/bad64.asm
121 similarity index 100%
122 rename from tests/test-bad64.asm
123 rename to tests/bad64.asm
124
125 diff --git a/tests/good.c b/tests/good.c
126 deleted file mode 100644
127 index ff7700e..0000000
128 --- a/tests/good.c
129 +++ /dev/null
130 @@ -1,23 +0,0 @@
131 -/*
132 - good.c: C source for sample elf with no X on GNU_STACK
133 - Copyright (C) 2011 Anthony G. Basile
134 -
135 - This program is free software: you can redistribute it and/or modify
136 - it under the terms of the GNU General Public License as published by
137 - the Free Software Foundation, either version 3 of the License, or
138 - (at your option) any later version.
139 -
140 - This program is distributed in the hope that it will be useful,
141 - but WITHOUT ANY WARRANTY; without even the implied warranty of
142 - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
143 - GNU General Public License for more details.
144 -
145 - You should have received a copy of the GNU General Public License
146 - along with this program. If not, see <http://www.gnu.org/licenses/>.
147 -*/
148 -
149 -int main()
150 -{
151 - ;
152 - return 0 ;
153 -}