Ziran now generates C, Go, Python and portable .zx. zi2cpp, zi2rust, the C++ mode of the shared C emitter, the Plan 9 post-pass and the std Plan 9 modules are gone; --target=cpp|rust|plan9-c and zi2c --plan9 are rejected as unknown targets. Generated C headers keep avoiding C++ keywords in exported names, so C++ hosts can still include them.
29 lines
961 B
Bash
29 lines
961 B
Bash
#!/bin/sh
|
|
set -eu
|
|
|
|
work=${ZIRAN_THREAD_TEST_BUILD:-"$(pwd)/build/thread-linux"}
|
|
mkdir -p "$work"
|
|
exec 9>"$work/check.lock"
|
|
flock -n 9 || { echo 'Thread checks are already running' >&2; exit 1; }
|
|
|
|
"$1" check --root tests/spec --module-path std \
|
|
tests/spec/thread_linux_test.zi
|
|
"$1" ir --root tests/spec --module-path std -o "$work/ir" \
|
|
tests/spec/thread_linux_test.zi
|
|
for form in source saved; do
|
|
output="$work/$form-c"
|
|
entry=tests/spec/thread_linux_test.zi
|
|
root=tests/spec
|
|
modules=std
|
|
if test "$form" = saved; then
|
|
entry="$work/ir/thread_linux_test.zir"
|
|
root="$work/ir"
|
|
modules="$work/ir"
|
|
fi
|
|
"$1" build --target=c --no-main \
|
|
--root "$root" --module-path "$modules" -o "$output" "$entry"
|
|
"${CC:-cc}" -std=c11 -Iinclude -I"$output" tests/thread_completion_test.c \
|
|
"$output"/*.c -pthread -Wl,--wrap=pthread_join -Wl,--wrap=pthread_mutex_lock -o "$work/test"
|
|
env -u DISPLAY -u WAYLAND_DISPLAY -u XAUTHORITY -u DBUS_SESSION_BUS_ADDRESS "$work/test"
|
|
done
|