Skip to content
Merged
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
28 changes: 0 additions & 28 deletions .github/workflows/Test-Suite.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,31 +63,3 @@ jobs:
git add .
git commit -am "update bc files" || true
git push

mac_build:
needs: linux_build
runs-on: macos-latest
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
- uses: actions/checkout@v2

- name: stash-changes
run: |
git stash --all
echo $(pwd)

- name: generate-bcs
run: |
echo $(pwd)
git status
bash ./generate_bc.sh

- name: commit-and-push
run: |
git config --global user.name 'github-actions'
git config --global user.email 'github-actions@users.noreply.github.com'
git status
git pull
git add .
git commit -am "update bc files" || true
git push
26 changes: 21 additions & 5 deletions generate_bc.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,19 @@ bc_path="$root/test_cases_bc"
if [[ $sysOS == "Linux" || $sysOS == "Darwin" || $sysOS =~ "MINGW" || $sysOS =~ "MSYS" ]];then

########
# Remove previous bc folder and create a new one.
# Remove previous bc files and create a new directory layout, while
# preserving the committed Windows-only bitcode file.
########
preserved_bc="$bc_path/mem_leak/leak_win_heap.c.bc"
if [ -d "$bc_path" ]; then
git ls-files -z "$bc_path" | while IFS= read -r -d '' tracked_bc; do
if [ "$root/$tracked_bc" != "$preserved_bc" ]; then
git rm -f -- "$tracked_bc"
fi
done

git rm -rf "$bc_path"
find "$bc_path" -type f ! -path "$preserved_bc" -delete
fi
mkdir -p "$bc_path"

########
Expand All @@ -57,7 +66,6 @@ for td in $test_dirs; do
for c_f in "$full_td/"*; do
########
# Obtains the text after the '.'.
########
ext=${c_f##*.}

########
Expand All @@ -68,10 +76,18 @@ for td in $test_dirs; do
continue
fi

filename=$(basename "$c_f")

# This test requires Windows SDK headers. Preserve its committed bitcode.
if [ "$td" = "mem_leak" ] && [ "$filename" = "leak_win_heap.c" ]; then
echo "$0: Skipping '$c_f' (preserving '$preserved_bc')"
continue
Comment on lines +82 to +84
fi

########
# The output .bc file name.
########
bc_f="$bc_td/`basename "$c_f"`.bc"
bc_f="$bc_td/$filename.bc"

########
# If the .bc is newer than the .c/.cpp, then no need to compile.
Expand All @@ -97,7 +113,7 @@ for td in $test_dirs; do
# Check if this test requires the MSVC ABI target
########
target_arg=""
case "$(basename "$c_f")" in
case "$filename" in
msvc_*)
target_arg="-target x86_64-pc-windows-msvc"
;;
Expand Down
Loading