doc: make doc testable
This commit is contained in:
8
doc/_readme/scripts/install_llgo.sh
Normal file
8
doc/_readme/scripts/install_llgo.sh
Normal file
@@ -0,0 +1,8 @@
|
||||
# shellcheck disable=all
|
||||
git clone https://github.com/goplus/llgo.git
|
||||
cd llgo
|
||||
go install -v ./cmd/...
|
||||
go install -v ./chore/... # compile all tools except pydump
|
||||
cd chore/_xtool
|
||||
llgo install ./... # compile pydump
|
||||
go install github.com/goplus/hdq/chore/pysigfetch@v0.8.1 # compile pysigfetch
|
||||
5
doc/_readme/scripts/install_macos.sh
Normal file
5
doc/_readme/scripts/install_macos.sh
Normal file
@@ -0,0 +1,5 @@
|
||||
# shellcheck disable=all
|
||||
brew update
|
||||
brew install llvm@18 pkg-config bdw-gc openssl cjson
|
||||
brew install python@3.12 # optional
|
||||
go install -v github.com/goplus/llgo/cmd/llgo@latest
|
||||
7
doc/_readme/scripts/install_ubuntu.sh
Normal file
7
doc/_readme/scripts/install_ubuntu.sh
Normal file
@@ -0,0 +1,7 @@
|
||||
# shellcheck disable=all
|
||||
echo "deb http://apt.llvm.org/$(lsb_release -cs)/ llvm-toolchain-$(lsb_release -cs)-18 main" | sudo tee /etc/apt/sources.list.d/llvm.list
|
||||
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add -
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y llvm-18-dev clang-18 libclang-18-dev lld-18 pkg-config libgc-dev libssl-dev zlib1g-dev libcjson-dev python3.12-dev
|
||||
sudo apt-get install -y python3.12-dev # optional
|
||||
go install -v github.com/goplus/llgo/cmd/llgo@latest
|
||||
10
doc/_readme/scripts/run.sh
Normal file
10
doc/_readme/scripts/run.sh
Normal file
@@ -0,0 +1,10 @@
|
||||
#!/bin/bash
|
||||
cd ./doc/_readme/ || exit 1
|
||||
llgo build -v ./...
|
||||
pip3 install --user numpy
|
||||
for dir in ./*/; do
|
||||
if grep -q "func main()" "$dir"/*.go 2>/dev/null; then
|
||||
echo "Running examples in $dir"
|
||||
llgo run "$dir"
|
||||
fi
|
||||
done
|
||||
Reference in New Issue
Block a user