Skip to content

Commit 57a4ef0

Browse files
authored
Create a makefile target to build and run all the unit tests. (#252)
1 parent 1f93a4e commit 57a4ef0

File tree

3 files changed

+14
-27
lines changed

3 files changed

+14
-27
lines changed

.travis.yml

Lines changed: 1 addition & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -34,31 +34,7 @@ script:
3434
- python cpplint.py --extensions=c,cc,cpp,ino --headers=h,hpp {src,test}/*.{h,c,cc,cpp,hpp,ino} examples/*/*.{h,c,cc,cpp,hpp,ino}
3535
- shopt -u nullglob
3636
# Build and run the unit tests.
37-
- (cd test; make)
38-
- test/IRutils_test
39-
- test/IRsend_test
40-
- test/ir_NEC_test
41-
- test/ir_GlobalCache_test
42-
- test/ir_Sherwood_test
43-
- test/ir_Sony_test
44-
- test/ir_Samsung_test
45-
- test/ir_Kelvinator_test
46-
- test/ir_JVC_test
47-
- test/ir_RCMM_test
48-
- test/ir_LG_test
49-
- test/ir_Mitsubishi_test
50-
- test/ir_Sharp_test
51-
- test/ir_RC5_RC6_test
52-
- test/ir_Panasonic_test
53-
- test/ir_Dish_test
54-
- test/ir_Whynter_test
55-
- test/ir_Coolix_test
56-
- test/ir_Aiwa_test
57-
- test/ir_Denon_test
58-
- test/ir_Sanyo_test
59-
- test/ir_Daikin_test
60-
- test/ir_Gree_test
61-
- test/IRrecv_test
37+
- (cd test; make run)
6238

6339
notifications:
6440
email:

README.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,7 @@ This is not a perfect situation as we can not obvious emulate hardware specific
4848
If you want to run all the tests yourself, try the following:
4949
```
5050
$ cd test
51-
$ make
52-
$ for UNITTEST in *_test; do if [ -x "./${UNITTEST}" ]; then ./${UNITTEST}; fi; done
51+
$ make run
5352
```
5453

5554
## Contributing

test/Makefile

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,18 @@ all : $(TESTS)
4444
clean :
4545
rm -f $(TESTS) gtest.a gtest_main.a *.o
4646

47+
# Build and run all the tests.
48+
run : all
49+
failed=""; \
50+
for unittest in $(TESTS); do \
51+
./$${unittest} || failed="$${failed} $${unittest}"; \
52+
done; \
53+
if [ -n "$${failed}" ]; then \
54+
echo "FAIL: :-( :-( Unit test(s)$${failed} failed! :-( :-("; exit 1; \
55+
else \
56+
echo "PASS: \o/ \o/ All unit tests passed. \o/ \o/"; \
57+
fi
58+
4759
# Builds gtest.a and gtest_main.a.
4860

4961
# Usually you shouldn't tweak such internal variables, indicated by a

0 commit comments

Comments
 (0)