1 /** 2 Copyright: Copyright (c) 2021, Joakim Brännström. All rights reserved. 3 License: MPL-2 4 Author: Joakim Brännström (joakim.brannstrom@gmx.com) 5 6 This Source Code Form is subject to the terms of the Mozilla Public License, 7 v.2.0. If a copy of the MPL was not distributed with this file, You can obtain 8 one at http://mozilla.org/MPL/2.0/. 9 */ 10 module dextool.plugin.mutate.backend.test_mutant.common_actors; 11 12 import my.actor : typedActor; 13 import my.path : AbsolutePath; 14 15 import dextool.plugin.mutate.backend.database : dbOpenTimeout; 16 import dextool.plugin.mutate.backend.test_mutant.common : MutationTestResult; 17 import dextool.plugin.mutate.backend.test_mutant.timeout : TimeoutFsm; 18 19 // common messages 20 21 struct Init { 22 } 23 24 // actors 25 26 struct IsDone { 27 } 28 29 // Save test results to the database. 30 // dfmt off 31 alias DbSaveActor = typedActor!( 32 // init the actor by opening the database. 33 void function(Init, AbsolutePath dbPath), 34 // save the result to the database 35 void function(MutationTestResult result, TimeoutFsm timeoutFsm), 36 void function(MutationTestResult result, long timeoutIter), 37 // query if it has finished saving to the db. 38 bool function(IsDone)); 39 // dfmt on 40 41 struct GetMutantsLeft { 42 } 43 44 struct UnknownMutantTested { 45 } 46 47 struct Tick { 48 } 49 50 struct ForceUpdate { 51 } 52 53 // Progress statistics for the mutation testing such as how many that are left to test. 54 // dfmt off 55 alias StatActor = typedActor!( 56 // init the actor by opening the database. 57 void function(Init, AbsolutePath dbPath), 58 long function(GetMutantsLeft), 59 void function(Tick), 60 // force an update of the statistics 61 void function(ForceUpdate), 62 // a mutant has been tested and is done 63 void function(UnknownMutantTested, long)); 64 // dfmt on