Skip to content

Commit

Permalink
test: Add missing '*_expected*' target and binaries (#28)
Browse files Browse the repository at this point in the history
test: Add missing '*_expected*' binaries and target to Makefile

Also recursively copy files for `install` target instead of moving them.
Use new binaries in dummy RPATH change test.
  • Loading branch information
UniqMartin authored and woodruffw committed Jun 17, 2016
1 parent c6ebcb9 commit 4d2a9be
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 10 deletions.
Binary file added test/bin/fat-i386-ppc/hello_rpath_expected.bin
Binary file not shown.
Binary file added test/bin/fat-i386-x86_64/hello_rpath_expected.bin
Binary file not shown.
Binary file added test/bin/i386/hello_rpath_expected.bin
Binary file not shown.
Binary file added test/bin/ppc/hello_rpath_expected.bin
Binary file not shown.
18 changes: 15 additions & 3 deletions test/src/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,15 @@
HELLO_SRC = hello.c
LIBHELLO_SRC = libhello.c
RPATH_FLAGS = -Wl,-rpath,made_up_path
TARGET_FILES = hello.o hello.bin hello_expected.bin libhello.dylib libhello_expected.dylib libextrahello.dylib hellobundle.so
TARGET_FILES = \
hello.o \
hello.bin \
hello_expected.bin \
hello_rpath_expected.bin \
libhello.dylib \
libhello_expected.dylib \
libextrahello.dylib \
hellobundle.so

# Architecture-specific flags that are set by pattern matching the targets.
ARCH_FLAGS =
Expand Down Expand Up @@ -85,6 +93,10 @@ $(ALL_DIRS):
cp $< $@
install_name_tool -change /usr/lib/libSystem.B.dylib test $@

%/hello_rpath_expected.bin: %/hello.bin
cp $< $@
install_name_tool -rpath made_up_path /usr/lib $@

%/libhello.dylib: $(LIBHELLO_SRC) %
$(CC) $(ARCH_FLAGS) -o $@ -dynamiclib $<

Expand All @@ -103,7 +115,7 @@ $(ALL_DIRS):
clean:
rm -rf $(ALL_DIRS)

# Move all selected build products to their final destination.
# Copy all selected build products to their final destination.
.PHONY: install
install: all
mv -f $(USE_DIRS) ../bin/
cp -rf $(USE_DIRS) ../bin/
12 changes: 5 additions & 7 deletions test/test_macho.rb
Original file line number Diff line number Diff line change
Expand Up @@ -323,13 +323,11 @@ def test_change_install_name
end

def test_change_rpath
groups = [
[
fixture(:x86_64, "hello.bin"),
fixture(:x86_64, "hello_actual.bin"),
fixture(:x86_64, "hello_expected.bin")
]
]
groups = SINGLE_ARCHES.map do |arch|
["", "_rpath_actual", "_rpath_expected"].map do |suffix|
fixture(arch, "hello#{suffix}.bin")
end
end

pass
end
Expand Down

0 comments on commit 4d2a9be

Please sign in to comment.