diff --git a/tests/Dockerfile_foxy b/tests/Dockerfile_foxy index ccbcbb92a..76973ff7b 100644 --- a/tests/Dockerfile_foxy +++ b/tests/Dockerfile_foxy @@ -11,13 +11,12 @@ RUN apt-get install -y \ libclang-dev # Get ros test messages -RUN apt-get install -y ros-foxy-test-msgs +RUN apt-get install -y ros-foxy-test-msgs ros-foxy-example-interfaces # Get Rust RUN curl --proto '=https' --tlsv1.2 https://sh.rustup.rs -sSf | bash -s -- -y RUN echo 'source $HOME/.cargo/env' >> $HOME/.bashrc COPY . /r2r -RUN rm /bin/sh && ln -s /bin/bash /bin/sh -RUN chmod +x /r2r/tests/test.sh -ENTRYPOINT [ "/r2r/tests/test.sh" ] +RUN chmod +x /r2r/tests/test.bash +ENTRYPOINT [ "/r2r/tests/test.bash" ] diff --git a/tests/Dockerfile_galactic b/tests/Dockerfile_galactic index 698832812..99d7201df 100644 --- a/tests/Dockerfile_galactic +++ b/tests/Dockerfile_galactic @@ -11,13 +11,12 @@ RUN apt-get install -y \ libclang-dev # Get ros test messages -RUN apt-get install -y ros-galactic-test-msgs +RUN apt-get install -y ros-galactic-test-msgs ros-galactic-example-interfaces # Get Rust RUN curl --proto '=https' --tlsv1.2 https://sh.rustup.rs -sSf | bash -s -- -y RUN echo 'source $HOME/.cargo/env' >> $HOME/.bashrc COPY . /r2r -RUN rm /bin/sh && ln -s /bin/bash /bin/sh -RUN chmod +x /r2r/tests/test.sh -ENTRYPOINT [ "/r2r/tests/test.sh" ] +RUN chmod +x /r2r/tests/test.bash +ENTRYPOINT [ "/r2r/tests/test.bash" ] diff --git a/tests/Dockerfile_humble b/tests/Dockerfile_humble index a7a8c351f..76d10d009 100644 --- a/tests/Dockerfile_humble +++ b/tests/Dockerfile_humble @@ -11,13 +11,12 @@ RUN apt-get install -y \ libclang-dev # Get ros test messages -RUN apt-get install -y ros-humble-test-msgs +RUN apt-get install -y ros-humble-test-msgs ros-humble-example-interfaces # Get Rust RUN curl --proto '=https' --tlsv1.2 https://sh.rustup.rs -sSf | bash -s -- -y RUN echo 'source $HOME/.cargo/env' >> $HOME/.bashrc COPY . /r2r -RUN rm /bin/sh && ln -s /bin/bash /bin/sh -RUN chmod +x /r2r/tests/test.sh -ENTRYPOINT [ "/r2r/tests/test.sh" ] +RUN chmod +x /r2r/tests/test.bash +ENTRYPOINT [ "/r2r/tests/test.bash" ] diff --git a/tests/test.bash b/tests/test.bash new file mode 100644 index 000000000..e0608f520 --- /dev/null +++ b/tests/test.bash @@ -0,0 +1,17 @@ +#!/bin/bash + +# run rustup to test with latest rust version +/root/.cargo/bin/rustup update + +if [ -e "/opt/ros/humble/setup.bash" ]; then + source "/opt/ros/humble/setup.bash" +fi +if [ -e "/opt/ros/galactic/setup.bash" ]; then + source "/opt/ros/galactic/setup.bash" +fi +if [ -e "/opt/ros/foxy/setup.bash" ]; then + source "/opt/ros/foxy/setup.bash" +fi + +cd /r2r/ +/root/.cargo/bin/cargo test diff --git a/tests/test.sh b/tests/test.sh deleted file mode 100644 index 39f713a31..000000000 --- a/tests/test.sh +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/bash - -# rustup to test with latest rust version -rustup update - -cd /r2r/ -/root/.cargo/bin/cargo test