Skip to content

Commit 30dfaa8

Browse files
authored
chore: add timing output to test vectors (#1298)
1 parent a445eff commit 30dfaa8

File tree

2 files changed

+19
-2
lines changed

2 files changed

+19
-2
lines changed

TestVectors/dafny/DDBEncryption/src/DecryptManifest.dfy

+9-1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ module {:options "-functionSyntax:4"} DecryptManifest {
1111
import opened StandardLibrary.UInt
1212
import opened JSON.Values
1313
import opened WriteManifest
14+
import Time
1415
import JSON.API
1516
import JSON.Errors
1617
import DdbItemJson
@@ -98,10 +99,15 @@ module {:options "-functionSyntax:4"} DecryptManifest {
9899

99100
method Decrypt(inFile : string) returns (output : Result<bool, string>)
100101
{
101-
print "Decrypt : ", inFile, "\n";
102+
var timeStamp :- expect Time.GetCurrentTimeStamp();
103+
print timeStamp + " Decrypt : ", inFile, "\n";
102104
var configBv :- expect FileIO.ReadBytesFromFile(inFile);
103105
var configBytes := BvToBytes(configBv);
106+
timeStamp :- expect Time.GetCurrentTimeStamp();
107+
print timeStamp + " File Read.\n";
104108
var json :- expect API.Deserialize(configBytes);
109+
timeStamp :- expect Time.GetCurrentTimeStamp();
110+
print timeStamp + " JSON Parsed.\n";
105111

106112
:- Need(json.Object?, "Decrypt file must contain a JSON object.");
107113
var keys : Option<string> := None;
@@ -151,6 +157,8 @@ module {:options "-functionSyntax:4"} DecryptManifest {
151157
var _ :- OneTest(obj.0, obj.1);
152158
}
153159

160+
timeStamp :- expect Time.GetCurrentTimeStamp();
161+
print timeStamp + " Tests Complete.\n";
154162
return Success(true);
155163
}
156164

TestVectors/dafny/DDBEncryption/src/EncryptManifest.dfy

+10-1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ module {:options "-functionSyntax:4"} EncryptManifest {
1111
import opened StandardLibrary.UInt
1212
import opened JSON.Values
1313
import opened WriteManifest
14+
import Time
1415
import JSON.API
1516
import JSON.Errors
1617
import opened DynamoDbEncryptionUtil
@@ -131,10 +132,15 @@ module {:options "-functionSyntax:4"} EncryptManifest {
131132

132133
method Encrypt(inFile : string, outFile : string, lang : string, version : string) returns (output : Result<bool, string>)
133134
{
134-
print "Encrypt : ", inFile, "\n";
135+
var timeStamp :- expect Time.GetCurrentTimeStamp();
136+
print timeStamp + " Encrypt : ", inFile, "\n";
135137
var configBv :- expect FileIO.ReadBytesFromFile(inFile);
136138
var configBytes := BvToBytes(configBv);
139+
timeStamp :- expect Time.GetCurrentTimeStamp();
140+
print timeStamp + " File Read.\n";
137141
var json :- expect API.Deserialize(configBytes);
142+
timeStamp :- expect Time.GetCurrentTimeStamp();
143+
print timeStamp + " JSON Parsed.\n";
138144

139145
:- Need(json.Object?, "Encrypt file must contain a JSON object.");
140146
var keys : Option<string> := None;
@@ -191,6 +197,9 @@ module {:options "-functionSyntax:4"} EncryptManifest {
191197
var jsonBytes :- expect API.Serialize(final);
192198
var jsonBv := BytesBv(jsonBytes);
193199
var x :- expect FileIO.WriteBytesToFile(outFile, jsonBv);
200+
201+
timeStamp :- expect Time.GetCurrentTimeStamp();
202+
print timeStamp + " Tests Complete.\n";
194203
return Success(true);
195204
}
196205

0 commit comments

Comments
 (0)