mirror of
https://github.com/TREX-CoE/qmckl.git
synced 2025-01-03 10:06:09 +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,9 +13,16 @@ See the [source code](https://github.com/TREX-CoE/qmckl/tree/main/src)
|
|||||||
to read the documentation.
|
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.
|
||||||
|
|
||||||
|
|
||||||
------------------------------
|
------------------------------
|
||||||
|
|
||||||
![European flag](https://trex-coe.eu/sites/default/files/inline-images/euflag.jpg)
|
![European flag](https://trex-coe.eu/sites/default/files/inline-images/euflag.jpg)
|
||||||
[TREX: Targeting Real Chemical Accuracy at the Exascale](https://trex-coe.eu) project has received funding from the European Union’s Horizon 2020 - Research and Innovation program - under grant agreement no. 952165. The content of this document does not represent the opinion of the European Union, and the European Union is not responsible for any use that might be made of such content.
|
[TREX: Targeting Real Chemical Accuracy at the Exascale](https://trex-coe.eu) project has received funding from the European Union’s Horizon 2020 - Research and Innovation program - under grant agreement no. 952165. The content of this document does not represent the opinion of the European Union, and the European Union is not responsible for any use that might be made of such content.
|
||||||
|
|
||||||
|
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
|
libqmckl.so: Makefile.generated
|
||||||
$(MAKE) -f Makefile.generated
|
$(MAKE) -f Makefile.generated
|
||||||
|
|
||||||
|
test: Makefile.generated
|
||||||
|
$(MAKE) -f Makefile.generated test
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
rm -f qmckl.h test_qmckl_*.c test_qmckl_*.f90 qmckl_*.f90 qmckl_*.c qmckl_*.o qmckl_*.h Makefile.generated libqmckl.so
|
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"
|
OBJECTS="${OBJECTS} ${FILE}.o"
|
||||||
done >> $OUTPUT
|
done >> $OUTPUT
|
||||||
|
|
||||||
|
TESTS=""
|
||||||
|
for i in $(ls test_*.c) ; do
|
||||||
|
FILE=${i%.c}
|
||||||
|
TESTS="${TESTS} ${FILE}"
|
||||||
|
done >> $OUTPUT
|
||||||
|
|
||||||
|
|
||||||
# Write the Makefile
|
# Write the Makefile
|
||||||
|
|
||||||
@ -45,6 +51,7 @@ CFLAGS=$CFLAGS
|
|||||||
FC=$FC
|
FC=$FC
|
||||||
FFLAGS=$FFLAGS
|
FFLAGS=$FFLAGS
|
||||||
OBJECT_FILES=$OBJECTS
|
OBJECT_FILES=$OBJECTS
|
||||||
|
TESTS=$TESTS
|
||||||
|
|
||||||
libqmckl.so: \$(OBJECT_FILES)
|
libqmckl.so: \$(OBJECT_FILES)
|
||||||
\$(CC) -shared \$(OBJECT_FILES) -o libqmckl.so
|
\$(CC) -shared \$(OBJECT_FILES) -o libqmckl.so
|
||||||
@ -55,6 +62,13 @@ libqmckl.so: \$(OBJECT_FILES)
|
|||||||
%.o: %.f90
|
%.o: %.f90
|
||||||
\$(FC) \$(FFLAGS) -c \$*.f90 -o \$*.o
|
\$(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
|
EOF
|
||||||
|
|
||||||
for i in $(ls qmckl_*.c) ; do
|
for i in $(ls qmckl_*.c) ; do
|
||||||
@ -67,3 +81,4 @@ for i in $(ls qmckl_*.f90) ; do
|
|||||||
echo "${FILE}.o: ${FILE}.f90"
|
echo "${FILE}.o: ${FILE}.f90"
|
||||||
done >> $OUTPUT
|
done >> $OUTPUT
|
||||||
|
|
||||||
|
|
||||||
|
@ -441,7 +441,7 @@ int qmckl_context_get_range(const qmckl_context context) {
|
|||||||
|
|
||||||
*** Test
|
*** Test
|
||||||
#+BEGIN_SRC C :tangle test_qmckl_context.c
|
#+BEGIN_SRC C :tangle test_qmckl_context.c
|
||||||
return QMCKL_SUCCESS;
|
return rc;
|
||||||
}
|
}
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
|
|
||||||
|
@ -89,6 +89,6 @@ void qmckl_free(void *ptr) {
|
|||||||
|
|
||||||
*** Test
|
*** Test
|
||||||
#+BEGIN_SRC C :tangle test_qmckl_memory.c
|
#+BEGIN_SRC C :tangle test_qmckl_memory.c
|
||||||
return QMCKL_SUCCESS;
|
return rc;
|
||||||
}
|
}
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
|
Loading…
Reference in New Issue
Block a user