Skip to content

Commit

Permalink
Testing
Browse files Browse the repository at this point in the history
Is mdls enough? Yes, given some time. It looks like just installing
shunit takes long enough for Spotlight to index..
  • Loading branch information
klaaspieter committed Mar 27, 2021
1 parent d68f58d commit 69a9f31
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 2 deletions.
22 changes: 22 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,31 @@ jobs:
steps:
- uses: actions/checkout@v2

- name: mdls
run: mdls "$PWD/test/applications/Xcode.app"

- name: mdfind
run: mdfind -onlyin "$PWD/test/applications" "kMDItemCFBundleIdentifier='com.apple.dt.Xcode'"

- name: Install shunit2
run: brew install shunit2

- name: zzzz
run: |
while true; do
output="$(mdfind -onlyin "$PWD/test/applications" "kMDItemCFBundleIdentifier='com.apple.dt.Xcode'")"
if [ -z "$output" ]; then
echo "found '$output'"
break
else
echo "mdfind did not find any Xcodes"
sleep 1
fi
done
- name: mdfind
run: mdfind -onlyin "$PWD/test/applications" "kMDItemCFBundleIdentifier='com.apple.dt.Xcode'"

- name: Run tests
run: make test

Expand Down
2 changes: 1 addition & 1 deletion share/chxcode/chxcode
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ xcode_versions() {
versions=()
for xcode in ${XCODES[*]}; do
version=$(xcode_version "$xcode")
versions+=${version}
versions+=("$version")
done

IFS=$'\n' versions=($(sort -n <<<"${versions[*]}")); unset IFS
Expand Down
2 changes: 1 addition & 1 deletion test/chxcode_test
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ test_exec_with_no_arguments() {

xcodes=$(chxcode | tr '\n' ' ' | xargs)

assertEquals "should print installed xcodes" "* 9.3 9.2" "$xcodes"
assertEquals "should print installed xcodes" "9.2 * 9.3" "$xcodes"
}

test_change_unknown_xcode_reports_error() {
Expand Down

0 comments on commit 69a9f31

Please sign in to comment.