Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions .github/build-linux/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,22 @@ export CODON_PYTHON=$(python ${WORKSPACE}/test/python/find-python-library.py)
export PYTHONPATH=${WORKSPACE}/test/python
export CODON_DIR=$(pwd)/codon-deploy-${ARCH}

GTEST_PARALLEL="${WORKSPACE}/gtest-parallel/gtest-parallel"
if [ ! -f "${GTEST_PARALLEL}" ]; then
git submodule update --init --recursive
fi

echo "=> Unit tests..."
mkdir -p build # needed for some tests that write into this directory
if [ "${ARCH}" = "darwin-x86_64" ]; then
# Disable numpy tests on Intel macOS since it breaks on macOS 13
# (macOS 14 Intel runners are not free).
# arithmetic.codon fails in debug mode on x86 due to float16 (TODO: why?)
export OBJC_DISABLE_INITIALIZE_FORK_SAFETY=YES
time build-${ARCH}/codon_test --gtest_filter="-*numpy*:*core_arithmetic_codon_debug*"
time "${GTEST_PARALLEL}" build-${ARCH}/codon_test --gtest_filter="-*numpy*:*core_arithmetic_codon_debug*"
# :*python*:*core_arithmetic*:*stdlib_random_test*"
else
time build-${ARCH}/codon_test
time "${GTEST_PARALLEL}" build-${ARCH}/codon_test
fi

echo "=> Standalone test..."
Expand Down
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "gtest-parallel"]
path = gtest-parallel
url = https://github.com/google/gtest-parallel.git
1 change: 1 addition & 0 deletions gtest-parallel
Submodule gtest-parallel added at cd488b
10 changes: 9 additions & 1 deletion test/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -314,8 +314,16 @@ class SeqTest
GC_atfork_parent();
int status = -1;
close(out_pipe[1]);

buf.clear();
char temp_buf[4096];
ssize_t n;
while ((n = read(out_pipe[0], temp_buf, sizeof(temp_buf))) > 0) {
buf.insert(buf.end(), temp_buf, temp_buf + n);
}
buf.push_back('\0');

assert(waitpid(pid, &status, 0) == pid);
read(out_pipe[0], buf.data(), buf.size() - 1);
close(out_pipe[0]);
return status;
}
Expand Down