summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorkonablend <[email protected]>2009-03-01 17:03:11 +0000
committerkonablend <[email protected]>2009-03-01 17:03:11 +0000
commit4dbce6b69967c1e14092637aa95b6c31855a81fc (patch)
tree516c17095967698eeb419c70ce72dbd2c11bf754 /test
parentc47939541ccec1e5e57753b16b28baed2613f586 (diff)
BuildSystem: conversion from jam-based to make-based system.
KNOWN ISSUES: 1. OSX + Xcode builds do not support parallel builds; attempting to use them may cause unbounded number of jobs. However, disabling via configure --disable-xcode avoids the issue. 2. OSX ppc binary produces binary which has audio-scan problems. 3. OSX ppc64 binary has not been runtime tested. ADDED: 00-BuildUserGuide.txt contrib/*/module.* doc/ make/ libhb/module.* test/module.* macos/module.* gtk/module.* DROPPED: BUILD BuildContribDarwin.sh DownloadMacOsXContribBinaries.sh Jamfile Jamrules MacOsXContribBinariesVersion.txt Makefile Makefile.config jam libhb/Jamefile libhb/Makefile test/BUILDSHARED test/Makefile contrib/Jamfile contrib/Makefile contrib/patch-ffmpeg.patch contrib/patch-x264-idr.patch contrib/patch-x264-linux.patch RENAMED: contrib/*.patch -> contrib/MODULE/[AP]??-*.patch macosx/HandBrake.plist -> macosx/Info.plist MODIFIED: libhb/decavcodec.c Patched to use cleaner include "libavcodec/audioconvert". Second part to support this cleanup is ffmpeg A02-audioconvert.patch . MODIFIED: libhb/hb.c MODIFIED: libhb/hb.h MODIFIED: libhb/muxmkv.c MODIFIED: libhb/muxmp4.c MODIFIED: libhb/update.c Patched to use "project.h" for project metadata. Renamed HB_BUILD -> HB_PROJECT_BUILD. Renamed HB_VERSION -> HB_PROJECT_VERSION. MODIFIED: test/test.c: Patched HandBrakeCLI to support I/O on Mac OS X ZFS filesystems. Reference r1803 as similar patch for HandBrake.app . Unpatched behavior is crash/buserror when using ZFS. MODIFIED: macosx/Growl.framework/ Upgraded 0.7.6 (i386,ppc) -> 1.1.2 (i386,x86_64,ppc,ppc64). New architectures facilitate x86_64 and ppc64 builds. MODIFIED: macosx/HandBrake.xcodeproj/ Bumped compatibilty mode from 2.4 -> 3.1 . Dumped old configurations Deployment, Developer. Added configurations standard, sebug as replacements. Added standard.i386, standard.x86_64, standard.ppc, standard.ppc64 . for explicit architecture build. All configurations settings cleaned up and normalized. Build output directories adjusted to support new build system. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@2180 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'test')
-rw-r--r--test/BUILDSHARED36
-rw-r--r--test/Makefile36
-rw-r--r--test/module.defs41
-rw-r--r--test/module.rules20
-rw-r--r--test/test.c41
5 files changed, 86 insertions, 88 deletions
diff --git a/test/BUILDSHARED b/test/BUILDSHARED
deleted file mode 100644
index 6b33fb90a..000000000
--- a/test/BUILDSHARED
+++ /dev/null
@@ -1,36 +0,0 @@
-To test the HandBrake dylib on MacOs X issue the following commands:
-===================================================================
-
-cp ../libhb/libhb.dylib .
-gcc -I../libhb -L. -lhb test.c -o test -arch i386 -arch ppc
-install_name_tool -change /usr/local/lib/libhb.dylib @executable_path/libhb.dylib test
-
-Validate that the test Binary is really using the shared library
-
-otool -L test
-
-------------------------------------------------------------------------
-
-To test the HandBrake .so on Linux issue the following commands:
-================================================================
-
-cp ../libhb/libhb.so .
-gcc -I../libhb -L. -lhb test.c -o test -lz -lpthread
-
-Validate that the test Binary is really using the shared library
-
-ldd test
-
-------------------------------------------------------------------------
-
-To test the HandBrake .dll on cygwin issue the following commands:
-==================================================================
-
-cp ../libhb/libhb.dll .
-gcc -I../libhb -L. -lhb test.c -o test -lz -lpthread
-
-The resulting binary test should depend on the cygwin dll and the hb dll.
-
-I works like that but wasn't tested yet outside of cygwin.
-
-------------------------------------------------------------------------
diff --git a/test/Makefile b/test/Makefile
deleted file mode 100644
index 219d594d8..000000000
--- a/test/Makefile
+++ /dev/null
@@ -1,36 +0,0 @@
-SYSTEM = $(shell uname -s)
-
-LIBS = a52 mkv avformat avcodec avutil dca dvdread faac mp3lame mpeg2 vorbis \
- vorbisenc ogg samplerate x264 xvidcore mp4v2 swscale theora faad
-
-CYGLIBS = zlib bzip2
-
-all: ../HandBrakeCLI
-
-CFLAGS += -I../libhb
-CXXFLAGS += -I../libhb
-LIBS2 = ../libhb/libhb.a $(LIBS:%=../contrib/lib/lib%.a)
-
-ifeq ($(findstring CYGWIN_NT,$(SYSTEM)),CYGWIN_NT)
- LIBS2 += $(CYGLIBS:%=../contrib/lib/libz.a) $(CYGLIBS:%=../contrib/lib/libbz2.a)
-endif
-
-LDFLAGS += $(LIBS2) -lbz2 -ldl
-
-../HandBrakeCLI: test.c parsecsv.c $(LIBS2)
- @CMD="$(CC) $(CFLAGS) -o test.o -c test.c"; $$CMD || \
- ( echo "Compile line for $@ was:"; echo $$CMD; false )
- @CMD="$(CC) $(CFLAGS) -o parsecsv.o -c parsecsv.c"; $$CMD || \
- ( echo "Compile line for $@ was:"; echo $$CMD; false )
- @echo "Link HandBrakeCLI"
- @CMD="g++ $(CXXFLAGS) -o ../HandBrakeCLI test.o parsecsv.o $(LDFLAGS) -lz -lpthread"; $$CMD || \
- ( echo "Compile line for $@ was:"; echo $$CMD; false )
- @CMD="rm -rf ../plugins ; mkdir ../plugins ; cp ../contrib/lib/libquicktime/* ../plugins"; $$CMD
-
-
-clean:
- @echo "Clean HandBrakeCLI"
- @$(RM) ../HandBrakeCLI
- @$(RM) ../HandBrakeCLI.exe
- @$(RM) *.o
-
diff --git a/test/module.defs b/test/module.defs
new file mode 100644
index 000000000..3eda79509
--- /dev/null
+++ b/test/module.defs
@@ -0,0 +1,41 @@
+$(eval $(call import.MODULE.defs,TEST,test,LIBHB))
+$(eval $(call import.GCC,TEST))
+
+TEST.src/ = $(PROJECT/)test/
+TEST.build/ = $(BUILD/)test/
+
+TEST.c = $(wildcard $(TEST.src/)*.c)
+TEST.c.o = $(patsubst $(PROJECT/)%.c,$(BUILD/)%.o,$(TEST.c))
+
+TEST.exe = $(BUILD/)$(call TARGET.exe,$(HB.name)CLI)
+
+TEST.libs = $(LIBHB.a) $(foreach n, \
+ a52 avcodec avformat avutil dca dvdread faac faad mkv mpeg2 mp3lame mp4v2 \
+ ogg samplerate swscale theora vorbis vorbisenc x264 xvidcore, \
+ $(CONTRIB.build/)lib/lib$(n).a )
+
+## add libs from optional modules
+ifeq (1,$(BZIP2.enabled))
+ TEST.libs += $(CONTRIB.build/)lib/libbz2.a
+endif
+ifeq (1,$(ZLIB.enabled))
+ TEST.libs += $(CONTRIB.build/)lib/libz.a
+endif
+
+###############################################################################
+
+TEST.out += $(TEST.c.o)
+TEST.out += $(TEST.exe)
+
+BUILD.out += $(TEST.out)
+
+###############################################################################
+
+TEST.GCC.I += $(LIBHB.GCC.I)
+
+ifeq ($(BUILD.system),darwin)
+ TEST.GCC.f += IOKit CoreServices
+ TEST.GCC.l += bz2 z
+else ifeq ($(BUILD.system),linux)
+ TEST.GCC.l += bz2 z pthread dl m
+endif
diff --git a/test/module.rules b/test/module.rules
new file mode 100644
index 000000000..34004b97f
--- /dev/null
+++ b/test/module.rules
@@ -0,0 +1,20 @@
+$(eval $(call import.MODULE.rules,TEST))
+
+test.build: $(TEST.exe)
+
+$(TEST.exe): | $(dir $(TEST.exe))
+$(TEST.exe): $(TEST.c.o)
+ $(call TEST.GCC.EXE++,$@,$^ $(TEST.libs))
+
+$(TEST.c.o): $(LIBHB.a)
+$(TEST.c.o): | $(dir $(TEST.c.o))
+$(TEST.c.o): $(BUILD/)%.o: $(PROJECT/)%.c
+ $(call TEST.GCC.C_O,$@,$<)
+
+test.clean:
+ $(RM.exe) -f $(TEST.out)
+
+###############################################################################
+
+build: test.build
+clean: test.clean
diff --git a/test/test.c b/test/test.c
index 2c24d4c36..0fd39f527 100644
--- a/test/test.c
+++ b/test/test.c
@@ -2217,20 +2217,19 @@ static int ParseOptions( int argc, char ** argv )
break;
case 'i':
input = strdup( optarg );
- #ifdef __APPLE_CC__
- char *devName = bsd_name_for_path( input );
- if( devName == NULL )
- {
- break;
- }
- if( device_is_dvd( devName ) )
+#ifdef __APPLE_CC__
+ char *devName = bsd_name_for_path( input ); // alloc
+ if( devName )
{
- char *newInput = malloc( strlen("/dev/") + strlen( devName ) + 1);
- sprintf( newInput, "/dev/%s", devName );
- free(input);
- input = newInput;
+ if( device_is_dvd( devName ))
+ {
+ free( input );
+ input = malloc( strlen( "/dev/" ) + strlen( devName ) + 1 );
+ sprintf( input, "/dev/%s", devName );
+ }
+ free( devName );
}
- #endif
+#endif
break;
case 'o':
output = strdup( optarg );
@@ -2711,10 +2710,20 @@ static char* bsd_name_for_path(char *path)
return NULL;
}
- // A version 4 GetVolParmsInfoBuffer contains the BSD node name in the
- // vMDeviceID field. It is actually a char * value. This is mentioned in the
- // header CoreServices/CarbonCore/Files.h.
- return volumeParms.vMDeviceID;
+ // A version 4 GetVolParmsInfoBuffer contains the BSD node name in the vMDeviceID field.
+ // It is actually a char * value. This is mentioned in the header CoreServices/CarbonCore/Files.h.
+ if( volumeParms.vMVersion < 4 )
+ {
+ return NULL;
+ }
+
+ // vMDeviceID might be zero as is reported with experimental ZFS (zfs-119) support in Leopard.
+ if( !volumeParms.vMDeviceID )
+ {
+ return NULL;
+ }
+
+ return strdup( volumeParms.vMDeviceID );
}
/****************************************************************************