Skip to content

Commit

Permalink
test get available firmware (#647)
Browse files Browse the repository at this point in the history
* tests/test_get_availableFirmware-definition.txt

Added test for get availableFirmware option

* Makefile

Download UnitTest makefile from fhem/UnitTest Repository
Added fhem kill command to finish all open processes
  • Loading branch information
sidey79 authored Sep 9, 2019
1 parent b0b295b commit ca80916
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,11 @@ deploylocalLibs:

UnitTest/makefile:
@mkdir -p $(dir $@)
@test -f $@ || wget -O $@ https://raw.githubusercontent.com/RFD-FHEM/UnitTest/master/makefile
@test -f $@ || wget -O $@ https://raw.githubusercontent.com/fhem/UnitTest/master/makefile

test: UnitTest/makefile deploylocalLibs
${MAKE} -f $< setupEnv test PERL_OPTS="-MDevel::Cover"
${MAKE} -f $< fhem_kill

clean: UnitTest/makefile
${MAKE} -f $< clean
Expand Down
17 changes: 17 additions & 0 deletions UnitTest/tests/test_get_availableFirmware-definition.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
defmod test_get_availableFirmware UnitTest dummyDuino
(
{

subtest 'Test get availableFirmware' => sub {
plan tests => 2;
$attr{$target}{updateChannelFW} = "stable";

my $ret=SIGNALduino_Get($targetHash, $target, "availableFirmware");
like($ret,qr/.*get availableFirmware failed.*/,"check return contains failed");

$attr{$target}{hardware} = "nano328";
$ret=SIGNALduino_Get($targetHash, $target, "availableFirmware");
is($ret,"availableFirmware: \n\nFetching stable firmware versions for nano328 from github\n","check return is fetching");
};
}
)

0 comments on commit ca80916

Please sign in to comment.