mirror of
https://codeberg.org/scip/pcp.git
synced 2025-12-17 03:50:57 +01:00
added json unit tests
This commit is contained in:
@@ -24,6 +24,10 @@ if BUILDCPP
|
||||
CPPTEST=cpptest
|
||||
endif
|
||||
|
||||
if BUILDJSON
|
||||
MAYJSON=jsontest
|
||||
endif
|
||||
|
||||
AM_CFLAGS = -I../include/pcp -I../src -I../libpcp/scrypt/crypto
|
||||
check_PROGRAMS = invalidkeys gencheader statictest $(CPPTEST) \
|
||||
buffertest sample streamtest pipetest decodertest mangle
|
||||
@@ -83,7 +87,10 @@ if BUILDPY
|
||||
MAYPY=pytest
|
||||
endif
|
||||
|
||||
test: check ctest $(MAYPY) $(MAYCPP)
|
||||
et:
|
||||
@echo check ctest $(MAYPY) $(MAYCPP) $(MAYJSON)
|
||||
|
||||
test: check ctest $(MAYPY) $(MAYCPP) $(MAYJSON)
|
||||
|
||||
ctest:
|
||||
rm -f test* v* stresstest/*
|
||||
@@ -96,6 +103,9 @@ pytest:
|
||||
docpptest:
|
||||
./unittests.pl cppunittests.cfg $(CHECK)
|
||||
|
||||
jsontest:
|
||||
./unittests.pl jsonunittests.cfg $(CHECK)
|
||||
|
||||
stresstest: check
|
||||
./unittests.pl stresstests.cfg
|
||||
|
||||
|
||||
61
tests/jsonunittests.cfg
Normal file
61
tests/jsonunittests.cfg
Normal file
@@ -0,0 +1,61 @@
|
||||
# -*-html-*-
|
||||
#
|
||||
# This file is part of Pretty Curved Privacy (pcp1).
|
||||
#
|
||||
# Copyright (C) 2013 T.Linden.
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
# You can contact me by mail: <tlinden AT cpan DOT org>.
|
||||
#
|
||||
|
||||
pcp = ../src/pcp1
|
||||
passwd = xxx
|
||||
verbose = 1
|
||||
include keys.cfg
|
||||
|
||||
<test vja>
|
||||
prepare = rm -f vja; $pcp -V vja -K -I key-alicia-sec -x a
|
||||
<test check-json-export-public>
|
||||
cmd = $pcp -V vja -p -j -x a -O testkeyvjapub.json
|
||||
expect-file testkeyvjapub.json
|
||||
</test>
|
||||
<test check-json-export-public-isjson>
|
||||
cmd = cat testkeyvjapub.json
|
||||
expect = /"Alicia"/
|
||||
</test>
|
||||
</test>
|
||||
|
||||
<test vjb>
|
||||
prepare = rm -f vjb; $pcp -V vjb -K -I key-bobby-sec -x b
|
||||
<test check-json-import-public>
|
||||
cmd = $pcp -V vjb -K -I testkeyvjapub.json -j
|
||||
expect /added/
|
||||
</test>
|
||||
</test>
|
||||
|
||||
<test vjtxt>
|
||||
<test check-json-text-vault>
|
||||
cmd = $pcp -V vjb -t -j
|
||||
expect = /"Alicia"/
|
||||
</test>
|
||||
<test check-json-text-public>
|
||||
cmd = $pcp -V vjb -t -j -i ${idalicia}
|
||||
expect = /"Alicia"/
|
||||
</test>
|
||||
<test check-json-text-secret>
|
||||
cmd = $pcp -V vjb -t -j -i ${idbobby}
|
||||
expect = /"Bobby"/
|
||||
</test>
|
||||
</test>
|
||||
Reference in New Issue
Block a user