@@ -72,6 +72,7 @@ BUILT_TEST_PROGRAMS = \
72
72
test/hfile \
73
73
test/sam \
74
74
test/test_bgzf \
75
+ test/test-ref \
75
76
test/test_realn \
76
77
test/test-regidx \
77
78
test/test_view \
@@ -140,6 +141,7 @@ LIBHTS_OBJS = \
140
141
multipart.o \
141
142
probaln.o \
142
143
realn.o \
144
+ ref.o \
143
145
regidx.o \
144
146
sam.o \
145
147
synced_bcf_reader.o \
@@ -158,8 +160,6 @@ LIBHTS_OBJS = \
158
160
cram/cram_samtools.o \
159
161
cram/cram_stats.o \
160
162
cram/files.o \
161
- cram/mFILE.o \
162
- cram/open_trace_file.o \
163
163
cram/pooled_alloc.o \
164
164
cram/rANS_static.o \
165
165
cram/sam_header.o \
@@ -174,11 +174,12 @@ cram_misc_h = cram/misc.h $(cram_os_h)
174
174
cram_os_h = cram/os.h $(htslib_hts_endian_h )
175
175
cram_sam_header_h = cram/sam_header.h cram/string_alloc.h cram/pooled_alloc.h $(htslib_khash_h ) $(htslib_kstring_h )
176
176
cram_samtools_h = cram/cram_samtools.h $(htslib_sam_h ) $(cram_sam_header_h )
177
- cram_structs_h = cram/cram_structs.h $(htslib_thread_pool_h ) cram/string_alloc.h cram/mFILE.h $(htslib_khash_h )
178
- cram_open_trace_file_h = cram/open_trace_file.h cram/mFILE.h
179
177
bcf_sr_sort_h = bcf_sr_sort.h $(htslib_synced_bcf_reader_h ) $(htslib_kbitset_h )
178
+ cram_structs_h = cram/cram_structs.h $(htslib_thread_pool_h ) cram/string_alloc.h $(htslib_khash_h )
179
+
180
180
hfile_internal_h = hfile_internal.h $(htslib_hfile_h ) $(textutils_internal_h )
181
181
hts_internal_h = hts_internal.h $(htslib_hts_h ) $(textutils_internal_h )
182
+ ref_internal_h = ref_internal.h $(htslib_hfile_h ) cram/mFILE.h
182
183
textutils_internal_h = textutils_internal.h $(htslib_kstring_h )
183
184
thread_pool_internal_h = thread_pool_internal.h $(htslib_thread_pool_h )
184
185
@@ -316,18 +317,17 @@ plugin.o plugin.pico: plugin.c config.h $(hts_internal_h) $(htslib_kstring_h)
316
317
probaln.o probaln.pico : probaln.c config.h $(htslib_hts_h )
317
318
realn.o realn.pico : realn.c config.h $(htslib_hts_h ) $(htslib_sam_h )
318
319
textutils.o textutils.pico : textutils.c config.h $(htslib_hfile_h ) $(htslib_kstring_h ) $(hts_internal_h )
320
+ ref.o ref.pico : ref.c config.h $(htslib_kstring_h ) $(htslib_bgzf_h ) $(cram_h ) $(cram_io_h ) $(htslib_hfile_h )
319
321
320
322
cram/cram_codecs.o cram/cram_codecs.pico : cram/cram_codecs.c config.h $(cram_h )
321
323
cram/cram_decode.o cram/cram_decode.pico : cram/cram_decode.c config.h $(cram_h ) $(cram_os_h ) $(htslib_hts_h )
322
324
cram/cram_encode.o cram/cram_encode.pico : cram/cram_encode.c config.h $(cram_h ) $(cram_os_h ) $(htslib_hts_h ) $(htslib_hts_endian_h )
323
325
cram/cram_external.o cram/cram_external.pico : cram/cram_external.c config.h $(htslib_hfile_h ) $(cram_h )
324
326
cram/cram_index.o cram/cram_index.pico : cram/cram_index.c config.h $(htslib_bgzf_h ) $(htslib_hfile_h ) $(hts_internal_h ) $(cram_h ) $(cram_os_h )
325
- cram/cram_io.o cram/cram_io.pico : cram/cram_io.c config.h os/lzma_stub.h $(cram_h ) $(cram_os_h ) $(htslib_hts_h ) $(cram_open_trace_file_h ) cram/rANS_static.h $(htslib_hfile_h ) $(htslib_bgzf_h ) $(htslib_faidx_h ) $(hts_internal_h )
327
+ cram/cram_io.o cram/cram_io.pico : cram/cram_io.c config.h os/lzma_stub.h $(cram_h ) $(cram_os_h ) $(htslib_hts_h ) $(htslib_ref_h ) cram/rANS_static.h $(htslib_hfile_h ) $(htslib_bgzf_h ) $(htslib_faidx_h ) $(hts_internal_h )
326
328
cram/cram_samtools.o cram/cram_samtools.pico : cram/cram_samtools.c config.h $(cram_h ) $(htslib_sam_h )
327
329
cram/cram_stats.o cram/cram_stats.pico : cram/cram_stats.c config.h $(cram_h ) $(cram_os_h )
328
330
cram/files.o cram/files.pico : cram/files.c config.h $(cram_misc_h )
329
- cram/mFILE.o cram/mFILE.pico : cram/mFILE.c config.h $(htslib_hts_log_h ) $(cram_os_h ) cram/mFILE.h
330
- cram/open_trace_file.o cram/open_trace_file.pico : cram/open_trace_file.c config.h $(cram_os_h ) $(cram_open_trace_file_h ) $(cram_misc_h ) $(htslib_hfile_h ) $(htslib_hts_log_h )
331
331
cram/pooled_alloc.o cram/pooled_alloc.pico : cram/pooled_alloc.c config.h cram/pooled_alloc.h $(cram_misc_h )
332
332
cram/rANS_static.o cram/rANS_static.pico : cram/rANS_static.c config.h cram/rANS_static.h cram/rANS_byte.h
333
333
cram/sam_header.o cram/sam_header.pico : cram/sam_header.c config.h $(htslib_hts_log_h ) $(cram_sam_header_h ) cram/string_alloc.h
@@ -354,7 +354,7 @@ tabix.o: tabix.c config.h $(htslib_tbx_h) $(htslib_sam_h) $(htslib_vcf_h) $(htsl
354
354
#
355
355
# If using MSYS, avoid poor shell expansion via:
356
356
# MSYS2_ARG_CONV_EXCL="*" make check
357
- check test : $(BUILT_PROGRAMS ) $(BUILT_TEST_PROGRAMS )
357
+ check test : $(BUILT_PROGRAMS ) $(BUILT_TEST_PROGRAMS ) test_ebi_fetch
358
358
test/hts_endian
359
359
test/fieldarith test/fieldarith.sam
360
360
test/hfile
@@ -364,6 +364,26 @@ check test: $(BUILT_PROGRAMS) $(BUILT_TEST_PROGRAMS)
364
364
test/test-regidx
365
365
cd test && REF_PATH=: ./test.pl $$ {TEST_OPTS:-}
366
366
367
+ test_ebi_fetch :
368
+ @if [ " $( ENABLE_HTTP_TESTS) " = true ] ; then \
369
+ export REF_CACHE=` mktemp -d` && \
370
+ echo " test ref: fetching" && \
371
+ test/test-ref && \
372
+ echo " test ref: fetch from cache" && \
373
+ test/test-ref && \
374
+ rm -rf $$ REF_CACHE; \
375
+ export REF_CACHE=` mktemp -d` && \
376
+ test/test_view -t test/xx.fa -S -C test/xx#rg.sam > test/xx#rg.tmp.cram && \
377
+ echo " test view: fetching" && \
378
+ test/test_view -D test/xx#rg.tmp.cram > /dev/null && \
379
+ echo " test view: fetch from cache" && \
380
+ test/test_view -D test/xx#rg.tmp.cram > /dev/null && \
381
+ rm -rf $$ REF_CACHE; \
382
+ else \
383
+ echo " Warning: testing of EBI fetching disabled" ; \
384
+ fi
385
+
386
+
367
387
test/hts_endian : test/hts_endian.o
368
388
$(CC ) $(LDFLAGS ) -o $@ test/hts_endian.o $(LIBS )
369
389
@@ -379,6 +399,9 @@ test/sam: test/sam.o libhts.a
379
399
test/test_bgzf : test/test_bgzf.o libhts.a
380
400
$(CC ) $(LDFLAGS ) -o $@ test/test_bgzf.o libhts.a -lz $(LIBS ) -lpthread
381
401
402
+ test/test-ref : test/test-ref.o libhts.a
403
+ $(CC ) $(LDFLAGS ) -o $@ test/test-ref.o libhts.a $(LIBS ) -lpthread
404
+
382
405
test/test_realn : test/test_realn.o libhts.a
383
406
$(CC ) $(LDFLAGS ) -o $@ test/test_realn.o libhts.a $(LIBS ) -lpthread
384
407
@@ -406,6 +429,7 @@ test/hfile.o: test/hfile.c config.h $(htslib_hfile_h) $(htslib_hts_defs_h)
406
429
test/sam.o : test/sam.c config.h $(htslib_hts_defs_h ) $(htslib_sam_h ) $(htslib_faidx_h ) $(htslib_kstring_h )
407
430
test/test_bgzf.o : test/test_bgzf.c config.h $(htslib_bgzf_h ) $(htslib_hfile_h ) $(hfile_internal_h )
408
431
test/test-realn.o : test/test_realn.c config.h $(htslib_hts_h ) $(htslib_sam_h ) $(htslib_faidx_h )
432
+ test/test-ref.o : test/test-ref.c $(htslib_bgzf_h )
409
433
test/test-regidx.o : test/test-regidx.c config.h $(htslib_regidx_h ) $(hts_internal_h )
410
434
test/test_view.o : test/test_view.c config.h $(cram_h ) $(htslib_sam_h )
411
435
test/test-vcf-api.o : test/test-vcf-api.c config.h $(htslib_hts_h ) $(htslib_vcf_h ) $(htslib_kstring_h ) $(htslib_kseq_h )
0 commit comments