GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing github.com — tiny/test_run.sh at main · Cuteify/tiny Expand file tree/ Copy pathtest_run.shMore file actions executable file ·55 lines (45 loc) · 1.78 KB / Copy pathtest_run.shFile metadata and controlsexecutable file ·55 lines (45 loc) · 1.78 KB 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 #!/usr/bin/env bash # cute 编译器测试运行脚本 # 用法: ./test_run.sh [测试目录] [架构...] # 默认: ./test_run.sh test/derefTest x86_64 x86 # 退出码含义见各测试 main.cute(deref_test 中 ret 7 = 全部通过) set -u cd "$(dirname "$0")" || exit 1 TARGET_DIR="${1:-test/derefTest}" if [ $# -gt 1 ]; then ARCHS=("${@:2}") else ARCHS=(x86_64 x86) fi BUILD_BIN="$(pwd)/.tmp/cuteify2" WORK="$(pwd)/.tmp/cuterun" [ -d "$TARGET_DIR" ] || { echo "错误: 测试目录不存在: $TARGET_DIR"; exit 1; } command -v nasm >/dev/null || { echo "错误: 缺少 nasm"; exit 1; } command -v ld >/dev/null || { echo "错误: 缺少 ld"; exit 1; } echo "==> 构建编译器: go build -o $BUILD_BIN ." TMPDIR="${TMPDIR:-$(pwd)/.tmp}" go build -o "$BUILD_BIN" . || { echo "编译器构建失败"; exit 1; } mkdir -p "$WORK" rm -f "$WORK"/* for arch in "${ARCHS[@]}"; do echo "" echo "================================================" echo "==> 编译 ($arch): $TARGET_DIR" echo "================================================" if ! CUTE_ARCH=$arch "$BUILD_BIN" "$TARGET_DIR"; then echo "[$arch] 编译失败" continue fi cp _main.asm "$WORK/main_$arch.asm" if [ "$arch" = "x86_64" ]; then nasm -f elf64 -w-label-redef-late -o "$WORK/main_$arch.o" "$WORK/main_$arch.asm" || continue gcc -nostartfiles -no-pie -e _start -o "$WORK/main_$arch" "$WORK/main_$arch.o" -lpthread || continue else nasm -f elf32 -w-label-redef-late -o "$WORK/main_$arch.o" "$WORK/main_$arch.asm" || continue gcc -m32 -nostartfiles -no-pie -e _start -o "$WORK/main_$arch" "$WORK/main_$arch.o" -lpthread || continue fi "$WORK/main_$arch" code=$? echo "[$arch] exit=$code" done echo "" echo "完成。产物目录: $WORK" |
| You are visitor 01402520 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |