Skip to content

Commit cbfd682

Browse files
andrewtchleafo
authored andcommitted
bootstrap test
1 parent 18cd933 commit cbfd682

File tree

3 files changed

+35
-0
lines changed

3 files changed

+35
-0
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,5 @@
22
*~
33
/*.less
44
/*.css
5+
tests/bootstrap
6+
tests/tmp

tests/README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,3 +18,7 @@ test results. Combine with a *test-name-glob* to selectively compile.
1818
You can also run specific tests by passing in an argument that contains any
1919
part of the test name.
2020

21+
## bootstrap.sh
22+
23+
It's a syntetic test comparing lessc and lessphp output compiling twitter bootstrap;
24+
see bootstrap.sh for details.

tests/bootstrap.sh

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
echo "This script clones twitter bootsrap, compiles it with lessc and lessphp,"
2+
echo "cleans up results with csstidy, and outputs diff. To run it, you need to"
3+
echo "have git, csstidy and lessc installed."
4+
5+
csstidy_params="--allow_html_in_templates=false --compress_colors=false --compress_font-weight=false --discard_invalid_properties=false --lowercase_s=false --preserve_css=true --remove_bslash=false --remove_last\;=false --sort-properties=true --sort-selectors=true --timestamp=false --silent=true --merge_selectors=0 --case-properties=0 --optimize-shorthands=0 --template=high"
6+
7+
diff_params="-b -u -t -B"
8+
9+
if [ ! -d 'tmp/' ]
10+
then
11+
mkdir tmp/
12+
fi
13+
14+
if [ ! -d 'bootsrap/' ]
15+
then
16+
echo ">> Cloning bootstrap to bootstrap/"
17+
git clone https://github.com/twitter/bootstrap
18+
fi
19+
20+
echo ">> Lessc compilation"
21+
lessc bootstrap/less/bootstrap.less tmp/bootstrap.lessc.css
22+
echo ">> Lessphp compilation"
23+
../plessc bootstrap/less/bootstrap.less tmp/bootstrap.lessphp.csstidy
24+
echo ">> Cleanup and convert"
25+
csstidy tmp/bootstrap.lessc.css $csstidy_params tmp/bootstrap.lessc.clean.css
26+
csstidy tmp/bootstrap.lessphp.css $csstidy_params tmp/bootstrap.lessphp.clean.css
27+
echo ">> Doing diff"
28+
diff $diff_params tmp/bootstrap.lessc.clean.css tmp/bootstrap.lessphp.clean.css > tmp/diff
29+
cat tmp/diff

0 commit comments

Comments
 (0)