File: Makefile

package info (click to toggle)
sra-sdk 2.8.1-2%2Bdfsg-2~bpo8%2B1
  • links: PTS, VCS
  • area: main
  • in suites: jessie-backports
  • size: 19,012 kB
  • sloc: ansic: 164,474; cpp: 20,802; sh: 4,885; perl: 3,708; makefile: 3,286; python: 2,817; yacc: 471; lex: 412; lisp: 77; xml: 28
file content (187 lines) | stat: -rw-r--r-- 6,169 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
# ===========================================================================
#
#                            PUBLIC DOMAIN NOTICE
#               National Center for Biotechnology Information
#
#  This software/database is a "United States Government Work" under the
#  terms of the United States Copyright Act.  It was written as part of
#  the author's official duties as a United States Government employee and
#  thus cannot be copyrighted.  This software/database is freely available
#  to the public for use. The National Library of Medicine and the U.S.
#  Government have not placed any restriction on its use or reproduction.
#
#  Although all reasonable efforts have been taken to ensure the accuracy
#  and reliability of the software and data, the NLM and the U.S.
#  Government do not and cannot warrant the performance or results that
#  may be obtained by using this software or data. The NLM and the U.S.
#  Government disclaim all warranties, express or implied, including
#  warranties of performance, merchantability or fitness for any particular
#  purpose.
#
#  Please cite the author in any work or product based on this material.
#
# ===========================================================================

default: runtests
	@ rm tmp.kfg

TOP ?= $(abspath ../..)

MODULE = test/general-loader

TEST_TOOLS = \
    test-general-loader \
	test-general-writer \
	test-gw-dumper

ALL_TOOLS = \
	$(TEST_TOOLS) \

include $(TOP)/build/Makefile.env

$(shell echo "vdb/schema/paths = \"$(VDB_INCDIR)\"" > tmp.kfg)
VDB_CONFIG = $(shell pwd)

INCDIRS += -I$(TOP)/tools/general-loader

$(ALL_TOOLS): makedirs
	@ $(MAKE_CMD) $(TEST_BINDIR)/$@

.PHONY: $(TEST_TOOLS)

clean: stdclean

#-------------------------------------------------------------------------------
# test-general-loader
#
TEST_GEN_LOAD_SRC = \
	test-general-loader \
    testsource

TEST_GEN_LOAD_OBJ = \
	$(addsuffix .$(OBJX),$(TEST_GEN_LOAD_SRC))

TEST_GEN_LOAD_LIB =   \
	-sncbi-wvdb  \
    -sload              \
	-skapp              \
    -sktst              \

$(TEST_BINDIR)/test-general-loader: $(TEST_GEN_LOAD_OBJ)
	$(LP) --exe -o $@ $^ $(TEST_GEN_LOAD_LIB)

gen_load: test-general-loader
	$(TEST_BINDIR)/test-general-loader

#-------------------------------------------------------------------------------
# test-general-writer
#
TEST_GEN_WRITE_SRC = \
	test-general-writer

TEST_GEN_WRITE_OBJ = \
	$(addsuffix .$(OBJX),$(TEST_GEN_WRITE_SRC))

TEST_GEN_WRITE_LIB =   \
    -L$(LIBDIR) \
    -sgeneral-writer


$(TEST_BINDIR)/test-general-writer: $(TEST_GEN_WRITE_OBJ)
	$(LP) --exe -o $@ $^ $(TEST_GEN_WRITE_LIB)

runtests:$(TEST_TOOLS) #piped-load-tests

piped-load-tests: $(ALL_TOOLS)
	-$(TEST_BINDIR)/test-general-writer | $(BINDIR)/general-loader -L=info
	-$(BINDIR)/vdb-dump -T table1 remote_db
	rm -rf remote_db

#-------------------------------------------------------------------------------
# test-gw-dumper
#
TEST_GW_DUMP_SRC = \
	test-gw-dumper

TEST_GW_DUMP_OBJ = \
	$(addsuffix .$(OBJX),$(TEST_GW_DUMP_SRC))

TEST_GW_DUMP_LIB =   \
	-sgeneral-writer  \

$(TEST_BINDIR)/test-gw-dumper: $(TEST_GW_DUMP_OBJ)
	$(LP) --exe -o $@ $^ $(TEST_GW_DUMP_LIB)

gw_dump: test-gw-dumper
	$(TEST_BINDIR)/$^

#-------------------------------------------------------------------------------
# general-loader tool tests
#
runtests: setup tool-tests 

setup:
	@ mkdir -p db

$(TEST_BINDIR)/makeinputs: makeinputs.cpp
	@# generate numbered input streams for tool tests
	$(CXX) makeinputs.cpp testsource.cpp -o $(TEST_BINDIR)/makeinputs -I$(INCDIRS) -L$(VDB_LIBDIR) -lncbi-vdb

tool-tests: $(TEST_BINDIR)/makeinputs
	@mkdir -p input && $(TEST_BINDIR)/makeinputs && rm $(TEST_BINDIR)/makeinputs
	@#    
	@# basic, unpacked
	@$(SRCDIR)/runtestcase.sh $(BINDIR) vdb-dump $(SRCDIR) 1 0 -I=$(VDB_INCDIR)
	@#    
	@# basic, packed
	@$(SRCDIR)/runtestcase.sh $(BINDIR) vdb-dump $(SRCDIR) 1packed 0 -I=$(VDB_INCDIR)
	@#    
	@# target db override 
	@# use 1.gl which specifies the target as actual/1/db, and override that to where the script expects to see the result
	@cp input/1.gl input/1override.gl && $(SRCDIR)/runtestcase.sh $(BINDIR) vdb-dump $(SRCDIR) 1override 0 "-I=$(VDB_INCDIR) --target actual/1override/db"
	@# same with the storthand option
	@cp input/1.gl input/1override.gl && $(SRCDIR)/runtestcase.sh $(BINDIR) vdb-dump $(SRCDIR) 1override 0 "-I=$(VDB_INCDIR) -T actual/1override/db"
	@#    
	@# error message event, unpacked
	@$(SRCDIR)/runtestcase.sh $(BINDIR) vdb-dump $(SRCDIR) 2 3 "-I=$(VDB_INCDIR) -L=err"
	@#    
	@# error message event, packed
	@$(SRCDIR)/runtestcase.sh $(BINDIR) vdb-dump $(SRCDIR) 2packed 3 "-I=$(VDB_INCDIR) -L=err"
	@#    
	@# empty default values, unpacked
	@$(SRCDIR)/runtestcase.sh $(BINDIR) vdb-dump $(SRCDIR) 3 0 -I=$(VDB_INCDIR)
	@#    
	@# empty default values, packed
	@$(SRCDIR)/runtestcase.sh $(BINDIR) vdb-dump $(SRCDIR) 3packed 0 -I=$(VDB_INCDIR)
	@#    
	@# move ahead event, unpacked
	@$(SRCDIR)/runtestcase.sh $(BINDIR) vdb-dump $(SRCDIR) 4 0 -I=$(VDB_INCDIR)
	@#    
	@# move ahead event, packed
	@$(SRCDIR)/runtestcase.sh $(BINDIR) vdb-dump $(SRCDIR) 4packed 0 -I=$(VDB_INCDIR)
	@#    
	@# integer compression (packed only)
	@$(SRCDIR)/runtestcase.sh $(BINDIR) vdb-dump $(SRCDIR) 5packed 0 "-L=info -I=$(VDB_INCDIR)"
	@#    
	@# software name in the metadata, unpacked   
	@$(SRCDIR)/runtestcase.sh $(BINDIR) kdbmeta $(SRCDIR) 6 0 "-L=info -I=$(VDB_INCDIR)" SOFTWARE/formatter
	@#    
	@# software name in the metadata, packed   
	@$(SRCDIR)/runtestcase.sh $(BINDIR) kdbmeta $(SRCDIR) 6packed 0 "-L=info -I=$(VDB_INCDIR)" SOFTWARE/formatter
	@#    
	@rm -rf input/*.gl actual/*

one-tool: $(TEST_BINDIR)/makeinputs
	@mkdir -p input && $(TEST_BINDIR)/makeinputs && rm $(TEST_BINDIR)/makeinputs
	@$(SRCDIR)/runtestcase.sh $(BINDIR) kdbmeta $(SRCDIR) 6 0 "-L=info -I=$(VDB_INCDIR)" SOFTWARE/formatter


#-------------------------------------------------------------------------------
# general-loader tool tests
#
slowtests: #piped-dump

piped-dump: $(BINDIR)/pileup-stats test-general-loader
	#$(BINDIR)/pileup-stats SRR1063272 | $(BINDIR)/general-loader #-L=info
	$(BINDIR)/pileup-stats SRR1232302 | $(BINDIR)/general-loader -L=info