<commit_before>SHELL = /bin/sh -e
FORMULA = vmdk2dmg

test: test-lint test-cli

test-lint:
	shellcheck vmdk2dmg

test-cli:
	./vmdk2dmg --help
	./vmdk2dmg -h

	# hdiutil create -ov -size 512k -fs fat32 /tmp/vmdk2dmg-test.dmg	
	hdiutil create -ov -size 512k -type UDIF -fs UDF /tmp/vmdk2dmg-test.dmg
	rm /tmp/vmdk2dmg-test-fixture.vmdk || true
	VBoxManage convertfromraw /tmp/vmdk2dmg-test.dmg /tmp/vmdk2dmg-test-fixture.vmdk --format vmdk

	rm /tmp/vmdk2dmg-test.dmg || true
	./vmdk2dmg /tmp/vmdk2dmg-test-fixture.vmdk /tmp/vmdk2dmg-test.dmg
	sleep 1
	rm image.dmg || true
	./vmdk2dmg /tmp/vmdk2dmg-test-fixture.vmdk

test-homebrew-formula:
	# Setup
	cp $(FORMULA).rb $(shell brew --repository)/Library/Formula
	chmod 640 $(shell brew --repository)/Library/Formula/$(FORMULA).rb

	# Run tests
	brew reinstall --HEAD $(FORMULA)
	brew test $(FORMULA)
	brew audit --strict --online $(FORMULA).rb
<commit_msg>Use new Bats cases in Makefile<commit_after>SHELL = /bin/sh -e
FORMULA = vmdk2dmg

test: test-lint test-cli

test-lint:
	shellcheck vmdk2dmg

test-cli:
	bats tests/cli-test.sh

test-homebrew-formula:
	# Setup
	cp $(FORMULA).rb $(shell brew --repository)/Library/Formula
	chmod 640 $(shell brew --repository)/Library/Formula/$(FORMULA).rb

	# Run tests
	brew reinstall --HEAD $(FORMULA)
	brew test $(FORMULA)
	brew audit --strict --online $(FORMULA).rb
	brew cask install paragon-vmdk-mounter virtualbox

{'fraction_non_alphanumeric': 0.13574982231698648, 'fraction_numerical': 0.022743425728500355, 'mean_word_length': 3.586319218241042, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3149148', 'n_tokens_mistral': 626, 'n_tokens_neox': 605, 'n_words': 132}