lightningd/test: move some tests to common/ and channeld/

These unit tests stayed under lightningd/ even though the units they test
are elsewhere.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell 2018-12-03 09:31:04 +10:30 committed by Christian Decker
parent aee2197a66
commit a046af4416
7 changed files with 17 additions and 18 deletions

View File

@ -10,6 +10,9 @@ ALL_OBJS += $(CHANNELD_TEST_OBJS)
CHANNELD_TEST_COMMON_OBJS := \
common/daemon_conn.o \
common/htlc_state.o \
common/htlc_tx.o \
common/initial_commit_tx.o \
common/key_derive.o \
common/pseudorand.o \
common/msg_queue.o \
common/utils.o \

View File

@ -1,4 +1,3 @@
#include "../../common/key_derive.c"
#include <inttypes.h>
#include <stdio.h>
#include <common/type_to_string.h>
@ -6,15 +5,15 @@ static bool print_superverbose;
#define SUPERVERBOSE(...) \
do { if (print_superverbose) printf(__VA_ARGS__); } while(0)
#define PRINT_ACTUAL_FEE
#include "../../channeld/commit_tx.c"
#include "../../common/initial_commit_tx.c"
#include "../../common/htlc_tx.c"
#include "../commit_tx.c"
#include <bitcoin/preimage.h>
#include <bitcoin/privkey.h>
#include <bitcoin/pubkey.h>
#include <ccan/array_size/array_size.h>
#include <ccan/err/err.h>
#include <ccan/str/hex/hex.h>
#include <common/key_derive.h>
#include <common/status.h>
/* Turn this on to brute-force fee values */
/*#define DEBUG */

View File

@ -1,10 +1,7 @@
#include "../../common/key_derive.c"
#include "../../common/keyset.c"
#include "../../common/initial_channel.c"
#include "../../channeld/full_channel.c"
#include "../../common/initial_commit_tx.c"
#include "../../channeld/commit_tx.c"
#include "../../common/htlc_tx.c"
#include "../../common/keyset.c"
#include "../full_channel.c"
#include "../commit_tx.c"
#include <bitcoin/preimage.h>
#include <bitcoin/privkey.h>
#include <bitcoin/pubkey.h>
@ -13,6 +10,7 @@
#include <common/sphinx.h>
#include <common/type_to_string.h>
#include <stdio.h>
#include <wally_core.h>
void status_fmt(enum log_level level UNUSED, const char *fmt, ...)
{

View File

@ -9,9 +9,11 @@
#include <inttypes.h>
#include <stdio.h>
#define SUPERVERBOSE printf
#include "../../common/funding_tx.c"
#include "../funding_tx.c"
#undef SUPERVERBOSE
#include "../../common/key_derive.c"
#include "../key_derive.c"
#include "../type_to_string.c"
#include "../permute_tx.c"
#if 0
static struct sha256 sha256_from_hex(const char *hex)

View File

@ -2,10 +2,10 @@
#include <assert.h>
#include <ccan/str/hex/hex.h>
#include <common/type_to_string.h>
#include <common/utils.h>
#include <stdio.h>
#include "../../common/key_derive.c"
#include "../type_to_string.c"
#include "../key_derive.c"
static struct secret secret_from_hex(const char *hex)
{

View File

@ -13,6 +13,7 @@ LIGHTNINGD_TEST_COMMON_OBJS := \
common/htlc_state.o \
common/io_lock.o \
common/json.o \
common/key_derive.o \
common/pseudorand.o \
common/memleak.o \
common/msg_queue.o \

View File

@ -6,10 +6,6 @@
bool deprecated_apis = false;
/* AUTOGENERATED MOCKS START */
/* Generated stub for bip32_pubkey */
bool bip32_pubkey(const struct ext_key *bip32_base UNNEEDED,
struct pubkey *pubkey UNNEEDED, u32 index UNNEEDED)
{ fprintf(stderr, "bip32_pubkey called!\n"); abort(); }
/* Generated stub for bitcoind_gettxout */
void bitcoind_gettxout(struct bitcoind *bitcoind UNNEEDED,
const struct bitcoin_txid *txid UNNEEDED, const u32 outnum UNNEEDED,