Skip to content

Instantly share code, notes, and snippets.

@jorbsd
Created January 23, 2010 22:15
Show Gist options
  • Select an option

  • Save jorbsd/284825 to your computer and use it in GitHub Desktop.

Select an option

Save jorbsd/284825 to your computer and use it in GitHub Desktop.
Tests running (compiler exit codes printed)...
0 is passing, anything else is an error...
These tests are verifying the presence of objc_startCollectorThread()...
Output for the following tests is in output/test1.m/ansi...
test1.m (ansi) with gcc-4.0: 1
test1.m (ansi) with gcc-4.2: 1
test1.m (ansi) with llvm-gcc-4.2: 1
test1.m (ansi) with clang: 1
Output for the following tests is in output/test1.m/gnu89...
test1.m (gnu89) with gcc-4.0: 0
test1.m (gnu89) with gcc-4.2: 0
test1.m (gnu89) with llvm-gcc-4.2: 0
test1.m (gnu89) with clang: 0
Output for the following tests is in output/test1.m/gnu99...
test1.m (gnu99) with gcc-4.0: 1
test1.m (gnu99) with gcc-4.2: 1
test1.m (gnu99) with llvm-gcc-4.2: 1
test1.m (gnu99) with clang: 0
Output for the following tests is in output/test1.mm...
test1.mm with g++-4.0: 1
test1.mm with g++-4.2: 1
test1.mm with llvm-g++-4.2: 1
Output for the following tests is in output/test2.m/ansi...
test2.m (ansi) with gcc-4.0: 1
test2.m (ansi) with gcc-4.2: 1
test2.m (ansi) with llvm-gcc-4.2: 1
test2.m (ansi) with clang: 1
Output for the following tests is in output/test2.m/gnu89...
test2.m (gnu89) with gcc-4.0: 0
test2.m (gnu89) with gcc-4.2: 0
test2.m (gnu89) with llvm-gcc-4.2: 0
test2.m (gnu89) with clang: 0
Output for the following tests is in output/test2.m/gnu99...
test2.m (gnu99) with gcc-4.0: 1
test2.m (gnu99) with gcc-4.2: 1
test2.m (gnu99) with llvm-gcc-4.2: 1
test2.m (gnu99) with clang: 0
#!/bin/bash
PATH="/Developer/usr/bin:/usr/bin:$PATH"
[[ -d output ]] && rm -rf output; mkdir output
printf "\nTests running (compiler exit codes printed)...\n\n"
printf "0 is passing, anything else is an error...\n\n"
printf "These tests are verifying the presence of objc_startCollectorThread()...\n\n"
# test1.m loop (ansi)
PREFIX=test1
FILE=${PREFIX}.m
STANDARD=ansi
printf "\n\nOutput for the following tests is in output/${FILE}/${STANDARD}...\n\n"
mkdir -p output/${FILE}/${STANDARD}
for LOOP in gcc-4.0 gcc-4.2 llvm-gcc-4.2 clang; do
printf "%45s" "${FILE} (${STANDARD}) with ${LOOP}: "
EXEC="${LOOP} -Werror -std=${STANDARD} -fobjc-gc-only -o /tmp/$$-${PREFIX}-${LOOP} ${FILE} -framework Foundation >output/${FILE}/${STANDARD}/${LOOP}.txt 2>&1"
eval ${EXEC}
printf "%i\n" $?
[[ -f /tmp/$$-${PREFIX}-${LOOP} ]] && rm -f /tmp/$$-${PREFIX}-${LOOP}
done
printf "\n"
# test1.m loop (gnu89)
PREFIX=test1
FILE=${PREFIX}.m
STANDARD=gnu89
printf "Output for the following tests is in output/${FILE}/${STANDARD}...\n\n"
mkdir -p output/${FILE}/${STANDARD}
for LOOP in gcc-4.0 gcc-4.2 llvm-gcc-4.2 clang; do
printf "%45s" "${FILE} (${STANDARD}) with ${LOOP}: "
EXEC="${LOOP} -Werror -std=${STANDARD} -fobjc-gc-only -o /tmp/$$-${PREFIX}-${LOOP} ${FILE} -framework Foundation >output/${FILE}/${STANDARD}/${LOOP}.txt 2>&1"
eval ${EXEC}
printf "%i\n" $?
[[ -f /tmp/$$-${PREFIX}-${LOOP} ]] && rm -f /tmp/$$-${PREFIX}-${LOOP}
done
printf "\n"
# test1.m loop (gnu99)
PREFIX=test1
FILE=${PREFIX}.m
STANDARD=gnu99
printf "Output for the following tests is in output/${FILE}/${STANDARD}...\n\n"
mkdir -p output/${FILE}/${STANDARD}
for LOOP in gcc-4.0 gcc-4.2 llvm-gcc-4.2 clang; do
printf "%45s" "${FILE} (${STANDARD}) with ${LOOP}: "
EXEC="${LOOP} -Werror -std=${STANDARD} -fobjc-gc-only -o /tmp/$$-${PREFIX}-${LOOP} ${FILE} -framework Foundation >output/${FILE}/${STANDARD}/${LOOP}.txt 2>&1"
eval ${EXEC}
printf "%i\n" $?
[[ -f /tmp/$$-${PREFIX}-${LOOP} ]] && rm -f /tmp/$$-${PREFIX}-${LOOP}
done
printf "\n"
# test1.mm loop
PREFIX=test1
FILE=${PREFIX}.mm
printf "Output for the following tests is in output/${FILE}...\n\n"
mkdir -p output/${FILE}
for LOOP in g++-4.0 g++-4.2 llvm-g++-4.2; do
printf "%45s" "${FILE} with ${LOOP}: "
EXEC="${LOOP} -Werror -fobjc-gc-only -o /tmp/$$-${PREFIX}-${LOOP} ${FILE} -framework Foundation >output/${FILE}/${LOOP}.txt 2>&1"
eval ${EXEC}
printf "%i\n" $?
[[ -f /tmp/$$-${PREFIX}-${LOOP} ]] && rm -f /tmp/$$-${PREFIX}-${LOOP}
done
printf "\n"
# test2.m loop (ansi)
PREFIX=test2
FILE=${PREFIX}.m
STANDARD=ansi
printf "Output for the following tests is in output/${FILE}/${STANDARD}...\n\n"
mkdir -p output/${FILE}/${STANDARD}
for LOOP in gcc-4.0 gcc-4.2 llvm-gcc-4.2 clang; do
printf "%45s" "${FILE} (${STANDARD}) with ${LOOP}: "
EXEC="${LOOP} -Werror -std=${STANDARD} -fobjc-gc-only -o /tmp/$$-${PREFIX}-${LOOP} ${FILE} -framework Foundation >output/${FILE}/${STANDARD}/${LOOP}.txt 2>&1"
eval ${EXEC}
printf "%i\n" $?
[[ -f /tmp/$$-${PREFIX}-${LOOP} ]] && rm -f /tmp/$$-${PREFIX}-${LOOP}
done
printf "\n"
# test2.m loop (gnu89)
PREFIX=test2
FILE=${PREFIX}.m
STANDARD=gnu89
printf "Output for the following tests is in output/${FILE}/${STANDARD}...\n\n"
mkdir -p output/${FILE}/${STANDARD}
for LOOP in gcc-4.0 gcc-4.2 llvm-gcc-4.2 clang; do
printf "%45s" "${FILE} (${STANDARD}) with ${LOOP}: "
EXEC="${LOOP} -Werror -std=${STANDARD} -fobjc-gc-only -o /tmp/$$-${PREFIX}-${LOOP} ${FILE} -framework Foundation >output/${FILE}/${STANDARD}/${LOOP}.txt 2>&1"
eval ${EXEC}
printf "%i\n" $?
[[ -f /tmp/$$-${PREFIX}-${LOOP} ]] && rm -f /tmp/$$-${PREFIX}-${LOOP}
done
printf "\n"
# test2.m loop (gnu99)
PREFIX=test2
FILE=${PREFIX}.m
STANDARD=gnu99
printf "Output for the following tests is in output/${FILE}/${STANDARD}...\n\n"
mkdir -p output/${FILE}/${STANDARD}
for LOOP in gcc-4.0 gcc-4.2 llvm-gcc-4.2 clang; do
printf "%45s" "${FILE} (${STANDARD}) with ${LOOP}: "
EXEC="${LOOP} -Werror -std=${STANDARD} -fobjc-gc-only -o /tmp/$$-${PREFIX}-${LOOP} ${FILE} -framework Foundation >output/${FILE}/${STANDARD}/${LOOP}.txt 2>&1"
eval ${EXEC}
printf "%i\n" $?
[[ -f /tmp/$$-${PREFIX}-${LOOP} ]] && rm -f /tmp/$$-${PREFIX}-${LOOP}
done
printf "\n"
#import <Foundation/Foundation.h>
int main(int argc, char *argv[]) {
objc_startCollectorThread();
NSAutoreleasePool *mainPool = [[NSAutoreleasePool alloc] init];
[mainPool drain];
return 0;
}
#import <Foundation/Foundation.h>
int main(int argc, char *argv[]) {
objc_startCollectorThread();
NSAutoreleasePool *mainPool = [[NSAutoreleasePool alloc] init];
[mainPool drain];
return 0;
}
#import <objc/runtime.h>
#import <Foundation/Foundation.h>
int main(int argc, char *argv[]) {
objc_startCollectorThread();
NSAutoreleasePool *mainPool = [[NSAutoreleasePool alloc] init];
[mainPool drain];
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment