From 2c69088be8e2448acde1b17bbb6418bd25d7abe6 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Wed, 6 Aug 2014 01:15:58 +0200 Subject: [PATCH] execute only one testcase per default --- notes/rsa-testvectors/rt.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/notes/rsa-testvectors/rt.py b/notes/rsa-testvectors/rt.py index 747cbb4..3f6ab7f 100755 --- a/notes/rsa-testvectors/rt.py +++ b/notes/rsa-testvectors/rt.py @@ -114,8 +114,12 @@ class Example(object): def __str__(self): res = "{{\n \"{0}\",\n{1},\n{{".format(self.name, str(self.key)) - for i in self.data: - res += str(i) + '\n' + for idx, d in enumerate(self.data, 1): + if idx == 2: + res += '#ifdef LTC_TEST_EXT\n' + res += str(d) + '\n' + if idx == ftype.numcases: + res += '#endif /* LTC_TEST_EXT */\n' res += '}\n},' return res @@ -225,7 +229,11 @@ print('''} rsaData_t; typedef struct testcase { const char* name; rsaKey_t rsa; +#ifdef LTC_TEST_EXT rsaData_t data[%d]; +#else + rsaData_t data[1]; +#endif /* LTC_TEST_EXT */ } testcase_t; testcase_t testcases_%s[] =