Add my makefile and cli-spidermonkey-tester

...just so they don't get lost.
This commit is contained in:
Einar Lielmanis 2011-06-12 20:28:21 +03:00
parent 2502468acb
commit 72016ffb16
2 changed files with 68 additions and 0 deletions

51
Makefile Normal file
View File

@ -0,0 +1,51 @@
define AVAILABLE_ACTIONS
publish: publish jsbeautifier to github.com and sync
test: test both implementations, js and python
testp: test python implementation
testj: test javascript implementation
endef
export AVAILABLE_ACTIONS
define SCRIPT_PUBLISH
open spic
cd jsbeautifier.org
mirror -Rv attic
mirror -Rv jquery
mirror -Rv tests
mirror -Rv unpackers
mirror -Rv python
put beautify-html.js beautify.js index.html license.txt README.md
endef
export SCRIPT_PUBLISH
.SILENT:
all:
echo "$$AVAILABLE_ACTIONS"
publish:
git push
lftp -c "$$SCRIPT_PUBLISH"
testp:
echo Testing python implementation...
cd python ;\
./test-jsbeautifier.py
echo
testj:
echo Testing javascript implementation...
./tests/run-tests
echo
tests: testp testj
test: testp testj

17
tests/run-tests Executable file
View File

@ -0,0 +1,17 @@
#!/usr/bin/js
// a little helper for testing from command line
// just run it, it will output the test results
try {
load('beautify.js');
load('tests/sanitytest.js')
load('tests/beautify-tests.js')
} catch (yada) {
load('../beautify.js');
load('sanitytest.js')
load('beautify-tests.js')
}
print(run_beautifier_tests().results_raw())