mirror of
https://github.com/TREX-CoE/qmckl.git
synced 2025-01-03 01:56:18 +01:00
Make test
This commit is contained in:
parent
456c6fc100
commit
722d6dd540
3
.gitmodules
vendored
Normal file
3
.gitmodules
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
[submodule "munit"]
|
||||
path = munit
|
||||
url = https://github.com/nemequ/munit/
|
@ -13,6 +13,13 @@ See the [source code](https://github.com/TREX-CoE/qmckl/tree/main/src)
|
||||
to read the documentation.
|
||||
|
||||
|
||||
To clone the repository, use:
|
||||
```
|
||||
git clone --recursive https://github.com/TREX-CoE/qmckl.git
|
||||
```
|
||||
to dowload also the [munit](https://github.com/nemequ/munit) unit testing
|
||||
framework.
|
||||
|
||||
|
||||
------------------------------
|
||||
|
||||
|
1
munit
Submodule
1
munit
Submodule
@ -0,0 +1 @@
|
||||
Subproject commit fbbdf1467eb0d04a6ee465def2e529e4c87f2118
|
@ -16,6 +16,9 @@ OBJECT_FILES=$(filter-out $(EXCLUDED_OBJECTS), $(patsubst %.org,%.o,$(ORG_SOURCE
|
||||
libqmckl.so: Makefile.generated
|
||||
$(MAKE) -f Makefile.generated
|
||||
|
||||
test: Makefile.generated
|
||||
$(MAKE) -f Makefile.generated test
|
||||
|
||||
clean:
|
||||
rm -f qmckl.h test_qmckl_*.c test_qmckl_*.f90 qmckl_*.f90 qmckl_*.c qmckl_*.o qmckl_*.h Makefile.generated libqmckl.so
|
||||
|
||||
|
@ -35,6 +35,12 @@ for i in $(ls qmckl_*.f90) ; do
|
||||
OBJECTS="${OBJECTS} ${FILE}.o"
|
||||
done >> $OUTPUT
|
||||
|
||||
TESTS=""
|
||||
for i in $(ls test_*.c) ; do
|
||||
FILE=${i%.c}
|
||||
TESTS="${TESTS} ${FILE}"
|
||||
done >> $OUTPUT
|
||||
|
||||
|
||||
# Write the Makefile
|
||||
|
||||
@ -45,6 +51,7 @@ CFLAGS=$CFLAGS
|
||||
FC=$FC
|
||||
FFLAGS=$FFLAGS
|
||||
OBJECT_FILES=$OBJECTS
|
||||
TESTS=$TESTS
|
||||
|
||||
libqmckl.so: \$(OBJECT_FILES)
|
||||
\$(CC) -shared \$(OBJECT_FILES) -o libqmckl.so
|
||||
@ -55,6 +62,13 @@ libqmckl.so: \$(OBJECT_FILES)
|
||||
%.o: %.f90
|
||||
\$(FC) \$(FFLAGS) -c \$*.f90 -o \$*.o
|
||||
|
||||
test_%: test_%.c
|
||||
\$(CC) \$(CFLAGS) -Wl,-rpath,$PWD -L. \
|
||||
-I../munit/ ../munit/munit.c test_\$*.c -lqmckl -o test_\$*
|
||||
|
||||
test: libqmckl.so \$(TESTS)
|
||||
|
||||
.PHONY: test
|
||||
EOF
|
||||
|
||||
for i in $(ls qmckl_*.c) ; do
|
||||
@ -67,3 +81,4 @@ for i in $(ls qmckl_*.f90) ; do
|
||||
echo "${FILE}.o: ${FILE}.f90"
|
||||
done >> $OUTPUT
|
||||
|
||||
|
||||
|
@ -441,7 +441,7 @@ int qmckl_context_get_range(const qmckl_context context) {
|
||||
|
||||
*** Test
|
||||
#+BEGIN_SRC C :tangle test_qmckl_context.c
|
||||
return QMCKL_SUCCESS;
|
||||
return rc;
|
||||
}
|
||||
#+END_SRC
|
||||
|
||||
|
@ -89,6 +89,6 @@ void qmckl_free(void *ptr) {
|
||||
|
||||
*** Test
|
||||
#+BEGIN_SRC C :tangle test_qmckl_memory.c
|
||||
return QMCKL_SUCCESS;
|
||||
return rc;
|
||||
}
|
||||
#+END_SRC
|
||||
|
Loading…
Reference in New Issue
Block a user