Skip to content

Commit

Permalink
Merge pull request #7 from jeffhung/shunit2
Browse files Browse the repository at this point in the history
Integrate shunit2.
  • Loading branch information
jeffhung authored Nov 13, 2019
2 parents 59c89c3 + 3f2d0af commit cf50a25
Show file tree
Hide file tree
Showing 5 changed files with 79 additions and 0 deletions.
7 changes: 7 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
language: minimal
python:
- "2.7"
before_install:
- python --version
script: make test

12 changes: 12 additions & 0 deletions GNUmakefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,18 @@
.PHONY: all
all:

.PHONY: clean
clean:
$(MAKE) -C tests clean

.PHONY: distclean
distclean: clean
$(MAKE) -C tests distclean

.PHONY: test
test:
$(MAKE) -C tests test

ifneq (,$(wildcard python.make))
include python.make
else
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
python.make
===========

[![Build Status](https://travis-ci.com/jeffhung/python.make.svg?branch=master)](https://travis-ci.com/jeffhung/python.make)

The `python.make` file is a `Makefile` module for python development that use
[GNU make][gmake] to build a local python development environment using
[virtualenv][virtualenv], and simplify [pip][pip] package management from
Expand Down
40 changes: 40 additions & 0 deletions tests/GNUmakefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@

.PHONY: all
all: help

.PHONY: help
help:

.PHONY: clean
clean:
rm -rf tmp.*;

.PHONY: distclean
distclean: clean
rm -f shunit2
rm -rf shunit2-$(SHUNIT2_VERSION);
rm -rf shunit2-$(SHUNIT2_VERSION).zip;

.PHONY: test
test: prepare-shunit2
./runtime_test.sh

# ---------------------------------------------------------------------------

SHUNIT2_VERSION = 2.1.7
SHUNIT2_URL = https://github.com/kward/shunit2/archive/v$(SHUNIT2_VERSION).zip

.PHONY: prepare-shunit2
prepare-shunit2: shunit2

shunit2: shunit2-$(SHUNIT2_VERSION)
ln -sf shunit2-$(SHUNIT2_VERSION) shunit2;

shunit2-$(SHUNIT2_VERSION): shunit2-$(SHUNIT2_VERSION).zip
unzip -q shunit2-$(SHUNIT2_VERSION).zip;

shunit2-$(SHUNIT2_VERSION).zip:
wget --content-disposition $(SHUNIT2_URL) # will download shunit2-$(SHUNIT2_VERSION).zip
# tar -xf $(TOP_3RDPARTY_DIR)/shunit2-2.1.5.tgz;
# ( cd shunit2-*; patch -p0 < $(TOP_3RDPARTY_DIR)/shunit2-xml.patch; )

18 changes: 18 additions & 0 deletions tests/runtime_test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/bin/bash

test_make_python_runtime() {
workdir=`mktemp -d tmp.XXX`;
cp ../python.make $workdir/
pushd $workdir

make -f python.make python-runtime
assertTrue "runtime folder not created" "[ -d runtime ]";

popd #$workdir
rm -rf $workdir
}


# Load shUnit2.
. ./shunit2/shunit2

0 comments on commit cf50a25

Please sign in to comment.