github.com/iotexproject/iotex-core@v1.14.1-rc1/misc/scripts/mockgen.sh (about)

     1  #!/bin/bash
     2  
     3  mkdir -p ./test/mock
     4  
     5  mkdir -p ./test/mock/mock_dispatcher
     6  mockgen -destination=./test/mock/mock_dispatcher/mock_dispatcher.go  \
     7          -source=./dispatcher/dispatcher.go \
     8          -package=mock_dispatcher \
     9          Dispatcher
    10  
    11  mkdir -p ./test/mock/mock_blockchain
    12  mockgen -destination=./test/mock/mock_blockchain/mock_blockchain.go  \
    13          -source=./blockchain/blockchain.go \
    14          -package=mock_blockchain \
    15          Blockchain
    16  
    17  mkdir -p ./test/mock/mock_blockdao
    18  mockgen -destination=./test/mock/mock_blockdao/mock_blockdao.go  \
    19          -source=./blockchain/blockdao/blockdao.go \
    20          -aux_files=github.com/iotexproject/iotex-core/blockchain/blockdao=./blockchain/filedao/filedao.go \
    21          -package=mock_blockdao \
    22          BlockDAO
    23  
    24  mkdir -p ./test/mock/mock_trie
    25  mockgen -destination=./test/mock/mock_trie/mock_trie.go  \
    26          -source=./db/trie/trie.go \
    27          -package=mock_trie \
    28          Trie
    29  
    30  mkdir -p ./test/mock/mock_factory
    31  mockgen -destination=./test/mock/mock_factory/mock_factory.go  \
    32          -source=./state/factory/factory.go \
    33          -package=mock_factory \
    34          Factory
    35  
    36  mkdir -p ./test/mock/mock_consensus
    37  mockgen -destination=./test/mock/mock_consensus/mock_consensus.go  \
    38          -source=./consensus/consensus.go \
    39          -package=mock_consensus \
    40          Consensus
    41  
    42  mockgen -destination=./consensus/consensusfsm/mock_context_test.go  \
    43          -source=./consensus/consensusfsm/context.go \
    44  	-self_package=github.com/iotexproject/iotex-core/consensus/consensusfsm \
    45  	-aux_files=github.com/iotexproject/iotex-core/consensus/consensusfsm=./consensus/consensusfsm/consensus_ttl.go \
    46  	-package=consensusfsm \
    47          Context
    48  
    49  mkdir -p ./test/mock/mock_lifecycle
    50  mockgen -destination=./test/mock/mock_lifecycle/mock_lifecycle.go \
    51          github.com/iotexproject/iotex-core/pkg/lifecycle StartStopper
    52  
    53  mkdir -p ./test/mock/mock_actpool
    54  mockgen -destination=./test/mock/mock_actpool/mock_actpool.go  \
    55          -source=./actpool/actpool.go \
    56          -self_package=github.com/iotexproject/iotex-core/actpool \
    57          -package=mock_actpool \
    58          ActPool
    59  
    60  mkdir -p ./test/mock/mock_actioniterator
    61  mockgen -destination=./test/mock/mock_actioniterator/mock_actioniterator.go  \
    62          -source=./actpool/actioniterator/actioniterator.go \
    63          -package=mock_actioniterator \
    64          ActionIterator
    65  
    66  mockgen -destination=./action/protocol/mock_protocol_test.go  \
    67          -source=./action/protocol/protocol.go \
    68          -self_package=github.com/iotexproject/iotex-core/action/protocol \
    69          -package=protocol \
    70          Protocol
    71  
    72  mkdir -p ./test/mock/mock_poll
    73  mockgen -destination=./test/mock/mock_poll/mock_poll.go  \
    74          -source=./action/protocol/poll/protocol.go \
    75          -package=mock_poll \
    76          Protocol
    77  
    78  mockgen -destination=./db/mock_kvstore.go  \
    79          -source=./db/kvstore.go \
    80          -self_package=github.com/iotexproject/iotex-core/db \
    81          -package=db \
    82          KVStore
    83  
    84  mkdir -p ./test/mock/mock_batch
    85  mockgen -destination=./test/mock/mock_batch/mock_batch.go  \
    86          -source=./db/batch/batch.go \
    87          -package=mock_batch \
    88          CachedBatch
    89  
    90  mkdir -p ./test/mock/mock_sealed_envelope_validator
    91  mockgen -destination=./test/mock/mock_sealed_envelope_validator/mock_sealed_envelope_validator.go  \
    92          -source=./action/sealedenvelopevalidator.go \
    93          -package=mock_sealed_envelope_validator \
    94          SealedEnvelopeValidator
    95  
    96  mkdir -p ./test/mock/mock_chainmanager
    97  mockgen -destination=./test/mock/mock_chainmanager/mock_chainmanager.go  \
    98          -source=./action/protocol/managers.go \
    99          -package=mock_chainmanager \
   100          StateManager
   101  
   102  mkdir -p ./test/mock/mock_blocksync
   103  mockgen -destination=./test/mock/mock_blocksync/mock_blocksync.go  \
   104          -source=./blocksync/blocksync.go \
   105          -self_package=github.com/iotexproject/iotex-core/blocksync \
   106          -package=mock_blocksync \
   107          BlockSync
   108  
   109  mkdir -p ./test/mock/mock_blockcreationsubscriber
   110  mockgen -destination=./test/mock/mock_blockcreationsubscriber/mock_blockcreationsubscriber.go \
   111          -source=./blockchain/blockcreationsubscriber.go \
   112          -package=mock_blockcreationsubscriber   \
   113          BlockCreationSubscriber
   114  
   115  mkdir -p ./test/mock/mock_ioctlclient
   116  mockgen -destination=./test/mock/mock_ioctlclient/mock_ioctlclient.go  \
   117          -source=./ioctl/client.go \
   118          -package=mock_ioctlclient \
   119          Client
   120  
   121  mkdir -p ./test/mock/mock_apitypes
   122  mockgen -destination=./test/mock/mock_apiresponder/mock_apitypes.go  \
   123          -source=./api/types/types.go \
   124          -package=mock_apitypes \
   125          APITypes
   126  
   127  mkdir -p ./test/mock/mock_apiserver
   128  mockgen -destination=./test/mock/mock_apiserver/mock_apiserver.go  \
   129          -source=./api/apitestserver.go \
   130          -package=mock_apiserver \
   131          StreamBlocksServer
   132  
   133  mkdir -p ./test/mock/mock_apicoreservice
   134  mockgen -destination=./test/mock/mock_apicoreservice/mock_apicoreservice.go  \
   135          -source=./api/coreservice.go \
   136          -package=mock_apicoreservice \
   137          CoreService
   138  
   139  mkdir -p ./test/mock/mock_blockindex
   140  mockgen -destination=./test/mock/mock_blockindex/mock_blockindex.go  \
   141          -source=./blockindex/bloomfilterindexer.go \
   142          -package=mock_blockindex \
   143          BlockIndex
   144          
   145  mkdir -p ./test/mock/mock_web3server
   146  mockgen -destination=./test/mock/mock_web3server/mock_web3server.go  \
   147          -source=./api/web3server.go \
   148          -package=mock_web3server \
   149          Web3Handler
   150  
   151  mkdir -p ./test/mock/mock_nodeinfo
   152  mockgen -destination=./test/mock/mock_nodeinfo/mock_manager.go  \
   153          -source=./nodeinfo/manager.go \
   154          -package=mock_nodeinfo \
   155          transmitter chain
   156  
   157  mkdir -p ./action/protocol/staking
   158  mockgen -destination=./action/protocol/staking/contractstake_indexer_mock.go  \
   159          -source=./action/protocol/staking/contractstake_indexer.go \
   160          -package=staking \
   161          ContractStakingIndexer
   162  
   163  mkdir -p ./test/mock/mock_blockdao
   164  mockgen -destination=./test/mock/mock_blockdao/mock_blockindexer.go  \
   165          -package=mock_blockdao \
   166          github.com/iotexproject/iotex-core/blockchain/blockdao \
   167          BlockIndexer
   168  mockgen -destination=./test/mock/mock_blockdao/mock_blockindexer_withstart.go  \
   169          -package=mock_blockdao \
   170          github.com/iotexproject/iotex-core/blockchain/blockdao \
   171          BlockIndexerWithStart