Commit 11dc3fcb82c049d88081ffaa0849786e416a4b5f

Authored by Loic Dachary
1 parent 1be39b85
Exists in master

tests: add minimal encoder/decoder test

Add a test to run with make check to run encoder and decoder to make
sure they work at least in one simple case. It is also useful as a
documentation about how to use them.

Signed-off-by: Loic Dachary <loic@dachary.org>
Showing 2 changed files with 22 additions and 1 deletions   Show diff stats
Examples/Makefile.am
... ... @@ -27,7 +27,7 @@ bin_PROGRAMS = jerasure_01 \
27 27  
28 28 check_PROGRAMS =
29 29  
30   -TESTS=test_all_gfs.sh $(check_PROGRAMS)
  30 +TESTS=test_all_gfs.sh encode_decode.sh $(check_PROGRAMS)
31 31  
32 32 dist_noinst_SCRIPTS = test_all_gfs.sh time_all_gfs_argv_init.sh
33 33  
... ...
Examples/encode_decode.sh 0 → 100755
... ... @@ -0,0 +1,21 @@
  1 +#!/bin/bash -e
  2 +#
  3 +# Copyright (C) 2014 Red Hat <contact@redhat.com>
  4 +#
  5 +# Author: Loic Dachary <loic@dachary.org>
  6 +#
  7 +# This program is free software; you can redistribute it and/or modify
  8 +# it under the terms of the GNU Library Public License as published by
  9 +# the Free Software Foundation; either version 2, or (at your option)
  10 +# any later version.
  11 +#
  12 +# This program is distributed in the hope that it will be useful,
  13 +# but WITHOUT ANY WARRANTY; without even the implied warranty of
  14 +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  15 +# GNU Library Public License for more details.
  16 +#
  17 +trap "rm -fr T Coding" EXIT
  18 +
  19 +dd if=/dev/urandom of=T bs=4096 count=1
  20 +./encoder T 3 2 reed_sol_van 8 0 0
  21 +./decoder T
... ...